partial void UpdateDepartment(Department instance);
partial void DeleteDepartment(Department instance);
partial void InsertDepartment(Department instance);
private void detach_Department1(Department entity) { this.SendPropertyChanging(); entity.Employee1 = null; }
private void attach_Department(Department entity) { this.SendPropertyChanging(); entity.Employee = this; }
private void attach_Department2(Department entity) { this.SendPropertyChanging(); entity.Department1 = this; }
//public FiresecAPI.Models.Skud.AdditionalColumn Translate(AdditionalColumn additionalColumn) //{ // if (additionalColumn == null) // return null; // FiresecAPI.Models.Skud.AdditionalColumnType type; // switch (additionalColumn.Type) // { // case "Graphics": // type = FiresecAPI.Models.Skud.AdditionalColumnType.Graphics; // break; // case "Mixed": // type = FiresecAPI.Models.Skud.AdditionalColumnType.Mixed; // break; // default: // type = FiresecAPI.Models.Skud.AdditionalColumnType.Text; // break; // } // return new FiresecAPI.Models.Skud.AdditionalColumn // { // Uid = additionalColumn.Uid, // Name = additionalColumn.Name, // Description = additionalColumn.Description, // TextData = additionalColumn.TextData, // GraphicsData = additionalColumn.GraphicsData.ToArray(), // Type = type // }; //} //public FiresecAPI.Models.Skud.Phone Translate(Phone phone) //{ // if (phone == null) // return null; // return new FiresecAPI.Models.Skud.Phone // { // Uid = phone.Uid, // Name = phone.Name, // NumberString = phone.NumberString // }; //} public static FiresecAPI.Models.Skud.Department Translate(Department department) { if (department == null) return null; var phoneUids = new List<Guid>(); department.Phone.ToList().ForEach(x => phoneUids.Add(x.Uid)); var childDepartmentUids = new List<Guid>(); department.Department2.ToList().ForEach(x => childDepartmentUids.Add(x.Uid)); var resultDepartment = new FiresecAPI.Models.Skud.Department { Uid = department.Uid, Name = department.Name, Description = department.Description, ParentDepartmentUid = department.ParentDepartmentUid, ChildDepartmentUids = childDepartmentUids, ContactEmployeeUid = department.ContactEmployeeUid, AttendantEmployeeUId = department.AttendantUid, PhoneUids = phoneUids }; return resultDepartment; }