1
This commit is contained in:
@@ -8,7 +8,6 @@ namespace BLL
|
||||
{
|
||||
public class AccidentCaseItemService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据常见事故案例明细Id获取事故案例明细
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace BLL
|
||||
{
|
||||
public class AccidentCaseService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取事故伤害及预防
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public class CompanyTrainingItemService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取公司培训明细信息
|
||||
@@ -17,6 +16,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static Model.Training_CompanyTrainingItem GetCompanyTrainingItemById(string companyTrainingItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItemId);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace BLL
|
||||
/// <param name="model"></param>
|
||||
public static void AddCompanyTrainingItem(Model.Training_CompanyTrainingItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_CompanyTrainingItem newModel = new Model.Training_CompanyTrainingItem();
|
||||
newModel.CompanyTrainingItemId = model.CompanyTrainingItemId;
|
||||
newModel.CompanyTrainingId = model.CompanyTrainingId;
|
||||
@@ -49,6 +50,7 @@ namespace BLL
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateCompanyTrainingItem(Model.Training_CompanyTrainingItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_CompanyTrainingItem newModel = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == model.CompanyTrainingItemId);
|
||||
if (newModel != null)
|
||||
{
|
||||
@@ -72,6 +74,7 @@ namespace BLL
|
||||
/// <param name="companyTrainItemId"></param>
|
||||
public static void DeleteCompanyTrainingItemById(string companyTrainItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_CompanyTrainingItem model = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainItemId);
|
||||
if (model != null)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class EduTrain_TrainRecordDetailService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据教育培训主键获取所有的教育培训明细信息
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class EduTrain_TrainRecordService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据教育培训主键获取教育培训信息
|
||||
/// </summary>
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class EduTrain_TrainTestService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据教育培训主键获取所有的教育培训明细信息
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TestPlanService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取培训计划
|
||||
@@ -26,6 +26,7 @@ namespace BLL
|
||||
/// <param name="testPlan"></param>
|
||||
public static void AddTestPlan(Model.Training_TestPlan testPlan)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_TestPlan newTestPlan = new Model.Training_TestPlan
|
||||
{
|
||||
TestPlanId = testPlan.TestPlanId,
|
||||
@@ -63,6 +64,7 @@ namespace BLL
|
||||
/// <param name="TestPlan"></param>
|
||||
public static void UpdateTestPlan(Model.Training_TestPlan TestPlan)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_TestPlan newTestPlan = db.Training_TestPlan.FirstOrDefault(e => e.TestPlanId == TestPlan.TestPlanId);
|
||||
if (newTestPlan != null)
|
||||
{
|
||||
@@ -93,7 +95,6 @@ namespace BLL
|
||||
/// <param name="TestPlanId"></param>
|
||||
public static void DeleteTestPlanById(string TestPlanId)
|
||||
{
|
||||
|
||||
var getTestPlan = GetTestPlanById(TestPlanId);
|
||||
if (getTestPlan != null)
|
||||
{
|
||||
@@ -138,6 +139,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_TestPlan> GetTestPlanList()
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return (from x in db.Training_TestPlan orderby x.PlanCode select x).ToList();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TestRecordItemService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据考试记录Id获取明细信息
|
||||
@@ -28,6 +28,7 @@ namespace BLL
|
||||
/// <param name="planId"></param>
|
||||
public static void DeleteTestRecordItemmByTestRecordItemId(string testRecordItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var testRecordItem = db.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordItemId == testRecordItemId);
|
||||
if (testRecordItem != null)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TestRecordService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取考试记录
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
{
|
||||
public static class TestTrainingItemService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace BLL
|
||||
{
|
||||
public static class TestTrainingService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
@@ -84,6 +83,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_TestTraining> GetTestTrainingList()
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return (from x in db.Training_TestTraining orderby x.TrainingCode select x).ToList();
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_TestTraining> GetEndTestTrainingList()
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return (from x in db.Training_TestTraining
|
||||
where x.IsEndLever == true
|
||||
orderby x.TrainingCode
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TrainTestDBItemService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全试题库明细信息
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TrainTestDBService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取安全试题库信息
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TrainTestRecordService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取考试记录
|
||||
|
||||
@@ -8,8 +8,6 @@ namespace BLL
|
||||
{
|
||||
public class TrainingItemService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TrainingPlanItemService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据培训计划明细表Id获取所有相关明细信息
|
||||
@@ -19,6 +19,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_PlanItem> GetPlanItemByPlanId(string planId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return (from x in db.Training_PlanItem where x.PlanId == planId select x).ToList();
|
||||
}
|
||||
|
||||
@@ -28,6 +29,7 @@ namespace BLL
|
||||
/// <param name="planItem"></param>
|
||||
public static void AddPlanItem(Model.Training_PlanItem planItem)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_PlanItem newPlanItem = new Model.Training_PlanItem
|
||||
{
|
||||
PlanItemId = planItem.PlanItemId,
|
||||
@@ -47,6 +49,7 @@ namespace BLL
|
||||
/// <param name="model"></param>
|
||||
public static void UpdatePlanItem(Model.Training_PlanItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_PlanItem newItem = db.Training_PlanItem.FirstOrDefault(e => e.PlanItemId == model.PlanItemId);
|
||||
if (newItem != null)
|
||||
{
|
||||
@@ -65,6 +68,7 @@ namespace BLL
|
||||
/// <param name="planItemId"></param>
|
||||
public static void DeletePlanItemById(string planItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var planItem = db.Training_PlanItem.FirstOrDefault(e => e.PlanItemId == planItemId);
|
||||
if (planItem != null)
|
||||
{
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace BLL
|
||||
{
|
||||
public class TrainingService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据上级Id查询所有教育培训主键列的值
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TrainingTaskService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取培训任务
|
||||
@@ -20,6 +20,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static Model.Training_Task GetTaskById(string taskId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.Training_Task.FirstOrDefault(e => e.TaskId == taskId);
|
||||
}
|
||||
|
||||
@@ -39,6 +40,7 @@ namespace BLL
|
||||
/// <param name="task"></param>
|
||||
public static void AddTask(Model.Training_Task task)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_Task newTask = new Model.Training_Task
|
||||
{
|
||||
TaskId = task.TaskId,
|
||||
@@ -75,6 +77,7 @@ namespace BLL
|
||||
/// <param name="taskId"></param>
|
||||
public static void DeleteTaskById(string taskId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Training_Task task = db.Training_Task.FirstOrDefault(e => e.TaskId == taskId);
|
||||
if (task != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user