Esempio n. 1
0
        /// <summary>
        /// 免费Wifi页面
        /// </summary>
        /// <returns></returns>
        public ActionResult ToFreeWifiPage(string id)
        {
            var key       = HotelCloud.Common.HCRequest.GetString("key");
            var hotelWxId = key.Split('@')[0];
            var userWxId  = key.Split('@')[1];
            var v         = HotelCloud.Common.HCRequest.getInt("v", 0); //0旧版,1新版
            var passUrl   = string.Empty;                               //认证请求地址
            var wifi      = new WxWifi();
            var shop      = new WxShop();
            var shops     = wifiService.GetHasWifiShops(hotelWxId);

            if (shops.Count == 1)
            {
                shop = shops[0];
                var wifis = wifiService.GetValidWifis(shop.ShopID);
                if (wifis.Count == 1)
                {
                    wifi = wifis[0];//该公众号只有一个门店一个WIFI时,则直接展示操作图
                    if (wifi.ProtocolType == 31)
                    {
                        passUrl = "http://192.168.1.1/cgi-bin/i_free.cgic?module=portal&op=change&passwd=" + MD5Encrypt32(wifi.PassPwd);
                    }
                }
            }
            ViewData["Ads"]           = Advertisement.GetAdvertisementBySort(hotelWxId, 3); //广告//TODO
            ViewData["shops"]         = shops;
            ViewData["wifiJson"]      = JsonConvert.SerializeObject(wifi);                  //只有一个门店及WIFI
            ViewData["shopJson"]      = JsonConvert.SerializeObject(shop);                  //只有一个门店
            ViewData["passUrl"]       = passUrl;
            ViewData["sucRedirctUrl"] = v == 1 ? string.Format("/hotelA/Index/{0}?key={1}@{2}", id, hotelWxId, userWxId) : string.Format("/hotel/Index/{0}?key={1}@{2}", id, hotelWxId, userWxId);
            return(View());
        }
Esempio n. 2
0
        //
        // GET: /TravelAgencyHotel/

        public ActionResult Index(string id)
        {
            string key       = HotelCloud.Common.HCRequest.GetString("key");
            var    hotelWxId = key.Split('@')[0];
            var    userWxId  = key.Split('@')[1];
            var    adList    = Advertisement.GetAdvertisementBySort(hotelWxId, 1);

            if (adList.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)
                {
                    adList.Add(new Advertisement()
                    {
                        ImageUrl = imgwebsite + str
                    });
                }
            }
            ViewData["hId"]       = id;
            ViewData["adImgs"]    = adList;
            ViewData["userWxId"]  = userWxId;
            ViewData["hotelWxId"] = hotelWxId;
            ViewData["key"]       = key;
            ViewData["defCity"]   = taHotelService.GetSumTopCityForHotel(hotelWxId);
            return(View());
        }
Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 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());
        }