public Department GetDepartment(string id) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentException(); } return(Departments.Find(e => e.Id == id)); }
//---------------------------------------------------------------------------------------------------- /// <summary> /// Задает общий список, с информацией о сотрудниках /// </summary> private void SetGeneralСollection() { GeneralCollection = new ObservableCollection <GeneralPersonsInfo>(); foreach (var person in Persons) { string io = person.FirstName.ElementAt(0) + "." + person.LastName.ElementAt(0) + "."; GeneralCollection.Add(new GeneralPersonsInfo() { PersonId = person.PersonId, Name = person.SecondName + ' ' + io, DateEmploy = person.DateEmploy, DateUnEmploy = person.DateUnEmploy, Status = Statuses.Find(x => x.StatusId == person.StatusId).Name, Department = Departments.Find(x => x.DepartmentId == person.DepartmentId).Name, Post = Posts.Find(x => x.PostId == person.PostId).Name }); } ; GeneralInfoCollection = CollectionViewSource.GetDefaultView(GeneralCollection); }
/// <summary> /// Find department with specified ID /// </summary> /// <param name="deptID">Department ID</param> /// <returns> /// Department with specified ID /// null if a department with such ID does not exist /// </returns> public IDepartmentDTO Department(uint deptID) { return(Departments.Find(d => d.DeptID == deptID)); }
/// <summary> /// Returns root department of organization /// </summary> /// <returns>Root department</returns> public IDepartmentDTO RootDepartment() { BaseDepartment dept = Departments.Find(d => d.ParentDeptID == 0); return(dept); }
public void SelectDepartment(string id) { SelectedDepartment = Departments.Find(d => d.Id == id); }
public void SelectionChanged2(int parameter) { this.Department = Departments.Find(e => parameter == e.Id); }