Exemplo n.º 1
0
 private void ExecuteEdit()
 {
     try
     {
         EditEnabled      = true;
         EnabledCC        = true;
         _selectedCommand = CommandType.Edit;
         _manageSKUID     = new SKUIDViewModel {
             ID             = SelectedSKUID.ID,
             Description    = SelectedSKUID.Description,
             DefaultQty     = SelectedSKUID.DefaultQty,
             Unit           = SelectedSKUID.Unit,
             Layout         = SelectedSKUID.Layout,
             Capacity       = SelectedSKUID.Capacity,
             Height         = SelectedSKUID.Height,
             Weight         = SelectedSKUID.Weight,
             FrequencyClass = SelectedSKUID.FrequencyClass
         };
         _manageSKUID.Initialize(_warehouse);
         _manageSKUID.ValidationEnabled = true;
         DetailedSKUID = _manageSKUID;
     }
     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 SKUIDsViewModel()
        {
            TUList        = new ObservableCollection <TUViewModel>();
            SelectedSKUID = null;
            DetailedSKUID = new SKUIDViewModel();
            EditEnabled   = false;
            EnabledCC     = false;

            _selectedCommand = CommandType.None;

            Add        = new RelayCommand(() => ExecuteAdd(), CanExecuteAdd);
            Edit       = new RelayCommand(() => ExecuteEdit(), CanExecuteEdit);
            Cancel     = new RelayCommand(() => ExecuteCancel(), CanExecuteCancel);
            Confirm    = new RelayCommand(() => ExecuteConfirm(), CanExecuteConfirm);
            Refresh    = new RelayCommand(async() => await ExecuteRefresh());
            RefreshTUs = new RelayCommand(async() => await ExecuteRefreshTUs());
            SelectionChangedCommand = new RelayCommand <IList>(items => NumberOfSelectedItems = items == null ? 0 : items.Count);
        }
Exemplo n.º 3
0
        private async Task ExecuteRefresh()
        {
            try
            {
                SKUIDViewModel sl     = SelectedSKUID;
                var            skuids = await _dbservicewms.GetSKUIDs();

                SKUIDList.Clear();
                foreach (var p in skuids)
                {
                    SKUIDList.Add(new SKUIDViewModel {
                        ID             = p.ID,
                        Description    = p.Description,
                        DefaultQty     = p.DefaultQty,
                        Unit           = p.Unit,
                        Weight         = p.Weight,
                        FrequencyClass = p.FrequencyClass,
                        Layout         = p.Layout,
                        Capacity       = p.Capacity,
                        Height         = p.Height
                    });
                }
                foreach (var l in SKUIDList)
                {
                    l.Initialize(_warehouse);
                }
                if (sl != null)
                {
                    SelectedSKUID = SKUIDList.FirstOrDefault(p => p.ID == sl.ID);
                }
                if (SelectedSKUID == null)
                {
                    SelectedSKUID = SKUIDList.FirstOrDefault();
                }
            }
            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.º 4
0
 private void ExecuteAdd()
 {
     try
     {
         EditEnabled      = true;
         EnabledCC        = true;
         _selectedCommand = CommandType.Add;
         _manageSKUID     = new SKUIDViewModel {
             ID = "", Description = "", DefaultQty = 0, Unit = "", Weight = 0, FrequencyClass = 0
         };
         _manageSKUID.Initialize(_warehouse);
         _manageSKUID.AllowChangeIndex  = true;
         _manageSKUID.ValidationEnabled = true;
         DetailedSKUID = _manageSKUID;
     }
     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));
     }
 }