示例#1
0
        public static ItemRowViewModel ToItemRowViewModel(this Item it)
        {
            var vm = new ItemRowViewModel();

            vm.Identifier            = it.Identifier;
            vm.Code                  = it.Code;
            vm.Name                  = it.Name;
            vm.Description           = it.Description;
            vm.AlternativeName       = it.AlternativeName;
            vm.Manufacturer          = it.Manufacturer;
            vm.MajorSupplier         = it.MajorSupplier;
            vm.PackQuantity          = it.PackQuantity;
            vm.PackDescription       = it.PackDescription;
            vm.AlternativeItem       = it.AlternativeItem;
            vm.StandardIssueQuantity = it.StandardIssueQuantity;
            vm.EconomicOrderQuantity = it.EconomicOrderQuantity;
            vm.PurchasePrice         = it.PurchasePrice;
            vm.MarkupPercent         = it.MarkupPercent;
            vm.SellingPrice          = it.SellingPrice;
            vm.StockLevel            = it.StockLevel;
            vm.MinimumLevel          = it.MinimumLevel;
            vm.ReOrderLevel          = it.ReOrderLevel;
            vm.MaximumLevel          = it.MaximumLevel;
            vm.LeadDays              = it.LeadDays;
            return(vm);
        }
示例#2
0
        /// <inheritdoc/>
        public void FireOnItemSelected(ItemRowViewModel selectedItem)
        {
            var e = new SelectedItemEventArgs();

            e.SelectedItem = selectedItem;
            OnSelectedItem?.Invoke(this, e);
        }
示例#3
0
        protected async void OnEditItem(ItemRowViewModel item)
        {
            AddEditItemViewModel vm = new AddEditItemViewModel(KeyboardMode, item.Id, item.Type, true)
            {
                Name   = item.Name,
                Amount = item.Amount.ToString(CultureInfo.CurrentCulture),
            };

            AddEditItemDialog dialog = new AddEditItemDialog()
            {
                DataContext = vm,
            };

            await dialog.ShowAsync();

            switch (dialog.Result)
            {
            case AddEditItemDialogResult.Save:
                SaveItem(vm);
                break;

            case AddEditItemDialogResult.Delete:
                Delete(vm);
                break;

            default:
                break;
            }
        }
示例#4
0
        private ItemRowViewModel ToItemViewModel(ItemOutput item)
        {
            ItemRowViewModel retval = null;

            retval = new ItemRowViewModel();
            retval.Map(item);

            return(retval);
        }
示例#5
0
 private void OnEditCommand(ItemRowViewModel item)
 {
     try
     {
         if (_addEditItemDialog == null)
         {
             _addEditItemDialog          = new AddEditItemDialog(KeyboardMode, item.Id, item.Type, true, item.Name, item.Amount.ToString(CultureInfo.CurrentCulture));
             _addEditItemDialog.OnError += AddEditItemDialog_OnError;
             _addEditItemDialog.Show();
             WaitForAddEditItemResult();
         }
     }
     catch (Exception e)
     {
         HandleError(e);
     }
 }
示例#6
0
 public void LoadItemsDetails(ItemRowViewModel selectedItem)
 {
     txtItemid.Text = selectedItem.Identifier.ToString();
     ucItemDetails.LoadItemDetails(selectedItem.Identifier, selectedItem.Code, selectedItem.Name, (decimal)selectedItem.SellingPrice, selectedItem.StockLevel);
 }