コード例 #1
0
 public ActionResult AddHomestay(homestay homeStay)
 {
     homeStay.detail_header_image_url = "/Content/img/Group 65.png";
     homeStay.image_url        = "/Content/img/Group 65.png";
     homeStay.more_imformation = "/Content/img/Group 65.png";
     homeStay.description      = "This is Description";
     client.AddHomestay_BE(JsonConvert.SerializeObject(homeStay));
     //context.homestays.Add(homeStay);
     //context.SaveChanges();
     return(RedirectToAction("List", "BackendHomestay", new { area = "Backend" }));
 }
コード例 #2
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     if (CheckInfo() == 1)
     {
         if (homestayNames.Contains(txtHomestayName.Text))
         {
             MessageBox.Show("Tên Homestay bị trùng");
         }
         else
         {
             homestay homestays = new homestay(int.Parse(comboBoxLocation.Text), txtHomestayName.Text, "/Content/img/Group 70.png", "/Content/img/hotel-detail.jpg", "/Content/img/Group 69.png", txtDes.Text, txtInfo.Text,
                                               int.Parse(txtPrice.Text), int.Parse(txtSellPrice.Text));
             client.AddHomestay_BE(JsonConvert.SerializeObject(homestays));
             MessageBox.Show("Thêm thành công");
             FormHomestay_Load(sender, e);
             ClearTextBox();
         }
     }
 }