自主管理加分项

This commit is contained in:
2025-03-04 18:12:07 +08:00
parent 6b48da4eff
commit 5d3273f119
92 changed files with 3646 additions and 4595 deletions
@@ -140,6 +140,8 @@ namespace BLL
IsHoldMeet = ProjectLeaderCheck.IsHoldMeet,
Requirement = ProjectLeaderCheck.Requirement,
LeaderNames = ProjectLeaderCheck.LeaderNames,
ResponsibleMan = ProjectLeaderCheck.ResponsibleMan,
CompanyTrainingItemId = ProjectLeaderCheck.CompanyTrainingItemId,
CompileMan = ProjectLeaderCheck.CompileMan,
CompileDate = ProjectLeaderCheck.CompileDate,
};
@@ -166,6 +168,8 @@ namespace BLL
newProjectLeaderCheck.IsHoldMeet = ProjectLeaderCheck.IsHoldMeet;
newProjectLeaderCheck.Requirement = ProjectLeaderCheck.Requirement;
newProjectLeaderCheck.LeaderNames = ProjectLeaderCheck.LeaderNames;
newProjectLeaderCheck.ResponsibleMan = ProjectLeaderCheck.ResponsibleMan;
newProjectLeaderCheck.CompanyTrainingItemId = ProjectLeaderCheck.CompanyTrainingItemId;
newProjectLeaderCheck.CompileMan = ProjectLeaderCheck.CompileMan;
newProjectLeaderCheck.CompileDate = ProjectLeaderCheck.CompileDate;
db.SubmitChanges();
@@ -1,9 +1,10 @@
using System.Linq;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 公司培训明细表
/// 公司培训明细表——教材库
/// </summary>
public class CompanyTrainingItemService
{
@@ -18,7 +19,7 @@ namespace BLL
{
return db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItemId);
}
/// <summary>
/// 添加公司培训明细
/// </summary>
@@ -35,6 +36,9 @@ namespace BLL
newModel.CompileDate = model.CompileDate;
newModel.WorkPostIds = model.WorkPostIds;
newModel.WorkPostNames = model.WorkPostNames;
newModel.Outcome = model.Outcome;
newModel.LearningTime = model.LearningTime;
newModel.TestTrainingIds = model.TestTrainingIds;
db.Training_CompanyTrainingItem.InsertOnSubmit(newModel);
db.SubmitChanges();
}
@@ -55,6 +59,9 @@ namespace BLL
newModel.CompileDate = model.CompileDate;
newModel.WorkPostIds = model.WorkPostIds;
newModel.WorkPostNames = model.WorkPostNames;
newModel.Outcome = model.Outcome;
newModel.LearningTime = model.LearningTime;
newModel.TestTrainingIds = model.TestTrainingIds;
db.SubmitChanges();
}
}
@@ -72,5 +79,40 @@ namespace BLL
db.SubmitChanges();
}
}
/// <summary>
/// 教材库下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="workPostId">职务Id</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitCompanyTrainingItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease)
{
dropName.DataValueField = "CompanyTrainingItemId";
dropName.DataTextField = "CompanyTrainingItemName";
dropName.DataSource = GetCompanyTrainingItemList(workPostId);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 获取教材库下拉项
/// </summary>
/// <param name="workPostId"></param>
/// <returns></returns>
public static List<Model.Training_CompanyTrainingItem> GetCompanyTrainingItemList(string workPostId)
{
var lst = (from x in Funs.DB.Training_CompanyTrainingItem orderby x.CompanyTrainingItemCode select x).ToList();
if (!string.IsNullOrWhiteSpace(workPostId))
{
lst = lst.Where(x => x.WorkPostIds == null || x.WorkPostIds.Contains(workPostId)).ToList();
}
return lst;
}
}
}
@@ -32,12 +32,33 @@ namespace BLL
{
PlanItemId = planItem.PlanItemId,
PlanId = planItem.PlanId,
TrainingEduId = planItem.TrainingEduId
TrainingEduId = planItem.TrainingEduId,
TrainingEduItemId = planItem.TrainingEduItemId,
CompanyTrainingId = planItem.CompanyTrainingId,
CompanyTrainingItemId = planItem.CompanyTrainingItemId
};
db.Training_PlanItem.InsertOnSubmit(newPlanItem);
db.SubmitChanges();
}
/// <summary>
/// 修改培训任务
/// </summary>
/// <param name="model"></param>
public static void UpdatePlanItem(Model.Training_PlanItem model)
{
Model.Training_PlanItem newItem = db.Training_PlanItem.FirstOrDefault(e => e.PlanItemId == model.PlanItemId);
if (newItem != null)
{
newItem.PlanId = model.PlanId;
newItem.TrainingEduId = model.TrainingEduId;
newItem.TrainingEduItemId = model.TrainingEduItemId;
newItem.CompanyTrainingId = model.CompanyTrainingId;
newItem.CompanyTrainingItemId = model.CompanyTrainingItemId;
db.SubmitChanges();
}
}
/// <summary>
/// 根据明细键删除培训计划明细
/// </summary>
+181 -45
View File
@@ -1,4 +1,7 @@
using System;
using Microsoft.Office.Interop.Excel;
using Microsoft.SqlServer.Dts.Runtime;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -19,65 +22,81 @@ namespace BLL
/// <returns></returns>
public static Model.Training_Plan GetPlanById(string planId)
{
return Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
return db.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
}
/// <summary>
/// 根据检查Id获取培训计划
/// </summary>
/// <param name="checkId"></param>
/// <returns></returns>
public static Model.Training_Plan GetPlanByCheckId(string checkId)
{
return db.Training_Plan.FirstOrDefault(e => e.CheckId == checkId && e.IsRetakeCourse == 1);
}
/// <summary>
/// 添加培训计划
/// </summary>
/// <param name="plan"></param>
public static void AddPlan(Model.Training_Plan trainingPlan)
/// <param name="model"></param>
public static void AddPlan(Model.Training_Plan model)
{
Model.Training_Plan newPlan = new Model.Training_Plan
Model.Training_Plan newModel = new Model.Training_Plan
{
PlanId = trainingPlan.PlanId,
PlanCode = trainingPlan.PlanCode,
ProjectId = trainingPlan.ProjectId,
DesignerId = trainingPlan.DesignerId,
PlanName = trainingPlan.PlanName,
TrainContent = trainingPlan.TrainContent,
TrainStartDate = trainingPlan.TrainStartDate,
TeachHour = trainingPlan.TeachHour,
TeachMan = trainingPlan.TeachMan,
TeachAddress = trainingPlan.TeachAddress,
TrainTypeId = trainingPlan.TrainTypeId,
TrainLevelId = trainingPlan.TrainLevelId,
DesignerDate =trainingPlan.DesignerDate,
UnitIds = trainingPlan.UnitIds,
WorkPostId = trainingPlan.WorkPostId,
States = trainingPlan.States,
Cycle=trainingPlan.Cycle
PlanId = model.PlanId,
PlanCode = model.PlanCode,
ProjectId = model.ProjectId,
DesignerId = model.DesignerId,
PlanName = model.PlanName,
TrainContent = model.TrainContent,
TrainStartDate = model.TrainStartDate,
TeachHour = model.TeachHour,
TeachMan = model.TeachMan,
TeachAddress = model.TeachAddress,
TrainTypeId = model.TrainTypeId,
TrainLevelId = model.TrainLevelId,
DesignerDate = model.DesignerDate,
UnitIds = model.UnitIds,
WorkPostId = model.WorkPostId,
States = model.States,
Cycle = model.Cycle,
IsRetakeCourse = model.IsRetakeCourse,
CheckType = model.CheckType,
CheckId = model.CheckId
};
db.Training_Plan.InsertOnSubmit(newPlan);
db.Training_Plan.InsertOnSubmit(newModel);
db.SubmitChanges();
}
/// <summary>
/// 修改培训计划
/// </summary>
/// <param name="plan"></param>
public static void UpdatePlan(Model.Training_Plan newTrainingPlan)
/// <param name="model"></param>
public static void UpdatePlan(Model.Training_Plan model)
{
Model.Training_Plan isUpdate = Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == newTrainingPlan.PlanId);
Model.Training_Plan isUpdate = Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == model.PlanId);
if (isUpdate != null)
{
isUpdate.PlanName = newTrainingPlan.PlanName;
isUpdate.TrainContent = newTrainingPlan.TrainContent;
isUpdate.TrainStartDate = newTrainingPlan.TrainStartDate;
isUpdate.TeachHour = newTrainingPlan.TeachHour;
isUpdate.TrainEndDate = newTrainingPlan.TrainEndDate;
isUpdate.TeachMan = newTrainingPlan.TeachMan;
isUpdate.TeachAddress = newTrainingPlan.TeachAddress;
isUpdate.TrainTypeId = newTrainingPlan.TrainTypeId;
isUpdate.TrainLevelId = newTrainingPlan.TrainLevelId;
isUpdate.DesignerDate = newTrainingPlan.DesignerDate;
isUpdate.UnitIds = newTrainingPlan.UnitIds;
isUpdate.WorkPostId = newTrainingPlan.WorkPostId;
isUpdate.States = newTrainingPlan.States;
isUpdate.Cycle = newTrainingPlan.Cycle;
Funs.DB.SubmitChanges();
isUpdate.PlanName = model.PlanName;
isUpdate.TrainContent = model.TrainContent;
isUpdate.TrainStartDate = model.TrainStartDate;
isUpdate.TeachHour = model.TeachHour;
isUpdate.TrainEndDate = model.TrainEndDate;
isUpdate.TeachMan = model.TeachMan;
isUpdate.TeachAddress = model.TeachAddress;
isUpdate.TrainTypeId = model.TrainTypeId;
isUpdate.TrainLevelId = model.TrainLevelId;
isUpdate.DesignerDate = model.DesignerDate;
isUpdate.UnitIds = model.UnitIds;
isUpdate.WorkPostId = model.WorkPostId;
isUpdate.States = model.States;
isUpdate.Cycle = model.Cycle;
isUpdate.IsRetakeCourse = model.IsRetakeCourse;
isUpdate.CheckType = model.CheckType;
isUpdate.CheckId = model.CheckId;
db.SubmitChanges();
}
}
@@ -87,11 +106,11 @@ namespace BLL
/// <param name="planId"></param>
public static void DeletePlanById(string planId)
{
Model.Training_Plan plan = Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
Model.Training_Plan plan = db.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
if (plan != null)
{
Funs.DB.Training_Plan.DeleteOnSubmit(plan);
Funs.DB.SubmitChanges();
db.Training_Plan.DeleteOnSubmit(plan);
db.SubmitChanges();
}
}
@@ -103,5 +122,122 @@ namespace BLL
{
return (from x in db.Training_Plan orderby x.PlanCode select x).ToList();
}
/// <summary>
/// 检查重修,并生成培训计划、任务
/// </summary>
/// <param name="info"></param>
public static void RetakeCourseProducePlan(RetakeCourseProducePlanInfo info)
{
var plan = GetPlanByCheckId(info.CheckId);
var person = PersonService.GetPersonById(info.PersonId);
var companyTrainingItem = CompanyTrainingItemService.GetCompanyTrainingItemById(info.CompanyTrainingItemId);
var teachHour = companyTrainingItem.LearningTime / 3600;
string planId = string.Empty;
if (plan != null)
{//编辑培训计划
planId = plan.PlanId;
Model.Training_Plan planModel = new Model.Training_Plan
{
ProjectId = info.CurrProjectId,
PlanName = info.CheckTypeName,
TrainContent = info.CheckTypeName,
TeachHour = teachHour,
UnitIds = person.UnitId,
WorkPostId = person.WorkPostId,
TrainStartDate = plan.TrainStartDate,
TrainEndDate = info.TrainEndDate,
TeachMan = plan.TeachMan,
TeachAddress = plan.TeachAddress,
TrainTypeId = Const.RetakeCourseTrainTypeId,
TrainLevelId = Const.OtherTrainLevelId,
States = "1",
Cycle = "",
IsRetakeCourse = 1,
CheckType = plan.CheckType,
CheckId = plan.CheckId
};
UpdatePlan(planModel);
}
else
{//生成培训计划
planId = SQLHelper.GetNewID();
string code = ProjectService.GetProjectByProjectId(info.CurrProjectId).ProjectCode + "-";
string planCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", info.CurrProjectId, code);
Model.Training_Plan planModel = new Model.Training_Plan
{
PlanId = planId,
PlanCode = planCode,
ProjectId = info.CurrProjectId,
DesignerId = info.CurrUserId,
DesignerDate = DateTime.Now,
PlanName = info.CheckTypeName,
TrainContent = info.CheckTypeName,
TrainStartDate = DateTime.Now,
TrainEndDate = info.TrainEndDate,
TeachHour = teachHour,
//TeachMan = model.TeachMan,
//TeachAddress = model.TeachAddress,
TrainTypeId = Const.RetakeCourseTrainTypeId,
TrainLevelId = Const.OtherTrainLevelId,
UnitIds = person.UnitId,
WorkPostId = person.WorkPostId,
States = "1",
Cycle = "",
IsRetakeCourse = 1,
CheckType = info.CheckType.ToString(),
CheckId = info.CheckId
};
AddPlan(planModel);
}
//删除培训明细
TrainingPlanItemService.DeletePlanItemByPlanId(planId);
//删除任务
TrainingTaskService.DeleteTaskByPlanId(planId);
string taskId = SQLHelper.GetNewID();
//新增培训任务
Model.Training_Task newTrainDetail = new Model.Training_Task
{
TaskId = taskId,
ProjectId = info.CurrProjectId,
PlanId = planId,
UserId = info.PersonId,
TaskDate = DateTime.Now,
States = Const.State_1,
};
TrainingTaskService.AddTask(newTrainDetail);
//新增培训任务明细
Model.Training_TaskItem newTaskItem = new Model.Training_TaskItem
{
TaskItemId = SQLHelper.GetNewID(),
TaskId = taskId,
PlanId = planId,
PersonId = info.PersonId,
TrainingItemCode = companyTrainingItem.CompanyTrainingItemCode,
TrainingItemName = companyTrainingItem.CompanyTrainingItemName,
AttachUrl = companyTrainingItem.AttachUrl,
CompanyTrainingItemId = info.CompanyTrainingItemId,
//LearnTime = trainingItem.LearningTime,
//VideoProgress = 0,
};
db.Training_TaskItem.InsertOnSubmit(newTaskItem);
db.SubmitChanges();
//新增培训明细
Model.Training_PlanItem newPlanItem = new Model.Training_PlanItem
{
PlanItemId = SQLHelper.GetNewID(),
PlanId = planId,
CompanyTrainingItemId = info.CompanyTrainingItemId,
CompanyTrainingId = companyTrainingItem.CompanyTrainingId
};
TrainingPlanItemService.AddPlanItem(newPlanItem);
}
}
}
@@ -1,4 +1,5 @@
using System;
using Microsoft.SqlServer.Dts.Runtime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -41,6 +42,7 @@ namespace BLL
Model.Training_Task newTask = new Model.Training_Task
{
TaskId = task.TaskId,
ProjectId = task.ProjectId,
PlanId = task.PlanId,
UserId = task.UserId,
TaskDate = task.TaskDate,
@@ -1,77 +0,0 @@
using System.Linq;
namespace BLL
{
/// <summary>
/// 行为安全观察与沟通
/// </summary>
public static class BehavioralSafetyObservationService
{
/// <summary>
/// 根据主键获取行为安全观察与沟通信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Examine_BehavioralSafetyObservation GetBehavioralSafetyObservationById(string Id)
{
return Funs.DB.Examine_BehavioralSafetyObservation.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 添加行为安全观察与沟通
/// </summary>
/// <param name="model"></param>
public static void AddBehavioralSafetyObservation(Model.Examine_BehavioralSafetyObservation model)
{
Model.Examine_BehavioralSafetyObservation newModel = new Model.Examine_BehavioralSafetyObservation
{
Id = model.Id,
ProjectId = model.ProjectId,
Code = model.Code,
Name = model.Name,
UserId = model.UserId,
DateTime = model.DateTime,
CompileDate = model.CompileDate,
CompileMan = model.CompileMan,
Remark = model.Remark,
Content = model.Content
};
Funs.DB.Examine_BehavioralSafetyObservation.InsertOnSubmit(newModel);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
public static void UpdateBehavioralSafetyObservation(Model.Examine_BehavioralSafetyObservation model)
{
Model.Examine_BehavioralSafetyObservation newModel = Funs.DB.Examine_BehavioralSafetyObservation.FirstOrDefault(e => e.Id == model.Id);
if (newModel != null)
{
newModel.Code = model.Code;
newModel.Name = model.Name;
newModel.UserId = model.UserId;
newModel.DateTime = model.DateTime;
newModel.Content = model.Content;
newModel.Remark = model.Remark;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="Id"></param>
public static void DeleteBehavioralSafetyObservationById(string Id)
{
Model.Examine_BehavioralSafetyObservation model = Funs.DB.Examine_BehavioralSafetyObservation.FirstOrDefault(e => e.Id == Id);
if (model != null)
{
CommonService.DeleteAttachFileById(Id);
Funs.DB.Examine_BehavioralSafetyObservation.DeleteOnSubmit(model);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,108 @@
using Model;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 自主管理加分项
/// </summary>
public static class BonusScoreSelfManagementService
{
/// <summary>
/// 根据主键获取自主管理加分项信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Examine_BonusScoreSelfManagement GetBonusScoreSelfManagementById(string Id)
{
return Funs.DB.Examine_BonusScoreSelfManagement.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 添加自主管理加分项
/// </summary>
/// <param name="model"></param>
public static void AddBonusScoreSelfManagement(Model.Examine_BonusScoreSelfManagement model)
{
Model.Examine_BonusScoreSelfManagement newModel = new Model.Examine_BonusScoreSelfManagement
{
Id = model.Id,
ProjectId = model.ProjectId,
Code = model.Code,
Name = model.Name,
BonusScoreTypeId = model.BonusScoreTypeId,
BonusScoreTypeName = model.BonusScoreTypeName,
Score = model.Score,
PersonId = model.PersonId,
//DateTime = model.DateTime,
CompileDate = model.CompileDate,
CompileMan = model.CompileMan,
Remark = model.Remark,
Content = model.Content
};
Funs.DB.Examine_BonusScoreSelfManagement.InsertOnSubmit(newModel);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
public static void UpdateBonusScoreSelfManagement(Model.Examine_BonusScoreSelfManagement model)
{
Model.Examine_BonusScoreSelfManagement newModel = Funs.DB.Examine_BonusScoreSelfManagement.FirstOrDefault(e => e.Id == model.Id);
if (newModel != null)
{
//newModel.Code = model.Code;
newModel.Name = model.Name;
newModel.BonusScoreTypeId = model.BonusScoreTypeId;
newModel.BonusScoreTypeName = model.BonusScoreTypeName;
newModel.Score = model.Score;
newModel.PersonId = model.PersonId;
//newModel.DateTime = model.DateTime;
newModel.Content = model.Content;
newModel.Remark = model.Remark;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="Id"></param>
public static void DeleteBonusScoreSelfManagementById(string Id)
{
Model.Examine_BonusScoreSelfManagement model = Funs.DB.Examine_BonusScoreSelfManagement.FirstOrDefault(e => e.Id == Id);
if (model != null)
{
CommonService.DeleteAttachFileById(Id);
Funs.DB.Examine_BonusScoreSelfManagement.DeleteOnSubmit(model);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 获取所有List
/// </summary>
/// <returns></returns>
public static List<Examine_BonusScoreSelfManagement> GetBonusScoreSelfManagementList(string projectId, string personId, string typeId)
{
var list = (from x in Funs.DB.Examine_BonusScoreSelfManagement orderby x.Code descending select x).ToList();
if (!string.IsNullOrWhiteSpace(projectId))
{
list = list.Where(x => x.ProjectId == projectId).ToList();
}
if (!string.IsNullOrWhiteSpace(personId))
{
list = list.Where(x => x.PersonId == personId).ToList();
}
if (!string.IsNullOrWhiteSpace(typeId))
{
list = list.Where(x => x.BonusScoreTypeId == typeId).ToList();
}
return list;
}
}
}
@@ -0,0 +1,115 @@
using Model;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 自主管理加分项类型
/// </summary>
public static class BonusScoreTypeService
{
/// <summary>
/// 根据主键获取自主管理加分项类型信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Examine_BonusScoreType GetBonusScoreTypeById(string Id)
{
return Funs.DB.Examine_BonusScoreType.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 根据名称获取自主管理加分项类型信息
/// </summary>
/// <param name="Name"></param>
/// <returns></returns>
public static Model.Examine_BonusScoreType GetBonusScoreTypeByName(string Name)
{
return Funs.DB.Examine_BonusScoreType.FirstOrDefault(e => e.Name == Name);
}
/// <summary>
/// 添加自主管理加分项类型
/// </summary>
/// <param name="model"></param>
public static void AddBonusScoreType(Model.Examine_BonusScoreType model)
{
Model.Examine_BonusScoreType newModel = new Model.Examine_BonusScoreType
{
Id = model.Id,
Code = model.Code,
Name = model.Name,
Score = model.Score,
CompileDate = model.CompileDate,
CompileMan = model.CompileMan,
Remark = model.Remark
};
Funs.DB.Examine_BonusScoreType.InsertOnSubmit(newModel);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
public static void UpdateBonusScoreType(Model.Examine_BonusScoreType model)
{
Model.Examine_BonusScoreType newModel = Funs.DB.Examine_BonusScoreType.FirstOrDefault(e => e.Id == model.Id);
if (newModel != null)
{
newModel.Code = model.Code;
newModel.Name = model.Name;
newModel.Score = model.Score;
newModel.Remark = model.Remark;
newModel.CompileDate = model.CompileDate;
newModel.CompileMan = model.CompileMan;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="Id"></param>
public static void DeleteBonusScoreTypeById(string Id)
{
Model.Examine_BonusScoreType model = Funs.DB.Examine_BonusScoreType.FirstOrDefault(e => e.Id == Id);
if (model != null)
{
CommonService.DeleteAttachFileById(Id);
Funs.DB.Examine_BonusScoreType.DeleteOnSubmit(model);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 获取所有类型List
/// </summary>
/// <returns></returns>
public static List<Examine_BonusScoreType> GetBonusScoreTypeList()
{
return (from x in Funs.DB.Examine_BonusScoreType orderby x.Code select x).ToList();
}
/// <summary>
/// 获取类型下拉框
/// </summary>
/// <param name="dropName"></param>
/// <param name="isShowPlease"></param>
public static void InitBonusScoreTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
{
dropName.DataValueField = "Id";
dropName.DataTextField = "Name";
dropName.DataSource = GetBonusScoreTypeList();
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
}
}
@@ -1,77 +0,0 @@
using System.Linq;
namespace BLL
{
/// <summary>
/// 一线党员联系班组共建活动
/// </summary>
public static class CoConstructionActivitiesService
{
/// <summary>
/// 根据主键获取一线党员联系班组共建活动信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Examine_CoConstructionActivities GetCoConstructionActivitiesById(string Id)
{
return Funs.DB.Examine_CoConstructionActivities.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 添加一线党员联系班组共建活动
/// </summary>
/// <param name="model"></param>
public static void AddCoConstructionActivities(Model.Examine_CoConstructionActivities model)
{
Model.Examine_CoConstructionActivities newModel = new Model.Examine_CoConstructionActivities
{
Id = model.Id,
ProjectId = model.ProjectId,
Code = model.Code,
Name = model.Name,
UserId = model.UserId,
DateTime = model.DateTime,
CompileDate = model.CompileDate,
CompileMan = model.CompileMan,
Remark = model.Remark,
Content = model.Content
};
Funs.DB.Examine_CoConstructionActivities.InsertOnSubmit(newModel);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
public static void UpdateCoConstructionActivities(Model.Examine_CoConstructionActivities model)
{
Model.Examine_CoConstructionActivities newModel = Funs.DB.Examine_CoConstructionActivities.FirstOrDefault(e => e.Id == model.Id);
if (newModel != null)
{
newModel.Code = model.Code;
newModel.Name = model.Name;
newModel.UserId = model.UserId;
newModel.DateTime = model.DateTime;
newModel.Content = model.Content;
newModel.Remark = model.Remark;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="Id"></param>
public static void DeleteCoConstructionActivitiesById(string Id)
{
Model.Examine_CoConstructionActivities model = Funs.DB.Examine_CoConstructionActivities.FirstOrDefault(e => e.Id == Id);
if (model != null)
{
CommonService.DeleteAttachFileById(Id);
Funs.DB.Examine_CoConstructionActivities.DeleteOnSubmit(model);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -1,77 +0,0 @@
using System.Linq;
namespace BLL
{
/// <summary>
/// 领导人员参加班组作业分析会
/// </summary>
public static class LeadershipJoinHomeworkAnalysisMeetingService
{
/// <summary>
/// 根据主键获取领导人员参加班组作业分析会信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Examine_LeadershipJoinHomeworkAnalysisMeeting GetLeadershipJoinHomeworkAnalysisMeetingById(string Id)
{
return Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 添加领导人员参加班组作业分析会
/// </summary>
/// <param name="model"></param>
public static void AddLeadershipJoinHomeworkAnalysisMeeting(Model.Examine_LeadershipJoinHomeworkAnalysisMeeting model)
{
Model.Examine_LeadershipJoinHomeworkAnalysisMeeting newModel = new Model.Examine_LeadershipJoinHomeworkAnalysisMeeting
{
Id = model.Id,
ProjectId = model.ProjectId,
Code = model.Code,
Name = model.Name,
UserId = model.UserId,
DateTime = model.DateTime,
CompileDate = model.CompileDate,
CompileMan = model.CompileMan,
Remark = model.Remark,
Content = model.Content
};
Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.InsertOnSubmit(newModel);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
public static void UpdateLeadershipJoinHomeworkAnalysisMeeting(Model.Examine_LeadershipJoinHomeworkAnalysisMeeting model)
{
Model.Examine_LeadershipJoinHomeworkAnalysisMeeting newModel = Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.FirstOrDefault(e => e.Id == model.Id);
if (newModel != null)
{
newModel.Code = model.Code;
newModel.Name = model.Name;
newModel.UserId = model.UserId;
newModel.DateTime = model.DateTime;
newModel.Content = model.Content;
newModel.Remark = model.Remark;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="Id"></param>
public static void DeleteLeadershipJoinHomeworkAnalysisMeetingById(string Id)
{
Model.Examine_LeadershipJoinHomeworkAnalysisMeeting model = Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.FirstOrDefault(e => e.Id == Id);
if (model != null)
{
CommonService.DeleteAttachFileById(Id);
Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.DeleteOnSubmit(model);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -1,77 +0,0 @@
using System.Linq;
namespace BLL
{
/// <summary>
/// 个人安全行动计划
/// </summary>
public static class PersonalSafetyActionPlanService
{
/// <summary>
/// 根据主键获取个人安全行动计划信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Examine_PersonalSafetyActionPlan GetPersonalSafetyActionPlanById(string Id)
{
return Funs.DB.Examine_PersonalSafetyActionPlan.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 添加个人安全行动计划
/// </summary>
/// <param name="model"></param>
public static void AddPersonalSafetyActionPlan(Model.Examine_PersonalSafetyActionPlan model)
{
Model.Examine_PersonalSafetyActionPlan newModel = new Model.Examine_PersonalSafetyActionPlan
{
Id = model.Id,
ProjectId = model.ProjectId,
Code = model.Code,
Name = model.Name,
UserId = model.UserId,
DateTime = model.DateTime,
CompileDate = model.CompileDate,
CompileMan = model.CompileMan,
Remark = model.Remark,
Content = model.Content
};
Funs.DB.Examine_PersonalSafetyActionPlan.InsertOnSubmit(newModel);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
public static void UpdatePersonalSafetyActionPlan(Model.Examine_PersonalSafetyActionPlan model)
{
Model.Examine_PersonalSafetyActionPlan newModel = Funs.DB.Examine_PersonalSafetyActionPlan.FirstOrDefault(e => e.Id == model.Id);
if (newModel != null)
{
newModel.Code = model.Code;
newModel.Name = model.Name;
newModel.UserId = model.UserId;
newModel.DateTime = model.DateTime;
newModel.Content = model.Content;
newModel.Remark = model.Remark;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="Id"></param>
public static void DeletePersonalSafetyActionPlanById(string Id)
{
Model.Examine_PersonalSafetyActionPlan model = Funs.DB.Examine_PersonalSafetyActionPlan.FirstOrDefault(e => e.Id == Id);
if (model != null)
{
CommonService.DeleteAttachFileById(Id);
Funs.DB.Examine_PersonalSafetyActionPlan.DeleteOnSubmit(model);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -1,77 +0,0 @@
using System.Linq;
namespace BLL
{
/// <summary>
/// 安全经验分享
/// </summary>
public static class SharingOfSafetyExperienceService
{
/// <summary>
/// 根据主键获取安全经验分享信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Examine_SharingOfSafetyExperience GetSharingOfSafetyExperienceById(string Id)
{
return Funs.DB.Examine_SharingOfSafetyExperience.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 添加安全经验分享
/// </summary>
/// <param name="model"></param>
public static void AddSharingOfSafetyExperience(Model.Examine_SharingOfSafetyExperience model)
{
Model.Examine_SharingOfSafetyExperience newModel = new Model.Examine_SharingOfSafetyExperience
{
Id = model.Id,
ProjectId = model.ProjectId,
Code = model.Code,
Name = model.Name,
UserId = model.UserId,
DateTime = model.DateTime,
CompileDate = model.CompileDate,
CompileMan = model.CompileMan,
Remark = model.Remark,
Content = model.Content
};
Funs.DB.Examine_SharingOfSafetyExperience.InsertOnSubmit(newModel);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
public static void UpdateSharingOfSafetyExperience(Model.Examine_SharingOfSafetyExperience model)
{
Model.Examine_SharingOfSafetyExperience newModel = Funs.DB.Examine_SharingOfSafetyExperience.FirstOrDefault(e => e.Id == model.Id);
if (newModel != null)
{
newModel.Code = model.Code;
newModel.Name = model.Name;
newModel.UserId = model.UserId;
newModel.DateTime = model.DateTime;
newModel.Content = model.Content;
newModel.Remark = model.Remark;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="Id"></param>
public static void DeleteSharingOfSafetyExperienceById(string Id)
{
Model.Examine_SharingOfSafetyExperience model = Funs.DB.Examine_SharingOfSafetyExperience.FirstOrDefault(e => e.Id == Id);
if (model != null)
{
CommonService.DeleteAttachFileById(Id);
Funs.DB.Examine_SharingOfSafetyExperience.DeleteOnSubmit(model);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -37,98 +37,100 @@ namespace BLL
/// <summary>
/// 增加危险观察登记信息
/// </summary>
/// <param name="hazardRegister">危险观察登记实体</param>
public static void AddHazardRegister(Model.HSSE_Hazard_HazardRegister hazardRegister)
/// <param name="model">危险观察登记实体</param>
public static void AddHazardRegister(Model.HSSE_Hazard_HazardRegister model)
{
Model.SGGLDB db = Funs.DB;
Model.HSSE_Hazard_HazardRegister newHazardRegister = new Model.HSSE_Hazard_HazardRegister();
newHazardRegister.HazardRegisterId = hazardRegister.HazardRegisterId;
newHazardRegister.HazardCode = hazardRegister.HazardCode;
newHazardRegister.RegisterDate = DateTime.Now;
newHazardRegister.RegisterDef = hazardRegister.RegisterDef;
newHazardRegister.RegisterTypesId = hazardRegister.RegisterTypesId;
newHazardRegister.CheckCycle = hazardRegister.CheckCycle;
newHazardRegister.Rectification = hazardRegister.Rectification;
newHazardRegister.Place = hazardRegister.Place;
newHazardRegister.ResponsibleUnit = hazardRegister.ResponsibleUnit;
newHazardRegister.Observer = hazardRegister.Observer;
newHazardRegister.RectifiedDate = hazardRegister.RectifiedDate;
newHazardRegister.AttachUrl = hazardRegister.AttachUrl;
newHazardRegister.ProjectId = hazardRegister.ProjectId;
newHazardRegister.States = hazardRegister.States;
newHazardRegister.IsEffective = hazardRegister.IsEffective;
newHazardRegister.ResponsibleMan = hazardRegister.ResponsibleMan;
newHazardRegister.CheckSpecialId = hazardRegister.CheckSpecialId;
newHazardRegister.CheckManId = hazardRegister.CheckManId;
newHazardRegister.CheckTime = hazardRegister.CheckTime;
newHazardRegister.RectificationPeriod = hazardRegister.RectificationPeriod;
newHazardRegister.ImageUrl = hazardRegister.ImageUrl;
newHazardRegister.RectificationImageUrl = hazardRegister.RectificationImageUrl;
newHazardRegister.RectificationTime = hazardRegister.RectificationTime;
newHazardRegister.ConfirmMan = hazardRegister.ConfirmMan;
newHazardRegister.ConfirmDate = hazardRegister.ConfirmDate;
newHazardRegister.HandleIdea = hazardRegister.HandleIdea;
newHazardRegister.CutPayment = hazardRegister.CutPayment;
newHazardRegister.ProblemTypes = hazardRegister.ProblemTypes;
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
newHazardRegister.Risk_Level = hazardRegister.Risk_Level;
newHazardRegister.Requirements = hazardRegister.Requirements;
newHazardRegister.ControlId = hazardRegister.ControlId;
Model.HSSE_Hazard_HazardRegister newModel = new Model.HSSE_Hazard_HazardRegister();
newModel.HazardRegisterId = model.HazardRegisterId;
newModel.HazardCode = model.HazardCode;
newModel.RegisterDate = DateTime.Now;
newModel.RegisterDef = model.RegisterDef;
newModel.RegisterTypesId = model.RegisterTypesId;
newModel.CheckCycle = model.CheckCycle;
newModel.Rectification = model.Rectification;
newModel.Place = model.Place;
newModel.ResponsibleUnit = model.ResponsibleUnit;
newModel.Observer = model.Observer;
newModel.RectifiedDate = model.RectifiedDate;
newModel.AttachUrl = model.AttachUrl;
newModel.ProjectId = model.ProjectId;
newModel.States = model.States;
newModel.IsEffective = model.IsEffective;
newModel.ResponsibleMan = model.ResponsibleMan;
newModel.CheckSpecialId = model.CheckSpecialId;
newModel.CheckManId = model.CheckManId;
newModel.CheckTime = model.CheckTime;
newModel.RectificationPeriod = model.RectificationPeriod;
newModel.ImageUrl = model.ImageUrl;
newModel.RectificationImageUrl = model.RectificationImageUrl;
newModel.RectificationTime = model.RectificationTime;
newModel.ConfirmMan = model.ConfirmMan;
newModel.ConfirmDate = model.ConfirmDate;
newModel.HandleIdea = model.HandleIdea;
newModel.CutPayment = model.CutPayment;
newModel.ProblemTypes = model.ProblemTypes;
newModel.DIC_ID = model.DIC_ID;
newModel.Risk_Level = model.Risk_Level;
newModel.Requirements = model.Requirements;
newModel.ControlId = model.ControlId;
newModel.CheckItemDetailId = model.CheckItemDetailId;
newModel.CompanyTrainingItemId = model.CompanyTrainingItemId;
newHazardRegister.CheckItemDetailId = hazardRegister.CheckItemDetailId;
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newHazardRegister);
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newModel);
db.SubmitChanges();
}
/// <summary>
/// 修改危险观察登记信息
/// </summary>
/// <param name="hazardRegister">危险观察登记实体</param>
public static void UpdateHazardRegister(Model.HSSE_Hazard_HazardRegister hazardRegister)
/// <param name="model">危险观察登记实体</param>
public static void UpdateHazardRegister(Model.HSSE_Hazard_HazardRegister model)
{
Model.SGGLDB db = Funs.DB;
Model.HSSE_Hazard_HazardRegister newHazardRegister = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegister.HazardRegisterId);
if (newHazardRegister != null)
Model.HSSE_Hazard_HazardRegister newModel = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == model.HazardRegisterId);
if (newModel != null)
{
newHazardRegister.HazardCode = hazardRegister.HazardCode;
newHazardRegister.RegisterDef = hazardRegister.RegisterDef;
newHazardRegister.Rectification = hazardRegister.Rectification;
newHazardRegister.Place = hazardRegister.Place;
newHazardRegister.ResponsibleUnit = hazardRegister.ResponsibleUnit;
newHazardRegister.Observer = hazardRegister.Observer;
newHazardRegister.RectifiedDate = hazardRegister.RectifiedDate;
newHazardRegister.AttachUrl = hazardRegister.AttachUrl;
newHazardRegister.ProjectId = hazardRegister.ProjectId;
newHazardRegister.States = hazardRegister.States;
newHazardRegister.IsEffective = hazardRegister.IsEffective;
newHazardRegister.ResponsibleMan = hazardRegister.ResponsibleMan;
newHazardRegister.CheckManId = hazardRegister.CheckManId;
//newHazardRegister.CheckTime = hazardRegister.CheckTime;
newHazardRegister.RectificationPeriod = hazardRegister.RectificationPeriod;
newHazardRegister.ImageUrl = hazardRegister.ImageUrl;
newHazardRegister.RectificationImageUrl = hazardRegister.RectificationImageUrl;
newHazardRegister.RectificationTime = hazardRegister.RectificationTime;
newHazardRegister.ConfirmMan = hazardRegister.ConfirmMan;
newHazardRegister.ConfirmDate = hazardRegister.ConfirmDate;
newHazardRegister.HandleIdea = hazardRegister.HandleIdea;
newHazardRegister.CutPayment = hazardRegister.CutPayment;
newHazardRegister.ProblemTypes = hazardRegister.ProblemTypes;
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
newHazardRegister.CheckItemDetailId = hazardRegister.CheckItemDetailId;
newHazardRegister.RegisterTypesId = hazardRegister.RegisterTypesId;
newHazardRegister.Risk_Level = hazardRegister.Risk_Level;
newHazardRegister.Requirements = hazardRegister.Requirements;
newModel.HazardCode = model.HazardCode;
newModel.RegisterDef = model.RegisterDef;
newModel.Rectification = model.Rectification;
newModel.Place = model.Place;
newModel.ResponsibleUnit = model.ResponsibleUnit;
newModel.Observer = model.Observer;
newModel.RectifiedDate = model.RectifiedDate;
newModel.AttachUrl = model.AttachUrl;
newModel.ProjectId = model.ProjectId;
newModel.States = model.States;
newModel.IsEffective = model.IsEffective;
newModel.ResponsibleMan = model.ResponsibleMan;
newModel.CheckManId = model.CheckManId;
//newModel.CheckTime = model.CheckTime;
newModel.RectificationPeriod = model.RectificationPeriod;
newModel.ImageUrl = model.ImageUrl;
newModel.RectificationImageUrl = model.RectificationImageUrl;
newModel.RectificationTime = model.RectificationTime;
newModel.ConfirmMan = model.ConfirmMan;
newModel.ConfirmDate = model.ConfirmDate;
newModel.HandleIdea = model.HandleIdea;
newModel.CutPayment = model.CutPayment;
newModel.ProblemTypes = model.ProblemTypes;
newModel.DIC_ID = model.DIC_ID;
newModel.CheckItemDetailId = model.CheckItemDetailId;
newModel.RegisterTypesId = model.RegisterTypesId;
newModel.Risk_Level = model.Risk_Level;
newModel.Requirements = model.Requirements;
newModel.CompanyTrainingItemId = model.CompanyTrainingItemId;
//把附件表的路径复制过来
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(model.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
if (file != null)
{
newHazardRegister.ImageUrl = file.AttachUrl;
newModel.ImageUrl = file.AttachUrl;
}
Model.AttachFile fileR = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId + "-R", Const.HSSE_HiddenRectificationListMenuId);
Model.AttachFile fileR = BLL.AttachFileService.GetAttachFile(model.HazardRegisterId + "-R", Const.HSSE_HiddenRectificationListMenuId);
if (fileR != null)
{
newHazardRegister.RectificationImageUrl = fileR.AttachUrl;
newModel.RectificationImageUrl = fileR.AttachUrl;
}
db.SubmitChanges();
@@ -142,18 +144,18 @@ namespace BLL
public static void DeleteHazardRegisterByHazardRegisterId(string hazardRegisterId)
{
Model.SGGLDB db = Funs.DB;
Model.HSSE_Hazard_HazardRegister hazardRegister = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegisterId);
if (hazardRegister != null)
Model.HSSE_Hazard_HazardRegister model = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegisterId);
if (model != null)
{
try
{
BLL.UploadFileService.DeleteFile(Funs.RootPath, hazardRegister.ImageUrl);//删除整改前图片
BLL.UploadFileService.DeleteFile(Funs.RootPath, hazardRegister.RectificationImageUrl);//删除整改后图片
BLL.UploadFileService.DeleteFile(Funs.RootPath, model.ImageUrl);//删除整改前图片
BLL.UploadFileService.DeleteFile(Funs.RootPath, model.RectificationImageUrl);//删除整改后图片
}
catch (Exception)
{
}
db.HSSE_Hazard_HazardRegister.DeleteOnSubmit(hazardRegister);
db.HSSE_Hazard_HazardRegister.DeleteOnSubmit(model);
db.SubmitChanges();
}
}
+30 -1
View File
@@ -441,7 +441,7 @@ namespace BLL
newPerson.DepartId = person.DepartId;
newPerson.QRCodeAttachUrl = person.QRCodeAttachUrl;
newPerson.Password = GetPersonPassWord(person.IdentityCard);
newPerson.ExchangeTime = null;
newPerson.ExchangeTime = null;
newPerson.ExchangeTime2 = null;
newPerson.RealNameUpdateTime = null;
if (!string.IsNullOrEmpty(person.AuditorId))
@@ -654,6 +654,35 @@ namespace BLL
}
}
/// <summary>
/// 表下拉框
/// </summary>
/// <param name="dropName"></param>
/// <param name="projectId"></param>
/// <param name="unitId"></param>
/// <param name="isShowPlease"></param>
public static void InitPersonByMultiProjectUnitDropDownList(FineUIPro.DropDownList dropName, string projectId, string unitIds, bool isShowPlease)
{
dropName.DataValueField = "PersonId";
dropName.DataTextField = "PersonName";
var list = new List<Model.SitePerson_Person>();
var lstUnitId = unitIds.Split(',');
foreach (var item in lstUnitId)
{
if (!string.IsNullOrWhiteSpace(item))
{
var lst = GetPersonLitsByprojectIdUnitId(projectId, item);
list.AddRange(lst);
}
}
dropName.DataSource = list;
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 表下拉框
/// </summary>