Example #1
0
 private void Remove_Product_Button_Click(object sender, EventArgs e)
 {
     List<ProductInfo> id = new ProductData().GetProductInfoByName(PnameComboBox.SelectedItem.ToString());
     if (new ProductData().Delete(id[0].Id))
     {
         MessageBox.Show(@"Product Remove Successfull");
         Refresh();
         return;
     }
     MessageBox.Show(@"Product Remove Unsuccessful ");
 }
Example #2
0
 private void Update_button_Click(object sender, EventArgs e)
 {
     List<ProductInfo> id = new ProductData().GetProductInfoByName(PnameComboBox.SelectedItem.ToString());
     string price = Price_textBox.Text;
     int quan = int.Parse(Quan_textBox.Text);
     string unit = Unit_textBox.Text;
     if (new ProductData().UpdateQuan(price, id[0].Id, quan, unit))
     {
         MessageBox.Show(@"Product Update Successfull");
         return;
     }
     MessageBox.Show(@"Product Update Unsuccessful");
 }
Example #3
0
 private void Add_inventory_button_Click(object sender, EventArgs e)
 {
     if (pname_tbox.Text.Equals("") && Pprice_tbox.Text.Equals("") && Pavailable_tbox.Text.Equals(""))
     {
         return;
     }
     var product = new ProductInfo
     {
         Pname = pname_tbox.Text,
         Price = Pprice_tbox.Text,
         Quan = Int32.Parse(Pavailable_tbox.Text),
         Unit = Unit_textBox.Text
     };
     var pdata = new ProductData();
     if (pdata.Insert(product))
     {
         MessageBox.Show(@"Product Add Successfully");
     }
     else
     {
         MessageBox.Show(@"ERROR ! Try Again");
     }
 }