public static Department GetDepartment(Guid? uid)
 {
     if (uid == null)
         return new Department(); ;
     var filter = new DepartmentFilter();
     filter.Uids.Add((Guid)uid);
     return FiresecService.GetDepartments(filter).ToList().FirstOrDefault();
 }
Example #2
0
 public IEnumerable<Department> GetDepartments(DepartmentFilter filter)
 {
     try
     {
         var departments = new List<Department>();
         var databaseDepartments = Context.Department.ToList().Where(x => IsInFilter(x, filter)).ToList();
         databaseDepartments.ForEach(x => departments.Add(Translator.Translate(x)));
         return departments;
     }
     catch { return new List<Department>(); }
 }
Example #3
0
        bool IsInFilter(FiresecService.SKUD.DataAccess.Department item, DepartmentFilter filter)
        {
            if (filter == null)
                return true;

            bool isInUids = !filter.HasUids || filter.Uids.Any(x => item.Uid == x);

            return isInUids;
        }
 public IEnumerable<Department> GetDepartments(DepartmentFilter filter)
 {
     return _skud.GetDepartments(filter);
 }
 public static IEnumerable<Department> GetDepartments(DepartmentFilter filter)
 {
     return FiresecService.GetDepartments(filter);
 }