Esempio n. 1
0
 //Restaurant Save Button Code here.....
 protected void btnSaveRestaurant_Click(object sender, EventArgs e)
 {
     if (txtRestaurantName.Text == string.Empty || txtRestaurantInformation.Text == string.Empty)
     {
         lblRestaurant.Text = "TextBox can not be empty";
     }
     else
     {
         string     restaurantName        = txtRestaurantName.Text;
         string     restaurantInformation = txtRestaurantInformation.Text;
         int        touristSpotId         = Convert.ToInt32(ddlTouristSpotId.SelectedValue);
         Restaurant restaurant            = new Restaurant(restaurantName, restaurantInformation, touristSpotId);
         lblRestaurant.Text = restaurantManager.SaveRestaurant(restaurant);
     }
 }