using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public class ConstructionLogMachineService
{
public static Model.SGGLDB db = Funs.DB;
///
/// 获取施工日志机械明细列表
///
///
///
///
public static List getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogMachine
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
///
/// 增加施工日志机械明细
///
/// 施工日志机械明细实体
public static void AddConstructionLogMachine(Model.ZHGL_ConstructionLogMachine constructionLogMachine)
{
Model.SGGLDB db = Funs.DB;
Model.ZHGL_ConstructionLogMachine newConstructionLogMachine = new Model.ZHGL_ConstructionLogMachine();
newConstructionLogMachine.ConstructionLogMachineId = constructionLogMachine.ConstructionLogMachineId;
newConstructionLogMachine.ConstructionLogId = constructionLogMachine.ConstructionLogId;
newConstructionLogMachine.UnitWorkId = constructionLogMachine.UnitWorkId;
newConstructionLogMachine.WJNum = constructionLogMachine.WJNum;
newConstructionLogMachine.DCNum = constructionLogMachine.DCNum;
newConstructionLogMachine.DZJNum = constructionLogMachine.DZJNum;
newConstructionLogMachine.GCNum = constructionLogMachine.GCNum;
newConstructionLogMachine.BCNum = constructionLogMachine.BCNum;
newConstructionLogMachine.BengCNum = constructionLogMachine.BengCNum;
db.ZHGL_ConstructionLogMachine.InsertOnSubmit(newConstructionLogMachine);
db.SubmitChanges();
}
///
/// 根据月报id删除对应的所有施工日志机械明细
///
/// 施工日志机械明细编号
public static void DeleteConstructionLogMachinesByConstructionLogId(string ConstructionLogId)
{
Model.SGGLDB db = Funs.DB;
var q = (from x in db.ZHGL_ConstructionLogMachine where x.ConstructionLogId == ConstructionLogId select x).ToList();
if (q.Count() > 0)
{
db.ZHGL_ConstructionLogMachine.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
///
/// 根据月报id获取对应的所有施工日志机械明细
///
/// 施工日志机械明细编号
public static List GetConstructionLogMachinesByConstructionLogId(string ConstructionLogId)
{
Model.SGGLDB db = Funs.DB;
return (from x in db.ZHGL_ConstructionLogMachine where x.ConstructionLogId == ConstructionLogId select x).ToList();
}
}
}