SGGL_SHJ/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementSe...

68 lines
3.1 KiB
C#

using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public class ConstructionLogManagementService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志专业管理明细列表
/// </summary>
/// <param name="satartRowIndex"></param>
/// <param name="maximumRows"></param>
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogManagement> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogManagement
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
/// <summary>
/// 增加施工日志专业管理明细
/// </summary>
/// <param name="managerRuleApprove">施工日志专业管理明细实体</param>
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();
}
/// <summary>
/// 根据月报id删除对应的所有施工日志专业管理明细
/// </summary>
/// <param name="ConstructionLogId">施工日志专业管理明细编号</param>
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();
}
}
/// <summary>
/// 根据月报id获取对应的所有施工日志专业管理明细
/// </summary>
/// <param name="ConstructionLogId">施工日志专业管理明细编号</param>
public static List<Model.ZHGL_ConstructionLogManagement> GetConstructionLogManagementsByConstructionLogId(string ConstructionLogId)
{
Model.SGGLDB db = Funs.DB;
return (from x in db.ZHGL_ConstructionLogManagement where x.ConstructionLogId == ConstructionLogId select x).ToList();
}
}
}