Example #1
0
        private void modifyProductToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            CloseActiveChildForms();

            ModifyProduct modifyProduct = new ModifyProduct();

            modifyProduct.MdiParent = this;
            modifyProduct.Show();
        }
        private void btnEditSelectedProduct_Click(object sender, RoutedEventArgs e)
        {
            ModifyProduct mod = new ModifyProduct();
            Product       p   = (Product)lvProductList.Items.GetItemAt(selectedProductIndex);

            mod.lblProductIdEdit.Content = p.ProductId;
            mod.tbProductNameEdit.Text   = p.ProductName;
            mod.tbCategoryEdit.Text      = p.Category;
            mod.tbDescriptionEdit.Text   = p.Description;
            mod.tbPriceEdit.Text         = p.Price.ToString();
            mod.tbSCUEdit.Text           = p.SCU.ToString();
            mod.tbQuantityEdit.Text      = p.Quantity.ToString();
            mod.tbLocationEdit.Text      = p.Location;
            mod.tbSupplierEdit.Text      = p.SupplierName;
            mod.Show();
        }