Beispiel #1
0
        private async Task ExecuteRefresh()
        {
            try
            {
                string id       = SelectedPlaceID?.ID;
                var    placeids = await _dbservicewms.GetPlaceIDs(0, int.MaxValue);

                PlaceIDList.Clear();
                foreach (var p in placeids)
                {
                    PlaceIDList.Add(new PlaceIDViewModel
                    {
                        ID             = p.ID,
                        PositionTravel = p.PositionTravel,
                        PositionHoist  = p.PositionHoist,
                        DimensionClass = p.DimensionClass,
                        FrequencyClass = p.FrequencyClass,
                        Status         = (EnumBlockedWMS)p.Status
                    });
                }
                foreach (var l in PlaceIDList)
                {
                    l.Initialize(_warehouse);
                }
                if (id != null)
                {
                    SelectedPlaceID = PlaceIDList.FirstOrDefault(p => p.ID == id);
                }
            }
            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));
            }
        }
        private async Task ExecuteRefreshPlace()
        {
            try
            {
                string placeid = SelectedPlace?.ID;

                var placeids = await _dbservicewms.GetPlaceIDs(-1, -1);

                DataListPlace.Clear();
                foreach (var pl in placeids)
                {
                    DataListPlace.Add(new PlaceIDViewModel
                    {
                        ID = pl.ID
                    });
                }
                foreach (var l in DataListPlace)
                {
                    l.Initialize(_warehouse);
                }
                if (placeid != null)
                {
                    SelectedPlace = DataListPlace.First(p => p.ID == placeid);
                }
            }
            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));
            }
        }