/* void supplierIDTextBox_TextChanged(object sender, EventArgs e) { sciencedbDataSet.SupplierTableDataTable table = supplierTableTableAdapter1.GetData(); //supAdtr.GetData(); items = new Dictionary<int, string>(); /* supplierNames.Items.Clear(); items.Add(supplierNames.Items.Count, ""); supplierNames.Items.Add(""); //Add New here for default supplierNames.SelectedItem = ""; */ /* foreach (DataRow row in table.Rows) { string supplierName = row["SupplierName"].ToString(); string supplierID = row["ID"].ToString(); int intsuppid = Convert.ToInt32(supplierID, 10); //Should only add each/one supplier for this item. //items.Add(supplierNames.Items.Count, supplierName); items.Add(intsuppid, supplierName); // supplierNames.Items.Add(supplierName); if (supplierID == supplierIDTextBox.Text) { label1.Text = string.Empty; label1.Text = row["Quantity"].ToString(); supplyCost.Text = "$" + row["Cost"].ToString(); suppnamelbl.Text = string.Empty; suppnamelbl.Text = row["SupplierName"].ToString(); if (!string.IsNullOrEmpty(row["LastPurchase"].ToString())) { DateTime lDate = (DateTime)row["LastPurchase"]; supplyDate.Text = lDate.ToString("d"); } else supplyDate.Text = string.Empty; supplierNames.SelectedItem = supplierName; } } } */ public void updatePicture_Click(object sender, EventArgs e) { Form updatepics = new updatepics(stockItemId); updatepics.Show(); }
/* void supplierIDTextBox_TextChanged(object sender, EventArgs e) * { * sciencedbDataSet.SupplierTableDataTable table = supplierTableTableAdapter1.GetData(); //supAdtr.GetData(); * * * items = new Dictionary<int, string>(); * /* * supplierNames.Items.Clear(); * items.Add(supplierNames.Items.Count, ""); * supplierNames.Items.Add(""); //Add New here for default * supplierNames.SelectedItem = ""; */ /* foreach (DataRow row in table.Rows) * { * string supplierName = row["SupplierName"].ToString(); * string supplierID = row["ID"].ToString(); * int intsuppid = Convert.ToInt32(supplierID, 10); * * //Should only add each/one supplier for this item. * //items.Add(supplierNames.Items.Count, supplierName); * * items.Add(intsuppid, supplierName); * // supplierNames.Items.Add(supplierName); * * if (supplierID == supplierIDTextBox.Text) * { * * label1.Text = string.Empty; * label1.Text = row["Quantity"].ToString(); * supplyCost.Text = "$" + row["Cost"].ToString(); * suppnamelbl.Text = string.Empty; * suppnamelbl.Text = row["SupplierName"].ToString(); * if (!string.IsNullOrEmpty(row["LastPurchase"].ToString())) * { * DateTime lDate = (DateTime)row["LastPurchase"]; * supplyDate.Text = lDate.ToString("d"); * } * else * supplyDate.Text = string.Empty; * supplierNames.SelectedItem = supplierName; * } * * } * } */ public void updatePicture_Click(object sender, EventArgs e) { Form updatepics = new updatepics(stockItemId); updatepics.Show(); }