using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public class ConstructionLogPersonService
{
public static Model.SGGLDB db = Funs.DB;
///
/// 获取施工日志作业人员明细列表
///
///
///
///
public static List getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogPerson
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
///
/// 增加施工日志作业人员明细
///
/// 施工日志作业人员明细实体
public static void AddConstructionLogPerson(Model.ZHGL_ConstructionLogPerson constructionLogPerson)
{
Model.SGGLDB db = Funs.DB;
Model.ZHGL_ConstructionLogPerson newConstructionLogPerson = new Model.ZHGL_ConstructionLogPerson();
newConstructionLogPerson.ConstructionLogPersonId = constructionLogPerson.ConstructionLogPersonId;
newConstructionLogPerson.ConstructionLogId = constructionLogPerson.ConstructionLogId;
newConstructionLogPerson.UnitWorkId = constructionLogPerson.UnitWorkId;
newConstructionLogPerson.WorkPostId = constructionLogPerson.WorkPostId;
newConstructionLogPerson.Num = constructionLogPerson.Num;
db.ZHGL_ConstructionLogPerson.InsertOnSubmit(newConstructionLogPerson);
db.SubmitChanges();
}
///
/// 根据月报id删除对应的所有施工日志作业人员明细
///
/// 施工日志作业人员明细编号
public static void DeleteConstructionLogPersonsByConstructionLogId(string ConstructionLogId)
{
Model.SGGLDB db = Funs.DB;
var q = (from x in db.ZHGL_ConstructionLogPerson where x.ConstructionLogId == ConstructionLogId select x).ToList();
if (q.Count() > 0)
{
db.ZHGL_ConstructionLogPerson.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
///
/// 根据月报id获取对应的所有施工日志作业人员明细
///
/// 施工日志作业人员明细编号
public static List GetConstructionLogPersonsByConstructionLogId(string ConstructionLogId)
{
Model.SGGLDB db = Funs.DB;
return (from x in db.ZHGL_ConstructionLogPerson where x.ConstructionLogId == ConstructionLogId select x).ToList();
}
}
}