public void UpdateEmployee(Person currentEmployee, EmployeeDetailsDto newEmployee, Company newCompany, Salary currentSalary) { using (var transaction = _session.BeginTransaction()) { try { var employee = (Employee)currentEmployee; employee.UpdateDataEmp(newEmployee, newCompany); currentSalary.ChangeSalary(newEmployee.Salary); transaction.Commit(); } catch (Exception ex) { Logger.Logger.AddToLog("PersonRepository | UpdateIntern | {0}", ex); transaction.Rollback(); } } }
public void UpdateContractor(Person currentContractor, ContractorDetailsDto newContractor, Company newCompany, Salary currentSalary) { using (var transaction = _session.BeginTransaction()) { try { var contractor = (Contractor)currentContractor; contractor.UpdateData(newContractor, newCompany); currentSalary.ChangeSalary(newContractor.Salary); transaction.Commit(); } catch (Exception ex) { Logger.Logger.AddToLog("PersonRepository | UpdateIntern | {0}", ex); transaction.Rollback(); } } }