private void button4_Click(object sender, EventArgs e) { SearchProduct spf = new SearchProduct(); //spf.MdiParent = this.MdiParent; spf.ShowDialog(); if (GlobalVariables.productID != "" && GlobalVariables.productID != null) { productID = Convert.ToInt16(GlobalVariables.productID); GlobalVariables.productID = ""; //display product information to the input boxes conn = new SqlConnection(gd.ConString); conn.Open(); strSelect = "SELECT Product_Name, Model, Brand, Special_Feature, Description, Unit, Size, " + "Color, Sub_Category_Name, Category_Name FROM View_Product_List where ID = @productID"; cmd = new SqlCommand(strSelect, conn); cmd.Parameters.Add(new SqlParameter("productID", (object)productID)); dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { textBoxProductName.Text = dr["Product_Name"].ToString(); textBoxModel.Text = dr["Model"].ToString(); textBoxBrand.Text = dr["Brand"].ToString(); textBoxSpecialFeature.Text = dr["Special_Feature"].ToString(); textBoxDescription.Text = dr["Description"].ToString(); textBoxUnit.Text = dr["Unit"].ToString(); textBoxSize.Text = dr["Size"].ToString(); textBoxColor.Text = dr["Color"].ToString(); textBoxSubCategory.Text = dr["Sub_Category_Name"].ToString(); textBoxCategory.Text = dr["Category_Name"].ToString(); formChanges = true; } dr.Close(); } conn.Close(); } else { GlobalVariables.productID = ""; } }
private void button4_Click(object sender, EventArgs e) { SearchProduct spf = new SearchProduct(); //spf.MdiParent = this.MdiParent; spf.ShowDialog(); if (GlobalVariables.productID != "" && GlobalVariables.productID != null) { productID = Convert.ToInt16(GlobalVariables.productID); //display product information to the input boxes conn = new SqlConnection(gd.ConString); conn.Open(); strSelect = "SELECT Product_Name, Model, Brand, Special_Feature, Description, Unit, Size, " + "Color, Sub_Category_name, Category FROM View_Product_List where ID = @productID"; cmd = new SqlCommand(strSelect, conn); cmd.Parameters.Add(new SqlParameter("productID", (object)productID)); dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { } dr.Close(); } MessageBox.Show(Convert.ToString(productID)); conn.Close(); GlobalVariables.productID = ""; } else { GlobalVariables.productID = ""; } }
private void buttonSearchProduct_Click(object sender, EventArgs e) { string[] productInformation; SearchProduct search = new SearchProduct(); search.ShowDialog(); if (GlobalVariables.productID != "" && GlobalVariables.productID != null) { //display product information productId = Convert.ToInt16(GlobalVariables.productID); GlobalVariables.productID = ""; productInformation = filter.fetchProductInformation(productId); if (productInformation != null) { textBoxProductName.Text = productInformation[1]; textBoxModel.Text = productInformation[2]; textBoxDescription.Text = productInformation[3]; textBoxBrand.Text = productInformation[4]; textBoxUnit.Text = productInformation[5]; textBoxSize.Text = productInformation[6]; textBoxColor.Text = productInformation[7]; textBoxCategory.Text = productInformation[8]; textBoxSubCategory.Text = productInformation[9]; textBoxSpecialFeature.Text = productInformation[10]; textBoxQuantityOnHand.Text = productInformation[11]; //display current quantity on warehouse textBoxCurrentQuantity.Text = Convert.ToString(filter.fetchCurrentQuantityOnWarehouse(comboBoxWarehouse.SelectedItem.ToString(), productId)); } } else { GlobalVariables.productID = ""; } }
private void buttonSearchProduct_Click(object sender, EventArgs e) { string[] productInformation; SearchProduct searchProd = new SearchProduct(); searchProd.ShowDialog(); if (GlobalVariables.productID != "" && GlobalVariables.productID != null) { //display product information productId = Convert.ToInt16(GlobalVariables.productID); GlobalVariables.productID = ""; productInformation = filterFunc.fetchProductInformation(productId); if (productInformation != null) { textBoxProductName.Text = productInformation[1]; textBoxModel.Text = productInformation[2]; textBoxDescription.Text = productInformation[3]; textBoxBrand.Text = productInformation[4]; textBoxUnit.Text = productInformation[5]; textBoxSize.Text = productInformation[6]; textBoxColor.Text = productInformation[7]; textBoxCategory.Text = productInformation[8]; textBoxSubCategory.Text = productInformation[9]; textBoxSpecialFeature.Text = productInformation[10]; textBoxCurrentQuantity.Text = productInformation[11]; formChanges = true; } } }