SGGL_SHJ/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonServic...

71 lines
3.1 KiB
C#

using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public class ConstructionLogPersonService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志作业人员明细列表
/// </summary>
/// <param name="satartRowIndex"></param>
/// <param name="maximumRows"></param>
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogPerson> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogPerson
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
/// <summary>
/// 增加施工日志作业人员明细
/// </summary>
/// <param name="managerRuleApprove">施工日志作业人员明细实体</param>
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.WGNum = constructionLogPerson.WGNum;
newConstructionLogPerson.GJGNum = constructionLogPerson.GJGNum;
newConstructionLogPerson.MGNum = constructionLogPerson.MGNum;
newConstructionLogPerson.HNTGNum = constructionLogPerson.HNTGNum;
newConstructionLogPerson.HGNum = constructionLogPerson.HGNum;
newConstructionLogPerson.JZGNum = constructionLogPerson.JZGNum;
db.ZHGL_ConstructionLogPerson.InsertOnSubmit(newConstructionLogPerson);
db.SubmitChanges();
}
/// <summary>
/// 根据月报id删除对应的所有施工日志作业人员明细
/// </summary>
/// <param name="ConstructionLogId">施工日志作业人员明细编号</param>
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();
}
}
/// <summary>
/// 根据月报id获取对应的所有施工日志作业人员明细
/// </summary>
/// <param name="ConstructionLogId">施工日志作业人员明细编号</param>
public static List<Model.ZHGL_ConstructionLogPerson> GetConstructionLogPersonsByConstructionLogId(string ConstructionLogId)
{
Model.SGGLDB db = Funs.DB;
return (from x in db.ZHGL_ConstructionLogPerson where x.ConstructionLogId == ConstructionLogId select x).ToList();
}
}
}