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; }
private void button1_Click(object sender, EventArgs e) { TblProduct p = new TblProduct() { Description = "product a", Price = 1.99M }; products.Add(p); }
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; }
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"); }
private void DeleteItem(object sender, EventArgs e) { TblProduct selectedProduct = (TblProduct)listProductsChosen.SelectedItem; products.Remove(selectedProduct); }