예제 #1
0
        public ActionResult Detail()
        {
            string key           = HotelCloud.Common.HCRequest.GetString("key");
            string hotelweixinId = key.Split('@')[0];
            string userweixinId  = key.Split('@')[1];

            int hid       = Convert.ToInt32(RouteData.Values["Id"]);
            int meetingId = Convert.ToInt32(HCRequest.GetString("meetingId"));


            var dbMeeting = Meeting.GeteMeeting(hid, meetingId);
            var meeting   = DataTableToEntity.GetEntity <Meeting>(dbMeeting);

            meeting.listMeetingTypeCapacity = new List <MeetingTypeCapacity>();
            if (!string.IsNullOrEmpty(meeting.TypeAndHoldInfo) && meeting.TypeAndHoldInfo.Contains("{"))
            {
                meeting.listMeetingTypeCapacity = Newtonsoft.Json.JsonConvert.DeserializeObject <List <MeetingTypeCapacity> >(meeting.TypeAndHoldInfo);
            }


            ViewData["meeting"] = meeting;


            var date = Convert.ToDateTime(Request.QueryString["date"]);
            List <MeetingRates> rateList = new List <MeetingRates>();

            if (meeting.PayType == 0)
            {
                DataTable dbRates = MeetingRates.GeteMeetingRatesList(hid, meetingId, date);
                rateList = DataTableToEntity.GetEntities <MeetingRates>(dbRates).ToList();
            }
            ViewData["rateList"] = rateList;

            DataTable db_pics = Meeting.GetMeetingPics(hid);
            var       picList = DataTableToEntity.GetEntities <RoomTypeImgEntity>(db_pics);

            picList             = picList.Where(c => c.RoomId == meetingId).ToList();
            ViewData["picList"] = picList;



            string MemberCardRuleJson = ActionController.getMemberCardIntegralRule(userweixinId, hotelweixinId);

            ViewData["MemberCardRuleJson"] = MemberCardRuleJson;
            Hashtable MemberCardRuleJsonobj = Newtonsoft.Json.JsonConvert.DeserializeObject <Hashtable>(MemberCardRuleJson);
            Hashtable ruletable             = Newtonsoft.Json.JsonConvert.DeserializeObject <Hashtable>(MemberCardRuleJsonobj["rule"].ToString());
            double    graderate             = WeiXinPublic.ConvertHelper.ToDouble(ruletable["GradeRate"]);

            ViewData["graderate"] = graderate;

            Hotel hotel = HotelHelper.GetMainIndexHotel(hid);

            ViewData["hotelName"] = hotel.SubName;

            return(View());
        }
예제 #2
0
        public ActionResult FeedbackService(string id)
        {
            Hotel  hotel           = new Hotel();
            string cache_hotelName = string.Format("{0}_{1}", id, "mainindex");

            if (cache[cache_hotelName] != null)
            {
                hotel = (Hotel)cache[cache_hotelName];
            }
            else
            {
                hotel = HotelHelper.GetMainIndexHotel(Convert.ToInt32(id));
                cache.Insert(cache_hotelName, hotel, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
            }

            ViewData["hotel"] = hotel.SubName;
            return(View());
        }
예제 #3
0
        public ActionResult Index(string id)
        {
            string userWeiXinID = HotelCloud.Common.HCRequest.GetString("key");

            if (!userWeiXinID.Equals(""))
            {
                hotel3g.Models.Cookies.SetCookies("userWeixinNO", userWeiXinID.Split('@')[1], 30, userWeiXinID.Split('@')[0]);
            }
            string weixinID = HotelCloud.Common.HCRequest.GetString("weixinID");

            if (weixinID.Equals(""))
            {
                weixinID = userWeiXinID.Split('@')[0];
            }
            //int hotelId=HotelCloud.Common.HCRequest.getInt("hId");

            IList <Advertisement> list = new List <Advertisement>();

            string cacheName = string.Format("{0}_{1}", weixinID, "mainindex");

            if (cache[cacheName] != null)
            {
                list = (List <Advertisement>)cache[cacheName];
            }

            else
            {
                list = Advertisement.GetAdvertisementBySort(weixinID);
                cache.Insert(cacheName, list, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
            }


            if (list != null && list.Count == 0)
            {
                //创建虚拟
                string[] imgs       = { "/img/ad_01.jpg", "/img/ad_02.jpg", "/img/ad_03.jpg", "/img/ad_04.jpg", "/img/ad_05.jpg" };
                string   imgwebsite = System.Configuration.ConfigurationManager.AppSettings["imgwebsite"] == null ? "http://admin.weikeniu.com" : System.Configuration.ConfigurationManager.AppSettings["imgwebsite"].ToString();
                foreach (string str in imgs)
                {
                    Advertisement ad = new Advertisement();
                    ad.ImageUrl = imgwebsite + str;
                    list.Add(ad);
                }
            }
            ViewData["ad"]           = list;
            ViewData["hId"]          = id;
            ViewData["weixinID"]     = weixinID;
            ViewData["userWeiXinID"] = hotel3g.Models.Cookies.GetCookies("userWeixinNO", weixinID);

            Hotel  hotel           = new Hotel();
            string cache_hotelName = string.Format("{0}_{1}", id, "mainindex");

            if (cache[cache_hotelName] != null)
            {
                hotel = (Hotel)cache[cache_hotelName];
            }
            else
            {
                hotel = HotelHelper.GetMainIndexHotel(Convert.ToInt32(id));
                cache.Insert(cache_hotelName, hotel, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
            }

            ViewData["hotel"]    = hotel.SubName;
            ViewData["quanjing"] = hotel.Quanjing;
            ViewData["tel"]      = hotel.Tel;


            string sql    = @"select  userid   from  WeiXinNO with(nolock)  where weixinid=@weixinid ";
            string userId = HotelCloud.SqlServer.SQLHelper.Get_Value(sql, HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> {
                { "weixinid", new HotelCloud.SqlServer.DBParam {
                      ParamValue = weixinID
                  } }
            });

            ViewData["userId"] = userId;



            return(View());
        }
예제 #4
0
        public ActionResult MainTravel(string id)
        {
            string userWeiXinID = HotelCloud.Common.HCRequest.GetString("key");

            if (!userWeiXinID.Equals(""))
            {
                hotel3g.Models.Cookies.SetCookies("userWeixinNO", userWeiXinID.Split('@')[1], 30, userWeiXinID.Split('@')[0]);
            }
            string weixinID = HotelCloud.Common.HCRequest.GetString("weixinID");

            if (weixinID.Equals(""))
            {
                weixinID = userWeiXinID.Split('@')[0];
            }
            //int hotelId=HotelCloud.Common.HCRequest.getInt("hId");

            IList <Advertisement> list = new List <Advertisement>();

            string cacheName = string.Format("{0}_{1}", weixinID, "mainindex");

            if (cache[cacheName] != null)
            {
                list = (List <Advertisement>)cache[cacheName];
            }

            else
            {
                list = Advertisement.GetAdvertisementBySort(weixinID, 0);
                cache.Insert(cacheName, list, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
            }


            if (list != null && list.Count == 0)
            {
                //创建虚拟
                string[] imgs       = { "/img/ad_01.jpg", "/img/ad_02.jpg", "/img/ad_03.jpg", "/img/ad_04.jpg", "/img/ad_05.jpg" };
                string   imgwebsite = System.Configuration.ConfigurationManager.AppSettings["imgwebsite"] == null ? "http://admin.weikeniu.com" : System.Configuration.ConfigurationManager.AppSettings["imgwebsite"].ToString();
                foreach (string str in imgs)
                {
                    Advertisement ad = new Advertisement();
                    ad.ImageUrl = imgwebsite + str;
                    list.Add(ad);
                }
            }
            ViewData["ad"]           = list;
            ViewData["hId"]          = id;
            ViewData["weixinID"]     = weixinID;
            ViewData["userWeiXinID"] = hotel3g.Models.Cookies.GetCookies("userWeixinNO", weixinID);

            Hotel  hotel           = new Hotel();
            string cache_hotelName = string.Format("{0}_{1}", id, "mainindex");

            if (cache[cache_hotelName] != null)
            {
                hotel = (Hotel)cache[cache_hotelName];
            }
            else
            {
                hotel = HotelHelper.GetMainIndexHotel(Convert.ToInt32(id));
                cache.Insert(cache_hotelName, hotel, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
            }

            ViewData["hotel"]    = hotel.SubName;
            ViewData["quanjing"] = hotel.Quanjing;


            bool IsBranch = hotel3g.Models.DAL.BranchHelper.IsBranch(weixinID);

            ViewData["IsBranch"] = IsBranch;



            string sql = "select weixinName from WeiXinNO with (nolock) where weixinId=@weixinId  ";

            ViewData["weixinname"] = SQLHelper.Get_Value(sql, SQLHelper.GetCon(), new Dictionary <string, DBParam>()
            {
                { "weixinId", new DBParam()
                  {
                      ParamValue = weixinID
                  } },
            });


            //读取模板style 0:默认 1:简约(Simple) 2:多彩(Colourful)
            //  hotel3g.Repository.WeiXinAppConfig Config = hotel3g.Repository.MemberHelper.GetHotelAppConfig(weixinID);


            //if (Config.style > 0)
            //{
            //    //菜单栏
            //    List<MenuDictionaryResponse> MenuBarList = hotel3g.Models.MenuBarHelper.MenuBarList(Config.style, weixinID, hotel.Quanjing);

            //    ViewData["MenuBarList"] = MenuBarList;

            //    hotel = HotelHelper.GetMainIndexHotel(Convert.ToInt32(id));
            //    ViewData["HotelInfo"] = hotel;
            //}


            //if (!string.IsNullOrEmpty(hotel.MainPic))
            //{
            //    switch (Config.style)
            //    {
            //        case 0: return View();
            //        case 1: return View("Simple");
            //        case 2: return View("Colourful");
            //        case 3: return View("MiniSimple");
            //        case 4: return View("MiniColourful");
            //        case 5: return View("Dynamic");
            //        default: return View();
            //    }
            //}


            //int count = 0;
            //ProductEntityList list_products = new ProductEntityList();
            //var dt = CommodityService.GetSaleProductsListIndex(weixinID, out count, 1, 99, "", "");
            //list_products.ProductEntity_List = ProductEntity.ConvertProductEntityIndexListMall(dt);
            //list_products.Count = count;
            //ViewData["products"] = list_products.ProductEntity_List;


            //string traveledition = string.Empty;
            //string sql = "select traveledition  from WeiXinNO with (nolock) where weixinId=@weixinId  ";
            //DataTable db_open = SQLHelper.Get_DataTable(sql, SQLHelper.GetCon(), new Dictionary<string, DBParam>()
            //        {{"weixinId",new DBParam(){ParamValue=weixinID}},

            //    });

            //if (db_open.Rows.Count > 0)
            //{
            //    traveledition = db_open.Rows[0]["traveledition"].ToString();
            //}
            //ViewData["traveledition"] = traveledition;


            ViewData["CommodityTypeTable"] = CommodityService.GetCommodityTypeByWeixinId(weixinID, "", "");

            DataTable commodityDataTable = CommodityService.GetCommodityList("", "", "", "", "", "", "", 1, weixinID, id, false);

            ViewData["commodityDataTable"] = commodityDataTable;

            return(View());
        }
예제 #5
0
        public ActionResult Main(string id)
        {
            string userWeiXinID = HotelCloud.Common.HCRequest.GetString("key");

            if (!userWeiXinID.Equals(""))
            {
                hotel3g.Models.Cookies.SetCookies("userWeixinNO", userWeiXinID.Split('@')[1], 30, userWeiXinID.Split('@')[0]);
            }
            string weixinID = HotelCloud.Common.HCRequest.GetString("weixinID");

            if (weixinID.Equals(""))
            {
                weixinID = userWeiXinID.Split('@')[0];
            }
            //int hotelId=HotelCloud.Common.HCRequest.getInt("hId");

            IList <Advertisement> list = new List <Advertisement>();

            string cacheName = string.Format("{0}_{1}", weixinID, "mainindex");

            if (cache[cacheName] != null)
            {
                list = (List <Advertisement>)cache[cacheName];
            }

            else
            {
                list = Advertisement.GetAdvertisementBySort(weixinID);
                cache.Insert(cacheName, list, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
            }


            if (list != null && list.Count == 0)
            {
                //创建虚拟
                string[] imgs       = { "/img/ad_01.jpg", "/img/ad_02.jpg", "/img/ad_03.jpg", "/img/ad_04.jpg", "/img/ad_05.jpg" };
                string   imgwebsite = System.Configuration.ConfigurationManager.AppSettings["imgwebsite"] == null ? "http://admin.weikeniu.com" : System.Configuration.ConfigurationManager.AppSettings["imgwebsite"].ToString();
                foreach (string str in imgs)
                {
                    Advertisement ad = new Advertisement();
                    ad.ImageUrl = imgwebsite + str;
                    list.Add(ad);
                }
            }
            ViewData["ad"]           = list;
            ViewData["hId"]          = id;
            ViewData["weixinID"]     = weixinID;
            ViewData["userWeiXinID"] = hotel3g.Models.Cookies.GetCookies("userWeixinNO", weixinID);

            Hotel  hotel           = new Hotel();
            string cache_hotelName = string.Format("{0}_{1}", id, "mainindex");

            if (cache[cache_hotelName] != null)
            {
                hotel = (Hotel)cache[cache_hotelName];
            }
            else
            {
                hotel = HotelHelper.GetMainIndexHotel(Convert.ToInt32(id));
                cache.Insert(cache_hotelName, hotel, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
            }

            ViewData["hotel"]    = hotel.SubName;
            ViewData["quanjing"] = hotel.Quanjing;


            bool IsBranch = hotel3g.Models.DAL.BranchHelper.IsBranch(weixinID);

            ViewData["IsBranch"] = IsBranch;



            //读取模板style 0:默认 1:简约(Simple) 2:多彩(Colourful)
            hotel3g.Repository.WeiXinAppConfig Config = hotel3g.Repository.MemberHelper.GetHotelAppConfig(weixinID);


            if (Config.style > 0)
            {
                //菜单栏
                List <MenuDictionaryResponse> MenuBarList = hotel3g.Models.MenuBarHelper.MenuBarList(Config.style, weixinID, hotel.Quanjing, userWeiXinID);

                ViewData["MenuBarList"] = MenuBarList;

                hotel = HotelHelper.GetMainIndexHotel(Convert.ToInt32(id));
                ViewData["HotelInfo"] = hotel;
            }
            if (!string.IsNullOrEmpty(hotel.MainPic))
            {
                switch (Config.style)
                {
                case 0: return(View());

                case 1: return(View("Simple"));

                case 2: return(View("Colourful"));

                case 3: return(View("MiniSimple"));

                case 4: return(View("MiniColourful"));

                case 5: return(View("Dynamic"));

                default: return(View());
                }
            }
            return(View());
        }