using System.Collections.Generic; using System.Linq; namespace BLL { public class ConstructionMonthReportMainCostService { public static Model.SGGLDB db = Funs.DB; /// /// 获取施工月报总包工程施工请款情况模板列表 /// /// /// /// public static List getListData(string ConstructionMonthReportId) { return (from x in Funs.DB.ZHGL_ConstructionMonthReportMainCost where x.ConstructionMonthReportId == ConstructionMonthReportId select x).ToList(); } /// /// 增加施工月报总包工程施工请款情况 /// /// 施工月报总包工程施工请款情况实体 public static void AddConstructionMonthReportMainCost(Model.ZHGL_ConstructionMonthReportMainCost ConstructionMonthReportMainCost) { Model.SGGLDB db = Funs.DB; Model.ZHGL_ConstructionMonthReportMainCost newApprove = new Model.ZHGL_ConstructionMonthReportMainCost(); newApprove.ConstructionMonthReportMainCostId = ConstructionMonthReportMainCost.ConstructionMonthReportMainCostId; newApprove.ConstructionMonthReportId = ConstructionMonthReportMainCost.ConstructionMonthReportId; newApprove.ContractConstructionCost = ConstructionMonthReportMainCost.ContractConstructionCost; newApprove.ThisRequestCost = ConstructionMonthReportMainCost.ThisRequestCost; newApprove.TotalRequestCost = ConstructionMonthReportMainCost.TotalRequestCost; newApprove.ThisCollection = ConstructionMonthReportMainCost.ThisCollection; newApprove.TotalCollection = ConstructionMonthReportMainCost.TotalCollection; newApprove.TotalCollectionRate = ConstructionMonthReportMainCost.TotalCollectionRate; db.ZHGL_ConstructionMonthReportMainCost.InsertOnSubmit(newApprove); db.SubmitChanges(); } /// /// 根据月报id删除对应的所有施工月报总包工程施工请款情况 /// /// 施工月报总包工程施工请款情况编号 public static void DeleteConstructionMonthReportMainCostsByConstructionMonthReportId(string ConstructionMonthReportId) { Model.SGGLDB db = Funs.DB; var q = (from x in db.ZHGL_ConstructionMonthReportMainCost where x.ConstructionMonthReportId == ConstructionMonthReportId select x).ToList(); if (q.Count() > 0) { db.ZHGL_ConstructionMonthReportMainCost.DeleteAllOnSubmit(q); db.SubmitChanges(); } } /// /// 根据月报id获取对应的所有施工月报总包工程施工请款情况 /// /// 施工月报总包工程施工请款情况编号 public static List GetConstructionMonthReportMainCostsByConstructionMonthReportId(string ConstructionMonthReportId) { Model.SGGLDB db = Funs.DB; return (from x in db.ZHGL_ConstructionMonthReportMainCost where x.ConstructionMonthReportId == ConstructionMonthReportId select x).ToList(); } } }