Esempio n. 1
0
        private void UpdateCustomerInformationPanel(TblProduct product)
        {
            string currentDescription       = product.Description;
            string currentPrice             = String.Format("{0:c}", product.Price);
            string currentDescriptionPadded = currentDescription.PadRight(10);

            txtInfoPanel.Text = currentDescriptionPadded + currentPrice;
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            TblProduct p = new TblProduct()
            {
                Description = "product a",
                Price       = 1.99M
            };

            products.Add(p);
        }
Esempio n. 3
0
        private void UpdateProductList(object sender, EventArgs e)
        {
            Button b = (Button)sender;

            TblProduct p = (TblProduct)b.Tag;

            products.Add(p);

            UpdateCustomerInformationPanel(p);

            TransactionTotal += (decimal)p.Price;

            listProductsChosen.SelectedIndex = listProductsChosen.Items.Count - 1;
        }
Esempio n. 4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            TblProduct product = new TblProduct();

            product.Description = txtDescription.Text;

            product.Price = decimal.Parse(txtPrice.Text);

            product.Image = byteBLOBData;

            product.ProductType = (int)boxCategory.SelectedValue;

            cse.TblProducts.Add(product);
            cse.SaveChanges();

            MessageBox.Show("Record Save");
        }
Esempio n. 5
0
        private void DeleteItem(object sender, EventArgs e)
        {
            TblProduct selectedProduct = (TblProduct)listProductsChosen.SelectedItem;

            products.Remove(selectedProduct);
        }