using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public class MonthDesignService
{
public static Model.SGGLDB db = Funs.DB;
///
/// 获取月报设计变更情况列表
///
///
///
///
public static List getListData(string CheckMonthId)
{
return (from x in db.Check_MonthDesign
where x.CheckMonthId == CheckMonthId
select x).ToList();
}
///
/// 增加月报设计变更情况
///
/// 月报设计变更情况实体
public static void AddMonthDesign(Model.Check_MonthDesign monthSpotCheckDetail)
{
Model.SGGLDB db = Funs.DB;
Model.Check_MonthDesign newApprove = new Model.Check_MonthDesign();
newApprove.MonthDesignId = monthSpotCheckDetail.MonthDesignId;
newApprove.CheckMonthId = monthSpotCheckDetail.CheckMonthId;
newApprove.DesignCode = monthSpotCheckDetail.DesignCode;
newApprove.MainItemId = monthSpotCheckDetail.MainItemId;
newApprove.DesignProfessionalId = monthSpotCheckDetail.DesignProfessionalId;
newApprove.State = monthSpotCheckDetail.State;
newApprove.Remark = monthSpotCheckDetail.Remark;
db.Check_MonthDesign.InsertOnSubmit(newApprove);
db.SubmitChanges();
}
///
/// 根据月报id删除对应的所有月报设计变更情况
///
/// 月报设计变更情况编号
public static void DeleteMonthDesignsByCheckMonthId(string CheckMonthId)
{
Model.SGGLDB db = Funs.DB;
var q = (from x in db.Check_MonthDesign where x.CheckMonthId == CheckMonthId select x).ToList();
if (q.Count() > 0)
{
db.Check_MonthDesign.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
///
/// 根据月报id获取对应的所有月报设计变更情况
///
/// 月报设计变更情况编号
public static List GetMonthDesignsByCheckMonthId(string CheckMonthId)
{
Model.SGGLDB db = Funs.DB;
return (from x in db.Check_MonthDesign where x.CheckMonthId == CheckMonthId select x).ToList();
}
}
}