Commit be833ad9 by 李承祥

人员新增修改时的工作时间修改

parent 41accef4
...@@ -60,7 +60,7 @@ public class EmployeeRequest ...@@ -60,7 +60,7 @@ public class EmployeeRequest
/// <summary> /// <summary>
/// 参加工作时间 /// 参加工作时间
/// </summary> /// </summary>
public Nullable<DateTime> WorkTime { get; set; } public string WorkTime { get; set; }
/// <summary> /// <summary>
/// 考核得分率 /// 考核得分率
......
...@@ -53,6 +53,8 @@ public List<im_employee> GetEmployeeList(int allotId) ...@@ -53,6 +53,8 @@ public List<im_employee> GetEmployeeList(int allotId)
public im_employee Insert(EmployeeRequest request) public im_employee Insert(EmployeeRequest request)
{ {
var employee = Mapper.Map<im_employee>(request); var employee = Mapper.Map<im_employee>(request);
if (string.IsNullOrEmpty(request.WorkTime))
employee.WorkTime = null;
perforImemployeeRepository.Add(employee); perforImemployeeRepository.Add(employee);
return employee; return employee;
} }
...@@ -64,6 +66,7 @@ public im_employee Insert(EmployeeRequest request) ...@@ -64,6 +66,7 @@ public im_employee Insert(EmployeeRequest request)
/// <returns></returns> /// <returns></returns>
public im_employee Update(EmployeeRequest request) public im_employee Update(EmployeeRequest request)
{ {
Nullable<DateTime> time = null;
var employee = perforImemployeeRepository.GetEntity(t => t.ID == request.ID); var employee = perforImemployeeRepository.GetEntity(t => t.ID == request.ID);
if (employee == null) if (employee == null)
throw new PerformanceException("该人员不存在"); throw new PerformanceException("该人员不存在");
...@@ -75,7 +78,7 @@ public im_employee Update(EmployeeRequest request) ...@@ -75,7 +78,7 @@ public im_employee Update(EmployeeRequest request)
employee.FitPeople = request.FitPeople; employee.FitPeople = request.FitPeople;
employee.JobTitle = request.JobTitle; employee.JobTitle = request.JobTitle;
employee.PostCoefficient = request.PostCoefficient; employee.PostCoefficient = request.PostCoefficient;
employee.WorkTime = request.WorkTime; employee.WorkTime = string.IsNullOrEmpty(request.WorkTime) ? time : Convert.ToDateTime(request.WorkTime);
employee.ScoreAverageRate = request.ScoreAverageRate; employee.ScoreAverageRate = request.ScoreAverageRate;
employee.Attendance = request.Attendance; employee.Attendance = request.Attendance;
employee.PeopleNumber = request.PeopleNumber; employee.PeopleNumber = request.PeopleNumber;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment