예제 #1
0
 public static Position GetPosition(Guid? uid)
 {
     if (uid == null)
         return new Position();
     var filter = new PositionFilter();
     filter.Uids.Add((Guid)uid);
     return FiresecService.GetPositions(filter).ToList().FirstOrDefault();
 }
예제 #2
0
 public IEnumerable<Position> GetPositions(PositionFilter filter)
 {
     try
     {
         var positions = new List<Position>();
         var databasePositions = Context.Position.ToList().Where(x => IsInFilter(x, filter)).ToList();
         databasePositions.ForEach(x => positions.Add(Translator.Translate(x)));
         return positions;
     }
     catch { return new List<Position>(); }
 }
예제 #3
0
        bool IsInFilter(FiresecService.SKUD.DataAccess.Position item, PositionFilter filter)
        {
            if (filter == null)
                return true;

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

            return isInUids;
        }
예제 #4
0
 public IEnumerable<Position> GetPositions(PositionFilter filter)
 {
     return _skud.GetPositions(filter);
 }
예제 #5
0
 public static IEnumerable<Position> GetPositions(PositionFilter filter)
 {
     return FiresecService.GetPositions(filter);
 }