60 lines
2.0 KiB
C#
60 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 安全生产费用使用情况汇总表明细
|
|
/// </summary>
|
|
public class CostUseConditionItemService
|
|
{
|
|
/// <summary>
|
|
/// 根据主表id获取明细列表信息
|
|
/// </summary>
|
|
/// <param name="reportId"></param>
|
|
/// <returns></returns>
|
|
public static List<Model.Report_CostUseConditionItem> GetReportItemByReportId(string reportId)
|
|
{
|
|
return (from x in Funs.DB.Report_CostUseConditionItem where x.ReportId == reportId orderby x.SortId select x).ToList();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加明细信息
|
|
/// </summary>
|
|
/// <param name="item"></param>
|
|
public static void AddCostUseConditionItem(Model.Report_CostUseConditionItem item)
|
|
{
|
|
Model.Report_CostUseConditionItem newItem = new Model.Report_CostUseConditionItem
|
|
{
|
|
ReportItemId = item.ReportItemId,
|
|
ReportId = item.ReportId,
|
|
SortId = item.SortId,
|
|
SortName = item.SortName,
|
|
Contents = item.Contents,
|
|
CurrentMonth = item.CurrentMonth,
|
|
CumulativeNum = item.CumulativeNum,
|
|
Remark = item.Remark
|
|
};
|
|
Funs.DB.Report_CostUseConditionItem.InsertOnSubmit(newItem);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除明细信息
|
|
/// </summary>
|
|
/// <param name="reportId"></param>
|
|
public static void DeleteCostUseConditionItemByReportId(string reportId)
|
|
{
|
|
var q = (from x in Funs.DB.Report_CostUseConditionItem where x.ReportId == reportId select x).ToList();
|
|
if (q != null)
|
|
{
|
|
Funs.DB.Report_CostUseConditionItem.DeleteAllOnSubmit(q);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|