コード例 #1
0
ファイル: ManageDishPage.cs プロジェクト: AsafLar/SadotWinery
 //method wich works when the user press on "הוסף מרכיב" button
 //the method will add new ingredient in to the data base and refresh the ingredient list
 private void btnAddIngredient_Click(object sender, EventArgs e)
 {
     if (Checks.IsEmptyString(txtIngredientName.Text))
     {
         MessageBox.Show("הכנס שם מרכיב להוספה");
     }
     else
     {
         if (Checks.IsStringContainNumbers(txtIngredientName.Text))
         {
             MessageBox.Show("שם מרכיב לא יכול להכיל מספרים");
         }
         else
         {
             if (db.IsIngredientShow(txtIngredientName.Text))
             {
                 MessageBox.Show("מרכיב עם השם הזה כבר קיים ברשימת המרכיבים!");
             }
             else
             {
                 db.InsertNewIngredient(txtIngredientName.Text);
                 FillIngredientsList();
                 MessageBox.Show("המרכיב התווסף בהצלחה!");
             }
         }
     }
 }