SGGL_SHJ/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportSubC...

73 lines
3.6 KiB
C#

using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public class ConstructionMonthReportSubCostService
{
/// <summary>
/// 获取施工月报分包工程施工付款情况模板列表
/// </summary>
/// <param name="satartRowIndex"></param>
/// <param name="maximumRows"></param>
/// <returns></returns>
public static List<Model.ZHGL_ConstructionMonthReportSubCost> getListData(string ConstructionMonthReportId)
{
return (from x in Funs.DB.ZHGL_ConstructionMonthReportSubCost
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ConstructionMonthReportId == ConstructionMonthReportId
orderby y.UnitCode
select x).ToList();
}
/// <summary>
/// 增加施工月报分包工程施工付款情况
/// </summary>
/// <param name="managerRuleApprove">施工月报分包工程施工付款情况实体</param>
public static void AddConstructionMonthReportSubCost(Model.ZHGL_ConstructionMonthReportSubCost ConstructionMonthReportSubCost)
{
Model.SGGLDB db = Funs.DB;
Model.ZHGL_ConstructionMonthReportSubCost newApprove = new Model.ZHGL_ConstructionMonthReportSubCost();
newApprove.ConstructionMonthReportSubCostId = ConstructionMonthReportSubCost.ConstructionMonthReportSubCostId;
newApprove.ConstructionMonthReportId = ConstructionMonthReportSubCost.ConstructionMonthReportId;
newApprove.UnitId = ConstructionMonthReportSubCost.UnitId;
newApprove.ContractAmount = ConstructionMonthReportSubCost.ContractAmount;
newApprove.ThisNeedPay = ConstructionMonthReportSubCost.ThisNeedPay;
newApprove.ThisRealPay = ConstructionMonthReportSubCost.ThisRealPay;
newApprove.TotalNeedPay = ConstructionMonthReportSubCost.TotalNeedPay;
newApprove.TotalRealPay = ConstructionMonthReportSubCost.TotalRealPay;
newApprove.TotalRealPayRate = ConstructionMonthReportSubCost.TotalRealPayRate;
db.ZHGL_ConstructionMonthReportSubCost.InsertOnSubmit(newApprove);
db.SubmitChanges();
}
/// <summary>
/// 根据月报id删除对应的所有施工月报分包工程施工付款情况
/// </summary>
/// <param name="ConstructionMonthReportId">施工月报分包工程施工付款情况编号</param>
public static void DeleteConstructionMonthReportSubCostsByConstructionMonthReportId(string ConstructionMonthReportId)
{
Model.SGGLDB db = Funs.DB;
var q = (from x in db.ZHGL_ConstructionMonthReportSubCost where x.ConstructionMonthReportId == ConstructionMonthReportId select x).ToList();
if (q.Count() > 0)
{
db.ZHGL_ConstructionMonthReportSubCost.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
/// <summary>
/// 根据月报id获取对应的所有施工月报分包工程施工付款情况
/// </summary>
/// <param name="ConstructionMonthReportId">施工月报分包工程施工付款情况编号</param>
public static List<Model.ZHGL_ConstructionMonthReportSubCost> GetConstructionMonthReportSubCostsByConstructionMonthReportId(string ConstructionMonthReportId)
{
Model.SGGLDB db = Funs.DB;
return (from x in db.ZHGL_ConstructionMonthReportSubCost where x.ConstructionMonthReportId == ConstructionMonthReportId select x).ToList();
}
}
}