Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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");
        }
Example #6
0
        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);
        }
Example #7
0
        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");
        }
Example #8
0
        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);
        }
Example #9
0
 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];
     }
 }
Example #10
0
        private void EditProduct_Load(object sender, EventArgs e)
        {
            Storage_DB cDB = new Storage_DB();

            cDB.fillcombobox(cBox_Item);
        }