Beispiel #1
0
 private void TrVwInvoice_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (int)Keys.Enter && TrVwInvoice.SelectedNode != null)
     {
         int         index   = TrVwInvoice.SelectedNode.Index;
         QuntityForm addForm = new QuntityForm(ProductList[index]);
         addForm.ShowDialog();
         if (addForm.DialogResult == DialogResult.OK)
         {
             TrVwInvoice.SelectedNode.Text = addForm.CurrentProduct.Quantity + " - " + addForm.CurrentProduct.Price + " - " + addForm.CurrentProduct.Name;
             ProductList[index].Name       = addForm.CurrentProduct.Name;
             ProductList[index].Quantity   = addForm.CurrentProduct.Quantity;
             ProductList[index].Price      = addForm.CurrentProduct.Price;
             TxtBxQuant.Text    = addForm.CurrentProduct.Quantity;
             TxtBxGoodName.Text = addForm.CurrentProduct.Name;
             TxtBxPrice.Text    = addForm.CurrentProduct.Price;
         }
     }
 }
Beispiel #2
0
        private void GetProductByBarCode(string barCode)
        {
            Product     curProd      = new Product(Helper.GetProductByBarCode(Form1.ProductsList, barCode));
            bool        isNewProduct = curProd.Name == string.Empty ? true : false;
            QuntityForm addForm      = new QuntityForm(curProd);

            addForm.ShowDialog();
            if (addForm.DialogResult == DialogResult.OK)
            {
                TreeViewAdd(addForm.CurrentProduct.Quantity, addForm.CurrentProduct.Price, addForm.CurrentProduct.Name);
                curProd.Name     = addForm.CurrentProduct.Name;
                curProd.Quantity = addForm.CurrentProduct.Quantity;
                curProd.Price    = addForm.CurrentProduct.Price;
                if (isNewProduct)
                {
                    Form1.ProductsList.Add(curProd);
                }
                ProductList.Add(curProd);
                LblInvSumValue.Text = Helper.InvoiceSummCount(ProductList).ToString();
                TxtBxQuant.Text     = addForm.CurrentProduct.Quantity;
                TxtBxGoodName.Text  = addForm.CurrentProduct.Name;
                TxtBxPrice.Text     = addForm.CurrentProduct.Price;
            }
        }