示例#1
0
 private void AddLineItem_Click(object sender, RoutedEventArgs e)
 {
     modal = new IANLineItemModal();
     IANLineItemViewModel vmItem = modal.DataContext as IANLineItemViewModel;
     vmItem.ClearAndSetup.Execute(null);
     vmItem.RadioEdit = true;
     vmItem.StockTake = !_vm.AdjustInventory;
     if (_vm.AdjustInventory && !_vm.CanAdjustInventory())
     {
         MessageBox.Show("You dont have permission to Adjustment Inventory", "Inventory Adjustment");
         return;
     }
     modal.Closed += new EventHandler(modal_Closed);
     modal.ShowDialog();
 }
示例#2
0
        private void hlEdit_Click(object sender, RoutedEventArgs e)
        {
            modal = new IANLineItemModal();
            modal.Closed += new EventHandler(modal_Closed);
            Hyperlink hl = sender as Hyperlink;
            IANLineItemViewModel vmItem = modal.DataContext as IANLineItemViewModel;
            vmItem.ClearAndSetup.Execute(null);

            Guid product = (Guid)hl.Tag;
            var lineItem = _vm.LineItems.First(n => n.Id == product && n.IsEditable);
            vmItem.LoadForEdit(
                lineItem.Id,
                lineItem.ActualQty,
                lineItem.ExpectedQty,
                lineItem.Reason, lineItem.Variance,
                lineItem.LineItemType
                );
            modal.ShowDialog();
        }