Beispiel #1
0
 private void addproductbtn_Click_1(object sender, EventArgs e)
 {
     if (add_productlist.RowCount != 0)                                 //if list is not empty
     {
         string            message = "האם אתה בטוח להוסיף את המוצרים?"; //message
         string            title   = "הוספת מוצרים ";                   //title
         MessageBoxButtons buttons = MessageBoxButtons.YesNo;
         DialogResult      result  = MessageBox.Show(message, title, buttons);
         if (result == DialogResult.Yes)
         {
             foreach (Product i in productinthelist) //add to inventory
             {
                 product_data.InsertProduct(i);      //insert product
             }
             MessageBox.Show("!!המוצרים נוספו בהצלחה");
             this.Close();
         }
     }
     else//list is empty
     {
         MessageBox.Show("אין מוצרים ברשימה");
     }
 }