Commit be833ad9 by 李承祥

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

parent 41accef4
......@@ -60,7 +60,7 @@ public class EmployeeRequest
/// <summary>
/// 参加工作时间
/// </summary>
public Nullable<DateTime> WorkTime { get; set; }
public string WorkTime { get; set; }
/// <summary>
/// 考核得分率
......
......@@ -53,6 +53,8 @@ public List<im_employee> GetEmployeeList(int allotId)
public im_employee Insert(EmployeeRequest request)
{
var employee = Mapper.Map<im_employee>(request);
if (string.IsNullOrEmpty(request.WorkTime))
employee.WorkTime = null;
perforImemployeeRepository.Add(employee);
return employee;
}
......@@ -64,6 +66,7 @@ public im_employee Insert(EmployeeRequest request)
/// <returns></returns>
public im_employee Update(EmployeeRequest request)
{
Nullable<DateTime> time = null;
var employee = perforImemployeeRepository.GetEntity(t => t.ID == request.ID);
if (employee == null)
throw new PerformanceException("该人员不存在");
......@@ -75,7 +78,7 @@ public im_employee Update(EmployeeRequest request)
employee.FitPeople = request.FitPeople;
employee.JobTitle = request.JobTitle;
employee.PostCoefficient = request.PostCoefficient;
employee.WorkTime = request.WorkTime;
employee.WorkTime = string.IsNullOrEmpty(request.WorkTime) ? time : Convert.ToDateTime(request.WorkTime);
employee.ScoreAverageRate = request.ScoreAverageRate;
employee.Attendance = request.Attendance;
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