Ejemplo n.º 1
0
        private void AddStorageOutAddItem()
        {
            Specification spec = (Specification)AsoStorageOutBarcode.Tag;

            if (spec != null)
            {
                IList<ProductView> list = (IList<ProductView>)AsoStorageOutItemDataGridView.Tag;
                ProductView product = new ProductView();
                product.Amount = Convert.ToDouble(AsoStorageOutAmount.Text);
                product.ProductId = spec.Product.Id;
                product.SpecId = spec.Id;
                product.Category = spec.Product.Category.CategoryName;
                product.ProductName = spec.Product.ProductName;
                product.ProductNumber = spec.Product.ProductNumber;
                product.Barcode = spec.Barcode;
                product.Category = spec.Product.Category.CategoryName;
                product.SpecifiText = spec.SpecifiText;
                product.TaxRate = spec.Product.TaxRate;
                product.Unit = spec.Unit.DicName;
                product.UnitPrice = Convert.ToDouble(AsoStorageOutUnitPrice.Text);
                list.Add(product);
                DataGridViewManager.RebindListDataSource<ProductView>(AsoStorageOutItemDataGridView, list);
            }
            else
            {
                Toast.Show("请选择产品");
            }
        }
Ejemplo n.º 2
0
 private void ribbonMenuButton1_Click(object sender, EventArgs e)
 {
     try
     {
         Specification spec = (Specification)AsProductBarcode.Tag;
         if (spec != null)
         {
             IList<ProductView> list = (IList<ProductView>)AsStorageInItemDataGridView.Tag;
             ProductView product = new ProductView();
             product.Amount = Convert.ToDouble(AsProductAmount.Text);
             product.ProductId = spec.Id;
             product.ProductName = spec.Product.ProductName;
             product.ProductNumber = spec.Product.ProductNumber;
             product.Barcode = spec.Barcode;
             product.Category = spec.Product.Category.CategoryName;
             product.SpecifiText = spec.SpecifiText;
             product.TaxRate = spec.Product.TaxRate;
             product.Unit = spec.Unit.DicName;
             product.UnitPrice = Convert.ToDouble(AsProductUnitPrice.Text);
             list.Add(product);
             DataGridViewManager.RebindListDataSource<ProductView>(AsStorageInItemDataGridView, list);
         }
         else
         {
             Toast.Show("请选择产品");
         }
     }
     catch (Exception ex)
     {
         Toast.Show(ex.Message);
     }
 }