Commit 60a4934c by 纪旭 韦

删除单个人员字典备份

parent a0ebe224
...@@ -383,6 +383,13 @@ public bool DeletePerson(int employeeId) ...@@ -383,6 +383,13 @@ public bool DeletePerson(int employeeId)
if (employee == null) if (employee == null)
throw new PerformanceException($"员工信息错误!"); throw new PerformanceException($"员工信息错误!");
var oldbackup = perforPeremployeeBackupRepository.GetEntity(t=>t.Id == employee.Id);
if (oldbackup != null)
perforPeremployeeBackupRepository.Remove(oldbackup);
var employeeBackup = _mapper.Map<per_employee_backup>(employee);
perforPeremployeeBackupRepository.Add(employeeBackup);
return peremployeeRepository.Remove(employee); return peremployeeRepository.Remove(employee);
} }
...@@ -395,7 +402,7 @@ public bool DeleteAllPerson(int allotId) ...@@ -395,7 +402,7 @@ public bool DeleteAllPerson(int allotId)
{ {
var employees = peremployeeRepository.GetEntities(t => t.AllotId == allotId) var employees = peremployeeRepository.GetEntities(t => t.AllotId == allotId)
?? new List<per_employee>(); ?? new List<per_employee>();
dapperService.PerEmployeeBackup(allotId); dapperService.PerEmployeeBackup(allotId);
return peremployeeRepository.RemoveRange(employees.ToArray()); return peremployeeRepository.RemoveRange(employees.ToArray());
......
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