using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public class ConstructionLogManagementService
{
public static Model.SGGLDB db = Funs.DB;
///
/// 获取施工日志专业管理明细列表
///
///
///
///
public static List getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogManagement
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
///
/// 增加施工日志专业管理明细
///
/// 施工日志专业管理明细实体
public static void AddConstructionLogManagement(Model.ZHGL_ConstructionLogManagement constructionLogManagement)
{
Model.SGGLDB db = Funs.DB;
Model.ZHGL_ConstructionLogManagement newConstructionLogManagement = new Model.ZHGL_ConstructionLogManagement();
newConstructionLogManagement.ConstructionLogManagementId = constructionLogManagement.ConstructionLogManagementId;
newConstructionLogManagement.ConstructionLogId = constructionLogManagement.ConstructionLogId;
newConstructionLogManagement.UnitWorkId = constructionLogManagement.UnitWorkId;
newConstructionLogManagement.TodayWork = constructionLogManagement.TodayWork;
newConstructionLogManagement.TomorrowWork = constructionLogManagement.TomorrowWork;
newConstructionLogManagement.Remark = constructionLogManagement.Remark;
db.ZHGL_ConstructionLogManagement.InsertOnSubmit(newConstructionLogManagement);
db.SubmitChanges();
}
///
/// 根据月报id删除对应的所有施工日志专业管理明细
///
/// 施工日志专业管理明细编号
public static void DeleteConstructionLogManagementsByConstructionLogId(string ConstructionLogId)
{
Model.SGGLDB db = Funs.DB;
var q = (from x in db.ZHGL_ConstructionLogManagement where x.ConstructionLogId == ConstructionLogId select x).ToList();
if (q.Count() > 0)
{
db.ZHGL_ConstructionLogManagement.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
///
/// 根据月报id获取对应的所有施工日志专业管理明细
///
/// 施工日志专业管理明细编号
public static List GetConstructionLogManagementsByConstructionLogId(string ConstructionLogId)
{
Model.SGGLDB db = Funs.DB;
return (from x in db.ZHGL_ConstructionLogManagement where x.ConstructionLogId == ConstructionLogId orderby x.UnitWorkId select x).ToList();
}
}
}