tijian_jichuang/Code/SOH.BLL.Host/t_ttsfjlBll.cs
2025-02-20 11:54:48 +08:00

83 lines
2.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}
}
}
}