Esempio n. 1
0
        public ActionResult ShoppingMallByLingZong(string id)
        {
            string hotelId      = id;
            string key          = HotelCloud.Common.HCRequest.GetString("key");      //"酒店微信id@用户微信id"
            string weixinid     = HotelCloud.Common.HCRequest.GetString("weixinID"); //酒店微信id
            string userweixinid = "";
            string search       = HotelCloud.Common.HCRequest.GetString("MallSearch");

            if (!key.Equals("") && key.Contains("@"))
            {
                weixinid     = key.Split('@')[0];//酒店微信id
                userweixinid = key.Split('@')[1];
            }
            //促销显示
            var pList = CommodityService.GetSaleProductsListToList(weixinid, search, "", "");

            ViewData["products"] = pList;

            ViewData["MallSearch"]              = search;
            ViewData["hotelId"]                 = id;
            ViewData["weixinid"]                = weixinid;
            ViewData["userweixinid"]            = userweixinid;
            ViewData["CommodityTypeTable"]      = CommodityService.GetCommodityTypeByWeixinId(weixinid, "", search);
            ViewData["CommodityAllTypeTable"]   = CommodityService.GetCommodityTypeByWeixinId(weixinid, "", "");
            ViewData["CommodityExtensionTable"] = CommodityService.GetCommodityExtensionByWeixinId(weixinid);
            return(View());
        }
Esempio n. 2
0
        public ActionResult GetSearchCommdityType(string id)
        {
            string key          = HotelCloud.Common.HCRequest.GetString("key");//"酒店微信id@用户微信id"
            string weixinid     = HotelCloud.Common.HCRequest.GetString("weixinID");
            string userweixinid = HotelCloud.Common.HCRequest.GetString("userweixinID");
            string MallSearch   = HotelCloud.Common.HCRequest.GetString("MallSearch");
            string type         = HotelCloud.Common.HCRequest.GetString("type");
            string cityName     = HotelCloud.Common.HCRequest.GetString("cityName");

            if (!key.Equals("") && key.Contains("@"))
            {
                weixinid     = key.Split('@')[0];//酒店微信id
                userweixinid = key.Split('@')[1];
            }
            DataTable commodityDataTable = CommodityService.GetCommodityTypeByWeixinId(weixinid, type, MallSearch, cityName);

            return(Json(new
            {
                data = SerializeDataTable(commodityDataTable)
            }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
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());
        }