private void buttonSearchSupplier_Click(object sender, EventArgs e) { SearchSupplier supplier = new SearchSupplier(); supplier.ShowDialog(); if (GlobalVariables.supplierID != "" && GlobalVariables.supplierID != null) { supplierID = Convert.ToInt16(GlobalVariables.supplierID); string[] supplierDetails = filterFunc.fetchSupplierDetails(supplierID); if (supplierDetails != null) { textBoxSupplier.Text = supplierDetails[0]; formChanges = true; } /* * //select supplier info name * conn = new SqlConnection(gd.ConString); * conn.Open(); * * strSelect = "SELECT Company_Name from SUPPLIER where Supplier_ID = @supplierID"; * cmd = new SqlCommand(strSelect, conn); * cmd.Parameters.Add(new SqlParameter("supplierID", (object)supplierID)); * textBoxSupplier.Text = Convert.ToString(cmd.ExecuteScalar());*/ GlobalVariables.supplierID = ""; } else { GlobalVariables.supplierID = ""; } }
private void buttonSearchSupplier_Click(object sender, EventArgs e) { SearchSupplier supplier = new SearchSupplier(); supplier.ShowDialog(); if (GlobalVariables.supplierID != "" && GlobalVariables.supplierID != null) { supplierID = Convert.ToInt16(GlobalVariables.supplierID); string[] supplierDetails = filterFunc.fetchSupplierDetails(supplierID); if (supplierDetails != null) { textBoxSupplier.Text = supplierDetails[0]; formChanges = true; } /* //select supplier info name conn = new SqlConnection(gd.ConString); conn.Open(); strSelect = "SELECT Company_Name from SUPPLIER where Supplier_ID = @supplierID"; cmd = new SqlCommand(strSelect, conn); cmd.Parameters.Add(new SqlParameter("supplierID", (object)supplierID)); textBoxSupplier.Text = Convert.ToString(cmd.ExecuteScalar());*/ GlobalVariables.supplierID = ""; } else { GlobalVariables.supplierID = ""; } }