提交代码
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 月度计划情况
|
||||
/// </summary>
|
||||
public class MonthPlanService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取月度计划情况
|
||||
/// </summary>
|
||||
/// <param name="MonthPlanId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.JDGL_MonthPlan GetMonthPlanById(string MonthPlanId)
|
||||
{
|
||||
return Funs.DB.JDGL_MonthPlan.FirstOrDefault(e => e.MonthPlanId == MonthPlanId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加月度计划情况
|
||||
/// </summary>
|
||||
/// <param name="MonthPlan"></param>
|
||||
public static void AddMonthPlan(Model.JDGL_MonthPlan MonthPlan)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.JDGL_MonthPlan newMonthPlan = new Model.JDGL_MonthPlan
|
||||
{
|
||||
MonthPlanId = MonthPlan.MonthPlanId,
|
||||
ProjectId = MonthPlan.ProjectId,
|
||||
Months = MonthPlan.Months,
|
||||
UnitId = MonthPlan.UnitId,
|
||||
NodeContent = MonthPlan.NodeContent,
|
||||
PlanDate = MonthPlan.PlanDate,
|
||||
DutyPerson = MonthPlan.DutyPerson,
|
||||
RealDate = MonthPlan.RealDate,
|
||||
Remark = MonthPlan.Remark,
|
||||
CompileMan = MonthPlan.CompileMan,
|
||||
CompileDate = MonthPlan.CompileDate,
|
||||
};
|
||||
db.JDGL_MonthPlan.InsertOnSubmit(newMonthPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改月度计划情况
|
||||
/// </summary>
|
||||
/// <param name="MonthPlan"></param>
|
||||
public static void UpdateMonthPlan(Model.JDGL_MonthPlan MonthPlan)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.JDGL_MonthPlan newMonthPlan = db.JDGL_MonthPlan.FirstOrDefault(e => e.MonthPlanId == MonthPlan.MonthPlanId);
|
||||
if (newMonthPlan != null)
|
||||
{
|
||||
newMonthPlan.UnitId = MonthPlan.UnitId;
|
||||
newMonthPlan.NodeContent = MonthPlan.NodeContent;
|
||||
newMonthPlan.PlanDate = MonthPlan.PlanDate;
|
||||
newMonthPlan.DutyPerson = MonthPlan.DutyPerson;
|
||||
newMonthPlan.RealDate = MonthPlan.RealDate;
|
||||
newMonthPlan.Remark = MonthPlan.Remark;
|
||||
newMonthPlan.CompileMan = MonthPlan.CompileMan;
|
||||
newMonthPlan.CompileDate = MonthPlan.CompileDate;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除月度计划情况
|
||||
/// </summary>
|
||||
/// <param name="MonthPlanId"></param>
|
||||
public static void DeleteMonthPlanByMonthPlanId(string MonthPlanId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.JDGL_MonthPlan where x.MonthPlanId == MonthPlanId select x).FirstOrDefault();
|
||||
if (q != null)
|
||||
{
|
||||
db.JDGL_MonthPlan.DeleteOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user