Exemple #1
0
 public ActionResult AddHotel(hotel hotel)
 {
     hotel.image_url = "/Content/img/Group 68.png";
     hotel.detail_header_image_url    = "/Content/img/hotel-detail.jpg";
     hotel.more_imformation_image_url = "/Content/img/Group 71.png";
     client.AddHotel_BE(JsonConvert.SerializeObject(hotel));
     //context.hotels.Add(hotel);
     //context.SaveChanges();
     return(RedirectToAction("List", "BackendHotel", new { area = "Backend" }));
 }
Exemple #2
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     if (CheckInfo() == 1)
     {
         if (hotelNames.Contains(txtHotelName.Text))
         {
             MessageBox.Show("Tên Hotel bị trùng");
         }
         else
         {
             hotel hotels = new hotel(int.Parse(comboBoxLocation.Text), txtHotelName.Text, "/Content/img/Group 70.png", "/Content/img/hotel-detail.jpg", "/Content/img/Group 68.png", txtDes.Text, txtInfo.Text,
                                      int.Parse(txtPrice.Text), int.Parse(txtSellPrice.Text));
             client.AddHotel_BE(JsonConvert.SerializeObject(hotels));
             MessageBox.Show("Thêm thành công");
             FormHotel_Load(sender, e);
             ClearTextBox();
         }
     }
 }