83 lines
2.5 KiB
C#
83 lines
2.5 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using EAS.Services;
|
||
using SOH.Entities;
|
||
using SOH.Data;
|
||
using EAS.Data.Linq;
|
||
using EAS.Data.ORM;
|
||
|
||
namespace SOH.BLL
|
||
{
|
||
[ServiceObject("回款记录表")]
|
||
[ServiceBind(typeof(It_ttsfjl))]
|
||
public class t_ttsfjlBll : It_ttsfjl
|
||
{
|
||
|
||
public List<Entities.t_ttsfjl> GetList(int htbm)
|
||
{
|
||
using (DbEntities db = new DbEntities())
|
||
{
|
||
//return db.t_ttsfjls.Where(t => t.htbm == htbm).ToList();
|
||
var data = db.t_ttsfjls.Where(t => t.htbm == htbm);
|
||
if (data.Any())
|
||
{
|
||
return data.ToList();
|
||
}
|
||
else
|
||
{
|
||
return null;
|
||
}
|
||
}
|
||
}
|
||
|
||
public OperationResult AddTtsfjl(t_ttsfjl ttt)
|
||
{
|
||
using (DbEntities db = new DbEntities())
|
||
{
|
||
OperationResult or = new OperationResult();
|
||
try
|
||
{
|
||
db.t_ttsfjls.Insert(ttt);
|
||
//t_ttsfjlrz添加相关信息,并更新相关字段,由于czxh是自增列
|
||
//string sqlstr = "insert into t_ttsfjlrz ";
|
||
//db.DataAccessor.Execute("insert into t_ttsfjlrz select * from t_ttsfjl where xh="+ttt.xh);
|
||
or.State = 1;
|
||
or.Message = "添加团检收费记录成功";
|
||
return or;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
or.State = 0;
|
||
or.Message = "添加团检收费记录失败:"+(ex.InnerException??ex).Message;
|
||
return or;
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
|
||
public OperationResult DeleteTtsfjl(t_ttsfjl ttt)
|
||
{
|
||
using (DbEntities db = new DbEntities())
|
||
{
|
||
OperationResult or = new OperationResult();
|
||
try
|
||
{
|
||
db.t_ttsfjls.Delete(ttt);
|
||
or.State = 1;
|
||
or.Message = "删除团检收费记录成功";
|
||
return or;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
or.State = 0;
|
||
or.Message = "删除团检收费记录失败:" + (ex.InnerException ?? ex).Message;
|
||
return or;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|