Ejemplo n.º 1
0
        public void OnModify_Click(object sender, RoutedEventArgs e)
        {
            DataRowView rowView = (DataRowView)inventoryItems.SelectedItem;

            if (rowView != null)
            {
                string itemValue = rowView["SKU"].ToString();
                openItemData = DataAccess.GetSpecificItem(itemValue);
            }
            else
            {
                MessageBox.Show("Please click on item you want to modify");
                return;
            }

            AddNewProduct modifyProduct = new AddNewProduct();

            modifyProduct.modify              = true;
            modifyProduct.CategoryBox.Text    = openItemData.Tables[0].Rows[0]["Category"].ToString();
            modifyProduct.SKUBox.Text         = openItemData.Tables[0].Rows[0]["SKU"].ToString();
            modifyProduct.DescriptionBox.Text = openItemData.Tables[0].Rows[0]["Description"].ToString();
            modifyProduct.PriceBox.Text       = openItemData.Tables[0].Rows[0]["Price"].ToString();
            modifyProduct.QuantityBox.Text    = openItemData.Tables[0].Rows[0]["Quantity"].ToString();
            modifyProduct.CostBox.Text        = openItemData.Tables[0].Rows[0]["Cost"].ToString();
            modifyProduct.Show();
            modifyProduct.Closed += AddProduct_Closed;
        }
Ejemplo n.º 2
0
        public void OnNew_Click(object sender, RoutedEventArgs e)
        {
            AddNewProduct addProduct = new AddNewProduct();

            addProduct.modify = false;
            addProduct.Show();
            addProduct.Closed += AddProduct_Closed;
        }