partial void UpdateEmployee(Employee instance);
partial void DeleteEmployee(Employee instance);
private void detach_Employee(Employee entity) { this.SendPropertyChanging(); entity.Schedule = null; }
partial void InsertEmployee(Employee instance);
private void attach_Employee(Employee entity) { this.SendPropertyChanging(); entity.Schedule = this; }
private void detach_Employee(Employee entity) { this.SendPropertyChanging(); entity.Position = null; }
private void attach_Employee(Employee entity) { this.SendPropertyChanging(); entity.Position = this; }
private void detach_Employee2(Employee entity) { this.SendPropertyChanging(); entity.Department2 = null; }
//public FiresecAPI.Models.Skud.EmployeeReplacement Translate(EmployeeReplacement employeeReplacement) //{ // if (employeeReplacement == null) // return null; // return new FiresecAPI.Models.Skud.EmployeeReplacement // { // Uid = employeeReplacement.Uid, // BeginDate = employeeReplacement.BeginDate, // EndDate = employeeReplacement.EndDate, // Department = Translate(employeeReplacement.Department), // Schedule = Translate(employeeReplacement.Schedule) // }; //} public static FiresecAPI.Models.Skud.Employee Translate(Employee employee) { if (employee == null) return null; var additionalColumnUids = new List<Guid>(); employee.AdditionalColumn.Where(x => x.EmployeeUid == employee.Uid).ToList().ForEach(x => additionalColumnUids.Add(x.Uid)); Guid? replacementUid = null; if (employee.EmployeeReplacement != null) replacementUid = employee.EmployeeReplacement.Uid; var resultEmployee = new FiresecAPI.Models.Skud.Employee { Uid = employee.Uid, FirstName = employee.FirstName, SecondName = employee.SecondName, LastName = employee.LastName, Appointed = employee.Appointed, Dismissed = employee.Dismissed, PositionUid = employee.PositionUid, ReplacementUid = replacementUid, DepartmentUid = employee.DepartmentUid, ScheduleUid = employee.ScheduleUid, AdditionalColumnUids = additionalColumnUids }; return resultEmployee; }