public void addproduct(Storage_DB sDB) { string query = String.Format("Insert into StorageInfo Values('{0}','{1}','{2}', '{3}')", sDB.Item, sDB.Manufacturer, sDB.Quantity, sDB.Price); Business_Logic BL = new Business_Logic(); BL.NonQuery(query); }
public void deleteproduct(Storage_DB sDB) { string query = String.Format("delete from StorageInfo where item = '{0}'", sDB.Item); Business_Logic BL = new Business_Logic(); BL.NonQuery(query); }
private void cBox_Item_SelectedIndexChanged(object sender, EventArgs e) { cBox_Quantity.Items.Clear(); Storage_DB sDB = new Storage_DB(); sDB.fillcomboboxquantity(cBox_Quantity, cBox_Item.Text); }
private void btn_Search_Click(object sender, EventArgs e) { Storage_DB sDB = new Storage_DB(); dataGridView1.AutoGenerateColumns = true; sDB.searchFillGrid(dataGridView1, sDB, cBox_Search.Text); }
private void btn_Delete_Click(object sender, EventArgs e) { Storage_DB cDB = new Storage_DB(); cDB.Item = cBox_Item.Text; cDB.deleteproduct(cDB); MessageBox.Show("One Product Deleted"); }
private void Store_Load(object sender, EventArgs e) { Storage_DB cDB = new Storage_DB(); dataGridView1.AutoGenerateColumns = true; cDB.FillGrid(dataGridView1); cBox_Search.Items.Add("***All***"); cDB.fillcombobox(cBox_Search); }
private void btn_Add_Click(object sender, EventArgs e) { Storage_DB cDB = new Storage_DB(); cDB.Item = cBox_Item.Text; cDB.Manufacturer = txt_Manufacturer.Text; cDB.Quantity = txt_Quantity.Text; cDB.Price = txt_Price.Text; cDB.addproduct(cDB); MessageBox.Show("New Product Added"); }
private void NewTransaction_Load(object sender, EventArgs e) { lbl_ShowDate.Text = DateTime.Now.ToString(); Storage_DB sDB = new Storage_DB(); sDB.fillcombobox(cBox_Item); CurrentTransaction_DB cTR = new CurrentTransaction_DB(); dataGridView1.AutoGenerateColumns = true; cTR.FillGrid(dataGridView1); }
public void searchFillGrid(DataGridView GV, Storage_DB sDB, String se) { if (se == "***All***") { string query = "select * from StorageInfo"; Business_Logic BBL = new Business_Logic(); DataSet ds = BBL.Adapter(query); GV.DataSource = ds.Tables[0]; } else { string query = String.Format("select * from StorageInfo where item = '{0}'", se); Business_Logic BBL = new Business_Logic(); DataSet ds = BBL.Adapter(query); GV.DataSource = ds.Tables[0]; } }
private void EditProduct_Load(object sender, EventArgs e) { Storage_DB cDB = new Storage_DB(); cDB.fillcombobox(cBox_Item); }