public IList <TaskCategory> GetTaskCategoriesFiltered(string path, string locationType) { PropertyRepairConfiguration config = new PropertyRepairConfiguration() { IsGeneralNeeds = true }; var allTasks = this.GetTasks(path, config, locationType); var filtered = this.CreateCategories(allTasks); return(filtered); }
public TaskExtended GetTask(string path, string code, PropertyRepairConfiguration config, string locationType) { var list = this.GetTasks(path, config, locationType); list = list.Where(x => x.Code == code).ToList(); if (list.Count == 0) { throw new ApplicationException($"Task not found:{code}"); } return(list[0]); }
public IList <TaskExtended> GetTasks(string path, PropertyRepairConfiguration config, string locationType) { var list = this.repairTaskRepository.GetTaskCategoriesNoHierarchy(path); list = locationType == "P" ? list.Where(x => x.Unit).ToList() : list.Where(x => x.Communal).ToList(); if (config.IsGeneralNeeds) { list = list.Where(x => x.TenureRented).ToList(); } if (config.IsLeaseholdOrSharedOwner && !config.IsInDefects) { list = list.Where(x => x.TenureSharedOwner).ToList(); } if (config.IsShelteredOrSupported) { list = list.Where(x => x.TenureSupported).ToList(); } return(list); }