1
This commit is contained in:
@@ -11,7 +11,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TrainingPlanService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取培训计划
|
||||
@@ -20,6 +20,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static Model.Training_Plan GetPlanById(string planId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
|
||||
}
|
||||
|
||||
@@ -30,6 +31,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static Model.Training_Plan GetPlanByCheckId(string checkId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.Training_Plan.FirstOrDefault(e => e.CheckId == checkId && e.IsRetakeCourse == 1);
|
||||
}
|
||||
|
||||
@@ -42,6 +44,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_Plan> GetThisYearPlanByCompanyTrainingItemId(string projectId, string itemId, int year)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var list = db.Training_Plan.Where(e => e.CompanyTrainingItemId == itemId && e.IsRetakeCourse != 1 && ((DateTime)e.DesignerDate).Year == year).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(projectId))
|
||||
{
|
||||
@@ -57,6 +60,7 @@ namespace BLL
|
||||
/// <param name="model"></param>
|
||||
public static void AddPlan(Model.Training_Plan model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_Plan newModel = new Model.Training_Plan
|
||||
{
|
||||
PlanId = model.PlanId,
|
||||
@@ -92,6 +96,7 @@ namespace BLL
|
||||
/// <param name="model"></param>
|
||||
public static void UpdatePlan(Model.Training_Plan model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_Plan isUpdate = Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == model.PlanId);
|
||||
if (isUpdate != null)
|
||||
{
|
||||
@@ -138,6 +143,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_Plan> GetPlanList()
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return (from x in db.Training_Plan orderby x.PlanCode select x).ToList();
|
||||
}
|
||||
|
||||
@@ -149,6 +155,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_Plan> GetPlanListByWorkPostId(string projectId, string workPostId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var list = (from x in db.Training_Plan
|
||||
where x.ProjectId == projectId && (x.WorkPostId == null || x.WorkPostId.Contains(workPostId)) && x.CompanyTrainingItemId != null && x.IsRetakeCourse == null && Convert.ToDateTime(x.DesignerDate).Year == DateTime.Now.Year
|
||||
select x).ToList();
|
||||
@@ -161,6 +168,7 @@ namespace BLL
|
||||
/// <param name="info"></param>
|
||||
public static void RetakeCourseProducePlan(ProducePlanInfo info)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var plan = GetPlanByCheckId(info.CheckId);
|
||||
var person = PersonService.GetPersonById(info.PersonId);
|
||||
var companyTrainingItem = CompanyTrainingItemService.GetCompanyTrainingItemById(info.CompanyTrainingItemId);
|
||||
@@ -279,6 +287,7 @@ namespace BLL
|
||||
/// <param name="info"></param>
|
||||
public static void SelectCompanyTrainingItemProducePlan(ProducePlanInfo info)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var companyTrainingItem = CompanyTrainingItemService.GetCompanyTrainingItemById(info.CompanyTrainingItemId);
|
||||
var teachHour = companyTrainingItem.LearningTime / 3600;
|
||||
|
||||
@@ -407,6 +416,7 @@ namespace BLL
|
||||
/// <param name="info"></param>
|
||||
public static bool SelectPersonProducePlan(ProducePlanInfo info)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
//1、根据人员获取人员基本信息
|
||||
var person = PersonService.GetPersonById(info.PersonId);
|
||||
if (string.IsNullOrWhiteSpace(person.WorkPostId))
|
||||
|
||||
Reference in New Issue
Block a user