private async Task ExecuteRefresh()
        {
            try
            {
                MovementViewModel sm = SelectedMovement;
                var moves            = await _warehouse.DBService.GetMovements(DateFrom.TimeStamp, DateTo.TimeStamp, Location, TransportUnit);

                MovementList.Clear();
                foreach (var m in moves)
                {
                    MovementList.Add(new MovementViewModel {
                        Movement = m
                    });
                }
                if (sm != null)
                {
                    SelectedMovement = MovementList.FirstOrDefault(p => p.ID == sm.ID);
                }
                Records = MovementList.Count;
            }
            catch (Exception e)
            {
                _warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception,
                                    string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message));
            }
        }
Exemplo n.º 2
0
        public void AddMovement(IMovement movement)
        {
            if (movement == null)
            {
                return;
            }

            MovementList.Add(movement);
        }