Exemplo n.º 1
0
 private void editStockBttn_Click(object sender, EventArgs e)
 {
     if (stocksEditNameTbx.Text == "Name" || stocksEditNameTbx.Text == "")
     {
         MessageBox.Show("Please enter a valid stock name");
         return;
     }
     if (pricePerItemTbx.Value == 0)
     {
         MessageBox.Show("Please enter a valid stock price");
         return;
     }
     if (storeQuantityStock.Value == 0 && depoQuantityStock.Value == 0)
     {
         MessageBox.Show("Please enter a valid stock quantity");
         return;
     }
     if (MessageBox.Show("Do you really want to edit that stock?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         Stock.EditStock(this.id, stocksEditNameTbx.Text, pricePerItemTbx.Value, storeQuantityStock.Value, depoQuantityStock.Value);
         this.Hide();
     }
 }
Exemplo n.º 2
0
 private void editStockBttn_Click(object sender, EventArgs e)
 {
     Stock.EditStock(this.id, stocksEditNameTbx.Text, pricePerItemTbx.Value, storeQuantityStock.Value, depoQuantityStock.Value);
     this.Hide();
 }