public Department(DepartmentType type, PhoneNumber phone) { Type = type; Name = type.ToString(); Phone = phone; Employees = new List <Employee>(); Id = type.ToString().Substring(0, 1); }
public Department(string name) { Type = (DepartmentType)Enum.Parse(typeof(DepartmentType), name, true); Phone = new PhoneNumber(); Name = Type.ToString(); }
/// <summary> /// Конвертировать тип цвета печати в версию для приложения /// </summary> public static DepartmentTypeApp ToApplication(DepartmentType departmentType) => Enum.TryParse(departmentType.ToString(), true, out DepartmentTypeApp departmentTypeApplication) ? departmentTypeApplication : throw new FormatException(nameof(departmentType));