2024-05-07 09:45:10 +08:00
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-15 09:35:42 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据主键获取月度计划情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="MonthPlanId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.JDGL_MonthPlan> GetMonthPlansByMonths(string projectId, DateTime months)
|
|
|
|
|
{
|
|
|
|
|
return (from x in Funs.DB.JDGL_MonthPlan where x.ProjectId == projectId && x.Months == months select x).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-07 09:45:10 +08:00
|
|
|
|
/// <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,
|
2024-06-27 15:35:38 +08:00
|
|
|
|
SortIndex = MonthPlan.SortIndex,
|
2024-05-07 09:45:10 +08:00
|
|
|
|
};
|
|
|
|
|
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;
|
2024-06-27 15:35:38 +08:00
|
|
|
|
|
2024-05-07 09:45:10 +08:00
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-15 09:35:42 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据主键删除月度计划情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="MonthPlanId"></param>
|
|
|
|
|
public static void DeleteAllMonthPlan(string projectId, DateTime months)
|
|
|
|
|
{
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
var q = from x in db.JDGL_MonthPlan where x.ProjectId == projectId && x.Months == months select x;
|
|
|
|
|
if (q != null)
|
|
|
|
|
{
|
|
|
|
|
db.JDGL_MonthPlan.DeleteAllOnSubmit(q);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-07 09:45:10 +08:00
|
|
|
|
}
|
|
|
|
|
}
|