예제 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (foodNameTextBox.Text == "" || priceTextBox.Text == "" || statusTextBox.Text == "")
     {
         MessageBox.Show("Fill up the required from");
     }
     else
     {
         MenuService menuService = new MenuService();
         int         result      = menuService.AddFood(foodNameTextBox.Text, priceTextBox.Text, statusTextBox.Text, categoryName_ComboBox.Text);
         if (result > 0)
         {
             MessageBox.Show("Added Successfully");
             this.Refresh(this, null);
             this.Clear(this, null);
         }
         else
         {
             MessageBox.Show("Error occur!");
         }
     }
 }