Esempio n. 1
0
 public static bool 添加酒店(酒店 content)
 {
     return Mongo.添加(content);
 }
Esempio n. 2
0
 public static bool 更新酒店(酒店 content)
 {
     return Mongo.更新(content);
 }
 public ActionResult AddHotel(酒店 hotel)
 {
     if (!string.IsNullOrEmpty(Request.Form["attachtext"]))
     {
         var a = Request.Form["attachtext"];
         var f = a.Substring(0, a.Length - 1).Split('|');
         foreach (var k in f)
         {
             hotel.酒店基本信息.照片.Add(k);
         }
     }
     if (!string.IsNullOrEmpty(Request.Form["localtion"]))
     {
         var b = Request.Form["localtion"];
         var c = b.Split(',');
         hotel.酒店基本信息.地理位置 = new double[] { double.Parse(c[0]), double.Parse(c[1]) };
     }
     hotel.所属供应商.用户ID = currentUser.Id;
     hotel.审核数据.审核状态 = 审核状态.未审核;
     酒店管理.添加酒店(hotel);
     return RedirectToAction("Hotellist");
 }
 public ActionResult EditHotel(酒店 ht)
 {
     IEnumerable<酒店> hotel = 酒店管理.查询酒店(0, 0, Query.EQ("所属供应商.用户ID", currentUser.Id));
     酒店 h = new 酒店();
     if (hotel != null && hotel.Any())
     {
         foreach (var k in hotel)
         {
             h = k;
         }
     }
     if (!string.IsNullOrEmpty(Request.Form["attachtext"]))
     {
         var a = Request.Form["attachtext"];
         var f = a.Substring(0, a.Length - 1).Split('|');
         foreach (var k in f)
         {
             h.酒店基本信息.照片.Add(k);
         }
     }
     if (!string.IsNullOrEmpty(Request.Form["localtion"]))
     {
         var b = Request.Form["localtion"];
         var c = b.Split(',');
         h.酒店基本信息.地理位置 = new double[] { double.Parse(c[0]), double.Parse(c[1]) };
     }
     h.酒店基本信息.Wifi = ht.酒店基本信息.Wifi;
     h.酒店基本信息.地址 = ht.酒店基本信息.地址;
     h.酒店基本信息.简介 = ht.酒店基本信息.简介;
     h.酒店基本信息.交通信息 = ht.酒店基本信息.交通信息;
     h.酒店基本信息.酒店名 = ht.酒店基本信息.酒店名;
     h.酒店基本信息.联系电话 = ht.酒店基本信息.联系电话;
     h.酒店基本信息.所属地域 = ht.酒店基本信息.所属地域;
     h.酒店基本信息.所属商圈 = ht.酒店基本信息.所属商圈;
     h.酒店基本信息.免费停车场 = ht.酒店基本信息.免费停车场;
     h.酒店基本信息.入住和离店时间 = ht.酒店基本信息.入住和离店时间;
     h.酒店设施 = ht.酒店设施;
     h.酒店服务 = ht.酒店服务;
     h.审核数据.审核状态 = 审核状态.未审核;
     if (hotel != null && hotel.Any())
     {
         酒店管理.更新酒店(h);
     }
     else
     {
         h.所属供应商.用户ID = currentUser.Id;
         酒店管理.添加酒店(h);
     }
     return RedirectToAction("HotelEdit");
 }
 public ActionResult DelRoom()
 {
     IEnumerable<酒店> k = 酒店管理.查询酒店(0, 0, Query.EQ("所属供应商.用户ID", currentUser.Id));
     酒店 h = new 酒店();
     foreach (var p in k)
     {
         h = p;
     }
     string index = Request.Params["index"];
     h.房间信息.RemoveAt(int.Parse(index));
     酒店管理.更新酒店(h);
     return RedirectToAction("Roomlist");
 }
 public void DelRoomImg()
 {
     string v = Request.Params["index"];
     var g = v.Split('|');
     IEnumerable<酒店> hotel = 酒店管理.查询酒店(0, 0, Query.EQ("所属供应商.用户ID", currentUser.Id));
     酒店 h = new 酒店();
     foreach (var p in hotel)
     {
         h = p;
     }
     h.房间信息[int.Parse(g[0])].图片.RemoveAt(int.Parse(g[1]));
     酒店管理.更新酒店(h);
 }
 public ActionResult EditRoom(Room ht)
 {
     int index = (int)ht.Id;
     string roompic = Request.Form["attachtext"];
     IEnumerable<酒店> h = 酒店管理.查询酒店(0, 0, Query.EQ("所属供应商.用户ID", currentUser.Id));
     酒店 hotel = new 酒店();
     foreach (var p in h)
     {
         hotel = p;
     }
     if (!string.IsNullOrEmpty(roompic))
     {
         var f = roompic.Substring(0, roompic.Length - 1).Split('|');
         foreach (var k in f)
         {
             hotel.房间信息[index].图片.Add(k);
         }
     }
     hotel.房间信息[index].房型 = ht.房型;
     hotel.房间信息[index].价格 = ht.价格;
     hotel.房间信息[index].床型 = ht.床型;
     hotel.房间信息[index].早餐 = ht.早餐;
     hotel.房间信息[index].简介 = ht.简介;
     hotel.房间信息[index].房间设施.吹风机 = ht.房间设施.吹风机;
     hotel.房间信息[index].房间设施.二十四小时热水 = ht.房间设施.二十四小时热水;
     hotel.房间信息[index].房间设施.国际长途通话 = ht.房间设施.国际长途通话;
     hotel.房间信息[index].房间设施.空调 = ht.房间设施.空调;
     hotel.房间信息[index].房间设施.宽带上网 = ht.房间设施.宽带上网;
     hotel.房间信息[index].房间设施.免费国内长途通话 = ht.房间设施.免费国内长途通话;
     hotel.房间信息[index].房间设施.免费市内电话 = ht.房间设施.免费市内电话;
     hotel.房间信息[index].房间设施.暖气 = ht.房间设施.暖气;
     酒店管理.更新酒店(hotel);
     return RedirectToAction("Roomlist");
 }
 public ActionResult AddRoom(Room h)
 {
     IEnumerable<酒店> hotel = 酒店管理.查询酒店(0, 0, Query.EQ("所属供应商.用户ID", currentUser.Id));
     酒店 ht = new 酒店();
     foreach (var k in hotel)
     {
         ht = k;
     }
     if (!string.IsNullOrEmpty(Request.Form["attachtext"]))
     {
         var a = Request.Form["attachtext"];
         var f = a.Substring(0, a.Length - 1).Split('|');
         foreach (var k in f)
         {
             h.图片.Add(k);
         }
     }
     酒店._房间信息 m = new 酒店._房间信息();
     m.房型 = h.房型;
     m.床型 = h.床型;
     m.房间设施.吹风机 = h.房间设施.吹风机;
     m.房间设施.二十四小时热水 = h.房间设施.二十四小时热水;
     m.房间设施.国际长途通话 = h.房间设施.国际长途通话;
     m.房间设施.空调 = h.房间设施.空调;
     m.房间设施.宽带上网 = h.房间设施.宽带上网;
     m.房间设施.免费国内长途通话 = h.房间设施.免费国内长途通话;
     m.房间设施.免费市内电话 = h.房间设施.免费市内电话;
     m.房间设施.暖气 = h.房间设施.暖气;
     m.价格 = h.价格;
     m.简介 = h.简介;
     m.图片 = h.图片;
     m.早餐 = h.早餐;
     ht.房间信息.Add(m);
     酒店管理.更新酒店(ht);
     return RedirectToAction("Roomlist");
 }
 public ActionResult HotelEdit()
 {
     IEnumerable<酒店> hotel = 酒店管理.查询酒店(0, 0, Query.EQ("所属供应商.用户ID", currentUser.Id));
     酒店 h = new 酒店();
     foreach (var k in hotel)
     {
         h = k;
     }
     return View(h);
 }
Esempio n. 10
0
        public ActionResult Part_SearchByPage()
        {
            int page = 1;
            int.TryParse(Request.Params["page"], out page);

            IEnumerable<酒店> hotel = 酒店管理.查询酒店(0, 0, Query.EQ("所属供应商.用户ID", currentUser.Id));
            酒店 g = new 酒店();
            foreach (var k in hotel)
            {
                g = k;
            }

            int listcount = g.房间信息.Count;
            int maxpage = Math.Max((listcount + 15 - 1) / 15, 1);

            ViewData["currentpage"] = page;
            ViewData["pagecount"] = maxpage;

            ViewData["房间列表"] = g;
            return PartialView("Gys_Part/Part_SearchByPage");
        }
Esempio n. 11
0
        public ActionResult Part_Hotellist()
        {
            IEnumerable<酒店> hotel = 酒店管理.查询酒店(0, 0, Query.EQ("所属供应商.用户ID", currentUser.Id));
            酒店 g = new 酒店();
            foreach (var k in hotel)
            {
                g = k;
            }
            if (g.所属供应商.用户数据 == null)
            {
                return Content("<script>alert('请先添加酒店信息!');window.location.href='/供应商后台/HotelEdit'</script>");
            }
            long listcount = g.房间信息.Count;
            long maxpagesize = Math.Max((listcount + 15 - 1) / 15, 1);//15,每页显示15条记录

            int page = 1;
            ViewData["currentpage"] = page;
            ViewData["pagecount"] = maxpagesize;
            ViewData["房间列表"] = g;

            return PartialView("Gys_Part/Part_Hotellist");
        }