Beispiel #1
0
        protected override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
        {
            member = CookieBLL.GetLoginCookie();

            if (member == null || member.MemId == 0)
            {
                var loginurl = SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.LoginWebUrl;
                if (loginurl == null || string.IsNullOrEmpty(loginurl.ToString()))
                {
                    loginurl = "/Home/Login";
                }
                loginurl = loginurl.TrimEnd('/');
                string wechatcode  = QueryString.SafeQ("wechatcode");
                string returnurl   = System.Web.HttpContext.Current.Request.Url.ToString();
                string redirecturl = loginurl + "?returnUrl=" + System.Web.HttpContext.Current.Server.UrlEncode(returnurl);
                if (!string.IsNullOrEmpty(wechatcode))
                {
                    returnurl   = returnurl.Replace("wechatcode=" + wechatcode, "");
                    redirecturl = loginurl + "?wechatcode=" + wechatcode + "&returnUrl=" + System.Web.HttpContext.Current.Server.UrlEncode(returnurl);
                }
                filterContext.Result = Redirect(redirecturl);
            }
            else
            {
                memid = member.MemId;
                base.OnActionExecuting(filterContext);
            }
        }
Beispiel #2
0
        protected override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
        {
            member = CookieBLL.GetLoginCookie();

            //if (member == null ||  member.MemId == 0)
            //{
            //    filterContext.Result = Redirect("/Home/Login?returnUrl=" + System.Web.HttpContext.Current.Server.UrlEncode(System.Web.HttpContext.Current.Request.RawUrl));
            //}
            if (member == null || member.MemId == 0)
            {
                var loginurl = ConfigCore.Instance.ConfigCommonEntity.LoginWebUrl;
                if (loginurl == null || string.IsNullOrEmpty(loginurl.ToString()))
                {
                    loginurl = "/Home/Login";
                }
                loginurl             = loginurl.TrimEnd('/');
                filterContext.Result = Redirect(loginurl + "?returnUrl=" + System.Web.HttpContext.Current.Server.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()));
            }
            else if (member.IsSupplier == 1)
            {
                var loginurl = ConfigCore.Instance.ConfigCommonEntity.LoginWebUrl;
                if (loginurl == null || string.IsNullOrEmpty(loginurl.ToString()))
                {
                    loginurl = "";
                }
                loginurl             = loginurl.TrimEnd('/') + "/Home/HasNoAuth";
                filterContext.Result = Redirect(loginurl + "?returnUrl=" + System.Web.HttpContext.Current.Server.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()));
            }
            else
            {
                memid = member.MemId;
                base.OnActionExecuting(filterContext);
            }
        }
Beispiel #3
0
        private ActionResult GetDefaultCusName()
        {
            string callback = QueryString.SafeQ("callback"); //jsonp回调函数
                                                             //System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[SysCookieName.DefaultCusName];
                                                             //string result = "";
                                                             //if (cookie != null)
                                                             //{
                                                             //    result = Server.UrlDecode(cookie.Value);
                                                             //}
            MemberLoginEntity member = CookieBLL.GetLoginCookie();
            string            result = "";

            if (member != null)
            {
                if (string.IsNullOrEmpty(member.NickName))
                {
                    result = member.MobilePhone;
                }
                else
                {
                    result = member.NickName;
                }
            }
            if (result != "")
            {
                result = Server.UrlDecode(result);
            }
            return(Content(callback + "('" + result + "')"));
        }
Beispiel #4
0
        public string GetProductSList()
        {
            ListObj result = new ListObj();

            int sid         = QueryString.IntSafeQ("sid");
            int pageindex   = QueryString.IntSafeQ("pageindex");
            int pagesize    = CommonKey.PageSizeProductMobile;
            int isactive    = 1;
            int recordcount = 0;

            IList <VWProductSpecialDetailsEntity> sdlist = ProductSpecialDetailsBLL.Instance.GetProductSpecialDetailsList(pageindex, pagesize, ref recordcount, sid, isactive);
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                if (sdlist != null && sdlist.Count > 0)
                {
                    foreach (VWProductSpecialDetailsEntity entity in sdlist)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
            }
            result.Total = recordcount;
            result.List  = sdlist;
            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
        //public string GetWeiXinAccessToken()
        //{
        //    return WeiXinBLL.GetWeiXinAccessToken();
        //}
        //public string GetWeiXinJsticket()
        //{
        //    return WeiXinBLL.GetWeiXinJsticket();
        //}
        //public string GetWeiXinGetSignature()
        //{
        //    string ticket = FormString.SafeQ("ticket", 200);
        //    string noncestr = FormString.SafeQ("noncestr", 200);
        //    long times = FormString.LongIntSafeQ("timestamp");
        //    string url = FormString.SafeQ("url",200 );
        //    return WeiXinBLL.GetSignature(ticket,   noncestr, times,   url);
        //}

        //public string GetWeiXinAPPId()
        //{
        //    return WeiXinBLL.APPId;
        //}

        #endregion


        #region 询价
        public string GetXunJiaMsg()
        {
            ResultObj         result = new ResultObj();
            int               _pdid  = FormString.IntSafeQ("pdid");
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                VWXunJiaObj               _obj  = new VWXunJiaObj();
                VWProductEntity           vwp   = ProductBLL.Instance.GetProVWByDetailId(_pdid);
                VWProductNomalParamEntity vwpa  = ProductExtBLL.Instance.GetProductNormalParamById(vwp.ProductId);
                MemStoreEntity            store = StoreBLL.Instance.GetStoreByMemId(member.MemId);
                _obj.Product     = vwp;
                _obj.ProductExt  = vwpa;
                _obj.MobilePhone = store.MobilePhone;
                _obj.MemId       = store.MemId;
                result.Status    = (int)CommonStatus.Success;
                result.Obj       = _obj;
            }
            else
            {
                result.Status = (int)CommonStatus.NeedLogin;
            }
            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
Beispiel #6
0
        /// <summary>
        /// 根据cookie获取后台权限
        /// </summary>
        /// <param name="ordercode"></param>
        /// <returns></returns>
        public static Dictionary <string, string> GetMenuByCookie()
        {
            if (AuthDic == null || AuthDic.Keys.Count == 0)
            {
                MemberLoginEntity member = CookieBLL.GetLoginCookie();
                int memid = member.MemId;

                AuthDic = MemberBLL.Instance.GetAuthByMemId(memid);
            }
            return(AuthDic);
        }
Beispiel #7
0
        /// <summary>
        /// 网站首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            int _pagesize = 10;
            int total     = 0;
            IList <VWProductMenuEntity> listbrand = ProductMenuBLL.Instance.GetProductMenuAll((int)ProductMenuType.BPBrand, 1);

            ViewBag.ListBrand = listbrand;
            //爆品-限量乐购
            IList <VWProductBaoPinEntity> listbpproduct = ProductBaoPinBLL.Instance.GetProductBaoPinShowList();



            //获取精选的第一页
            int _finetype = FormString.IntSafeQ("ft", (int)ProductFineTypeEnum.MobileHome);    //精选类型

            IList <VWProductFineEntity> listjx = ProductFineBLL.Instance.GetProductFineList(1, _pagesize, ref total, _finetype);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                if (listbpproduct != null && listbpproduct.Count > 0)
                {
                    foreach (VWProductBaoPinEntity entity in listbpproduct)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
                if (listjx != null && listjx.Count > 0)
                {
                    foreach (VWProductFineEntity entity in listjx)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
            }

            ViewBag.ListProduct = listbpproduct;

            ViewBag.ListJinXuan = listjx;

            ViewBag.PageMenu = "1";


            return(View());
        }
        public string GetMemId()
        {
            string            callback = QueryString.SafeQ("callback");//jsonp回调函数
            string            result   = "";
            MemberLoginEntity member   = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                result = member.MemId.ToString();
            }
            return(result);
        }
Beispiel #9
0
        public ActionResult Limited()
        {
            string title       = "易店心,限量乐购";
            string _key        = "";
            int    classid     = 0;
            int    brandid     = 0;
            int    order_i     = 0;//排序类型
            int    producttype = (int)ProductType.SpecialPrice;

            int _classtype = -1;

            _classtype = QueryString.IntSafeQ("clt");
            int pageindex = QueryString.IntSafeQ("pageindex");
            int pagesize  = CommonKey.PageSizeList;
            int record    = 0;

            if (pageindex == 0)
            {
                pageindex = 1;
            }
            string propertiesstr = "";
            string classidstr    = "";
            IList <VWProductEntity> _productlist = ProductBLL.Instance.GetProductListProc(pagesize, pageindex, ref record, classidstr, brandid, propertiesstr, order_i, _key);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _entity.TradePrice, _entity.Price, _entity.IsBP, _entity.DealerPrice);
                }
            }
            else
            {
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = 0;
                }
            }

            ViewBag.Title       = title;
            ViewBag.ProductList = _productlist;
            ViewBag.TotalNum    = record;
            string url = "/Product/Limited.html?";

            string pagehtml = HTMLPage.SetOrderListPage(record, pagesize, pageindex, url);

            ViewBag.PageHtml = pagehtml;
            return(View());
        }
Beispiel #10
0
        public ActionResult Special()
        {
            string title        = "小店专区-";
            int    _specialid   = QueryString.IntSafeQ("sid");
            string _specialcode = QueryString.SafeQ("code");
            int    pageindex    = QueryString.IntSafeQ("pageindex");

            if (pageindex == 0)
            {
                pageindex = 1;
            }
            int _pagesize                = CommonKey.PageSizeProductMobile;
            int isactive                 = 1;
            int _recordCount             = 0;
            ProductSpecialEntity sentity = new ProductSpecialEntity();

            if (_specialid > 0)
            {
                sentity = ProductSpecialBLL.Instance.GetProductSpecial(_specialid);
            }
            else if (!string.IsNullOrEmpty(_specialcode))
            {
                sentity = ProductSpecialBLL.Instance.GetProductSpecialByCode(_specialcode);
            }
            title = sentity.FullName;
            IList <VWProductSpecialDetailsEntity> sdlist = ProductSpecialDetailsBLL.Instance.GetProductSpecialDetailsList(pageindex, _pagesize, ref _recordCount, sentity.Id, isactive);
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                if (sdlist != null && sdlist.Count > 0)
                {
                    foreach (VWProductSpecialDetailsEntity entity in sdlist)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
            }
            ViewBag.ProductSpecialEntity = sentity;
            ViewBag.SpecialDetailList    = sdlist;
            string url      = "/Product/Special?sid=" + _specialid + "&code=" + _specialcode;
            string pagehtml = HTMLPage.SetOrderListPage(_recordCount, _pagesize, pageindex, url);

            ViewBag.PageHtml = pagehtml;
            ViewBag.Title    = title;
            return(View());
        }
        public string CheckMemberHasLogin()
        {
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null)
            {
                if (!string.IsNullOrEmpty(member.MobilePhone))
                {
                    return("1");
                }
            }
            return("0");
        }
Beispiel #12
0
        public ActionResult GetMemberLogin()
        {
            string            result = "";
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                VWMemberEntity _mementity = MemberBLL.Instance.GetVWMember(member.MemId);
                result = JsonJC.ObjectToJson(_mementity);
            }
            string callback = QueryString.SafeQ("callback");//jsonp回调函数

            return(Content(callback + "(" + result + ")"));
        }
Beispiel #13
0
        /// <summary>
        /// 获取购物车
        /// </summary>
        /// <param name="shoppingCart"></param>
        /// <returns></returns>
        public static VWShoppingCartInfo GetShoppingXuQiu(IList <ShoppCookie> shoppingCart)
        {
            VWShoppingCartInfo _info = new VWShoppingCartInfo();

            if (shoppingCart.Count > 0)
            {
                SuperMarket.Model.Account.MemberLoginEntity member = CookieBLL.GetLoginCookie();
                VWShoppingCartInfo shoppingXuQiuInfo = new VWShoppingCartInfo();

                shoppingXuQiuInfo.CartItems = shoppingCart;
                return(shoppingXuQiuInfo);
            }
            return(null);
        }
Beispiel #14
0
        /// <summary>
        /// 专区产品显示
        /// </summary>
        /// <returns></returns>
        public ActionResult ProductS()
        {
            int    _specialid            = QueryString.IntSafeQ("sid");
            string _specialcode          = QueryString.SafeQ("code");
            int    pageindex             = 1;
            int    _pagesize             = CommonKey.PageSizeProductMobile;
            int    isactive              = 1;
            int    _recordCount          = 0;
            ProductSpecialEntity sentity = new ProductSpecialEntity();

            if (_specialid > 0)
            {
                sentity = ProductSpecialBLL.Instance.GetProductSpecial(_specialid);
            }
            else if (!string.IsNullOrEmpty(_specialcode))
            {
                sentity = ProductSpecialBLL.Instance.GetProductSpecialByCode(_specialcode);
            }
            IList <VWProductSpecialDetailsEntity> sdlist = ProductSpecialDetailsBLL.Instance.GetProductSpecialDetailsList(pageindex, _pagesize, ref _recordCount, sentity.Id, isactive);
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                if (sdlist != null && sdlist.Count > 0)
                {
                    foreach (VWProductSpecialDetailsEntity entity in sdlist)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
            }
            ViewBag.ProductSpecialEntity = sentity;
            ViewBag.SpecialDetailList    = sdlist;
            int maxpage = _recordCount / _pagesize;

            if (_recordCount % _pagesize > 0)
            {
                maxpage = maxpage + 1;
            }
            ViewBag.MaxPageIndex = maxpage;
            return(View());
        }
        protected override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
        {
            member = CookieBLL.GetLoginCookie();

            if (member == null || member.MemId == 0)
            {
                var loginurl = SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.LoginWebUrl;
                if (loginurl == null || string.IsNullOrEmpty(loginurl.ToString()))
                {
                    loginurl = "/Home/Login";
                }
                filterContext.Result = Redirect(loginurl + "?returnUrl=" + System.Web.HttpContext.Current.Server.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()));
            }
            else
            {
                memid = member.MemId;
                base.OnActionExecuting(filterContext);
            }
        }
        ///// <summary>
        ///// 找到密码
        ///// </summary>
        ///// <returns></returns>
        //public ActionResult FoundPwd()
        //{
        //    string _key = QueryString.SafeQ("k");
        //    if (System.Web.HttpContext.Current.Session[CommonKey.FindPwdID] != null)
        //    {
        //        int _memid = Convert.ToInt32(System.Web.HttpContext.Current.Session[CommonKey.FindPwdID]);
        //        if (_memid > 0)
        //        {
        //            MemberEntity _entity = MemberBLL.Instance.GetMember(_memid);
        //            if (_entity.TimeStampTab == _key)
        //            {
        //                return View();
        //            }
        //            return RedirectToAction("FindPwd");
        //        }
        //    }

        //    return RedirectToAction("FindPwd");

        //}

        #endregion


        #region 浏览记录登记

        public string MsgProductClickAdd()
        {
            int _pdId = FormString.IntSafeQ("pdid");

            if (_pdId > 0)
            {
                int               _sysId = FormString.IntSafeQ("sysid");
                string            _ip    = IPAddress.IP;
                int               memid  = 0;
                MemberLoginEntity member = CookieBLL.GetLoginCookie();
                if (member != null)
                {
                    memid = member.MemId;
                    string cookievalue = CookieBLL.GetMemBrowseLogCookie();
                    if (string.IsNullOrEmpty(cookievalue))
                    {
                        MemBrowseLogEntity brouselog = new MemBrowseLogEntity();
                        brouselog.MemId           = memid;
                        brouselog.ProductDetailId = _pdId;
                        brouselog.SystemId        = _sysId;
                        MemBrowseLogBLL.Instance.AddMemBrowseLog(brouselog);
                    }
                    else
                    {
                        CookieBLL.AddMemBrowseLogCookie(_pdId);
                        cookievalue = CookieBLL.GetMemBrowseLogCookie();
                        MemBrowseLogBLL.Instance.AddMemBrowseLogStr(cookievalue, memid, _sysId);
                        CookieBLL.ClearBrowseLogCookie();
                    }
                }
                else
                {
                    CookieBLL.AddMemBrowseLogCookie(_pdId);
                }
                MemProductClickEntity entity = new MemProductClickEntity();
                entity.MemId           = memid;
                entity.ProductDetailId = _pdId;
                entity.ClickIp         = _ip;
                entity.SystemId        = _sysId;
                MemProductClickBLL.Instance.AddMemProductClick(entity);
            }
            return("");
        }
Beispiel #17
0
        /// <summary>
        /// 根据数据库获取购物车
        /// </summary>
        /// <returns></returns>
        public static VWShoppingCartInfo GetShoppingXuQiuByData()
        {
            VWShoppingCartInfo _info = new VWShoppingCartInfo();

            SuperMarket.Model.Account.MemberLoginEntity member = CookieBLL.GetLoginCookie();
            if (member != null && member.MemId > 0)
            {
                if (SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.XuQiuCookie == 1)
                {
                    IList <ShoppCookie> listcookie = new List <ShoppCookie>();

                    IList <MemShoppCarEntity> list = new List <MemShoppCarEntity>();
                    string cookieval = WZShopCartBLL.Instance.GetXuQiuCookie(member.MemId);
                    if (cookieval != "")
                    {
                        string cookieValue = HttpUtility.UrlDecode(cookieval, Encoding.GetEncoding("UTF-8"));
                        //string cookieValue = cookieval;
                        if (cookieValue.Contains("ProductName") || cookieValue.Contains("ProductDetailId"))
                        {
                            System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[SysCookieName.ShoppingXuQiu_Data];
                            if (cookie != null)
                            {
                                cookie.Expires = DateTime.Now.AddDays(-1);
                                System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
                            }
                            SetShoppingXuQiuCount(0);
                        }
                        else
                        {
                            listcookie = JsonJC.JsonToObject <List <ShoppCookie> >(cookieValue);
                        }
                    }
                    if (listcookie != null && listcookie.Count > 0)
                    {
                        _info.CartItems = listcookie;
                        WriteShoppingXuQiuCookie(SuperMarket.Core.Json.JsonJC.ObjectToJson(listcookie), _info.CartCount);
                        return(_info);
                    }
                }
            }
            return(null);
        }
Beispiel #18
0
        /// <summary>
        /// 爆品页面
        /// </summary>
        /// <returns></returns>
        public ActionResult ProductBp()
        {
            int pageindex = QueryString.IntSafeQ("pageindex");

            if (pageindex == 0)
            {
                pageindex = 1;
            }
            int _pagesize    = CommonKey.PageSizeProductMobile;
            int isactive     = 1;
            int showproduct  = -1;//代表所有
            int _recordCount = 0;

            IList <VWProductBaoPinEntity> listproduct = ProductBaoPinBLL.Instance.GetProductBaoPinList(pageindex, _pagesize, ref _recordCount, isactive, showproduct);
            MemberLoginEntity             member      = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                if (listproduct != null && listproduct.Count > 0)
                {
                    foreach (VWProductBaoPinEntity entity in listproduct)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
            }
            ViewBag.ListProduct = listproduct;
            int maxpage = _recordCount / _pagesize;

            if (_recordCount % _pagesize > 0)
            {
                maxpage = maxpage + 1;
            }
            ViewBag.MaxPageIndex = maxpage;
            return(View());
        }
Beispiel #19
0
        /// <summary>
        /// 生成购物车cookie
        /// </summary>
        /// <param name="shoppingCart"></param>
        public static void WriteShoppingXuQiuCookie(VWShoppingCartInfo shoppingcart)
        {
            if (shoppingcart == null)
            {
                return;
            }
            string jsonRst = SuperMarket.Core.Json.JsonJC.ObjectToJson(shoppingcart.CartItems);

            //保存购物车cookie
            System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[SysCookieName.ShoppingXuQiu_Data];
            if (cookie == null)
            {
                cookie = new System.Web.HttpCookie(SysCookieName.ShoppingXuQiu_Data);
            }
            cookie.Value   = HttpUtility.UrlEncode(jsonRst, Encoding.GetEncoding("UTF-8"));
            cookie.Expires = DateTime.Now.AddDays(15);
            System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
            //修改购物车数量cookie
            SetShoppingXuQiuCount(shoppingcart.CartCount);


            //如果登录保存COOKIE至数据库

            if (SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.XuQiuCookie == 1)
            {
                if (shoppingcart != null)
                {
                    MemberLoginEntity member = CookieBLL.GetLoginCookie();
                    if (member != null && member.MemId > 0 && jsonRst != "")
                    {
                        MemWZShopCartEntity model = new MemWZShopCartEntity();
                        model.AddDate          = DateTime.Now;
                        model.BuyDate          = DateTime.Now.Date;
                        model.EndDate          = DateTime.Now.Date.AddDays(15);
                        model.MemId            = member.MemId;
                        model.CookieValueXuQiu = jsonRst;
                        WZShopCartBLL.Instance.AddWZShopCartXuQiu(model);
                    }
                }
            }
        }
Beispiel #20
0
        public ActionResult Detail()
        {
            int             _productdetailid = QueryString.IntSafeQ("pd");
            VWProductEntity _vwentity        = new VWProductEntity();

            _vwentity = ProductBLL.Instance.GetProVWByDetailId(_productdetailid);
            IList <ProductStylePicsEntity> productpiclist = ProductStylePicsBLL.Instance.GetListPicsByProductId(_vwentity.ProductId);

            _vwentity.ProductPics = productpiclist;
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId         = member.MemId;
                ViewBag.MemStatus     = member.Status;
                _vwentity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _vwentity.TradePrice, _vwentity.Price, _vwentity.IsBP, _vwentity.DealerPrice);
            }
            VWProductNomalParamEntity paramentity = ProductExtBLL.Instance.GetProductNormalParamById(_vwentity.ProductId);

            ViewBag.VWProductEntity    = _vwentity;
            ViewBag.ProductParamEntity = paramentity;
            return(View());
        }
Beispiel #21
0
        public string GetJsonList()
        {
            ListObj result  = new ListObj();
            string  _key    = QueryString.SafeQ("key");
            int     classid = QueryString.IntSafeQ("cid");
            int     brandid = QueryString.IntSafeQ("bd");
            int     siteid  = QueryString.IntSafeQ("s");

            if (siteid <= 0)
            {
                siteid = (int)SiteIdEnum.BathRoom;
            }
            int pageindex = QueryString.IntSafeQ("pageindex");
            int pagesize  = CommonKey.PageSizeList;
            int record    = 0;
            int order_i   = 0;//默认排序

            if (pageindex == 0)
            {
                pageindex = 1;
            }
            ViewBag.SelectClassId = classid;
            ViewBag.SelectBrandId = brandid;
            int    rediclassid = classid;
            string classidstr  = "";//分类子集



            if (classid > 0)
            {
                ClassesFoundEntity _classentity = ClassesFoundBLL.Instance.GetClassesFound(classid, false);
                if (_classentity.RedirectClassId > 0)
                {
                    rediclassid = _classentity.RedirectClassId;
                }
                IList <int> classintlist = new List <int>();
                if (_classentity.RedirectClassId > 0)
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(_classentity.RedirectClassId);
                }
                else
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(classid);
                }
                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
                else if (_classentity.RedirectClassId > 0)
                {
                    classidstr = StringUtils.GetDbString(_classentity.RedirectClassId);
                }
                else
                {
                    classidstr = StringUtils.GetDbString(classid);
                }
            }
            else
            {
                IList <int> classintlist = new List <int>();
                classintlist = ClassesFoundBLL.Instance.GetSubClassEndListBySite(siteid);

                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
            }


            IList <VWProductEntity> _productlist = new List <VWProductEntity>();// ProductBLL.Instance.GetProductListProcCYC(pagesize, pageindex, ref record, classidstr, brandid, "", order_i, producttype,  cartype ,jishi);

            _productlist = ProductBLL.Instance.GetProductListProc(pagesize, pageindex, ref record, classidstr, brandid, "", order_i, _key);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _entity.TradePrice, _entity.Price, _entity.IsBP, _entity.DealerPrice);
                }
            }
            else
            {
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = 0;
                }
            }
            result.Total = record;
            result.List  = _productlist;

            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
Beispiel #22
0
        /// <summary>
        /// 登录时合并购物车数据
        /// </summary>
        public static void WriteShoppingXuQiuCookieByLogin()
        {
            if (SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.XuQiuCookie == 0)
            {
                return;
            }
            List <ShoppCookie> shoppingCart1   = new List <ShoppCookie>();
            List <ShoppCookie> shoppingCart2   = new List <ShoppCookie>();
            List <ShoppCookie> shoppingCartnew = new List <ShoppCookie>();

            System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[SysCookieName.ShoppingXuQiu_Data];
            if (cookie != null && cookie.Value != "" && cookie.Value != "[]")
            {
                string cookieValue = HttpUtility.UrlDecode(cookie.Value, Encoding.GetEncoding("UTF-8"));
                if (cookieValue.Contains("ProductName") || cookieValue.Contains("ProductDetailId"))
                {
                    if (cookie != null)
                    {
                        cookie.Expires = DateTime.Now.AddDays(-1);
                        System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
                    }
                    SetShoppingXuQiuCount(0);
                    cookieValue = "[]";
                }
                shoppingCart1   = JsonJC.JsonToObject <List <ShoppCookie> >(cookieValue);
                shoppingCartnew = JsonJC.JsonToObject <List <ShoppCookie> >(cookieValue);
                if (shoppingCart1 != null && shoppingCart1.Count > 0)
                {
                    MemberLoginEntity member = CookieBLL.GetLoginCookie();
                    if (member != null && member.MemId > 0)
                    {
                        string cookieval = WZShopCartBLL.Instance.GetXuQiuCookie(member.MemId);
                        if (cookieval != "")
                        {
                            if (cookieval.Contains("ProductName") || cookieval.Contains("ProductDetailId"))
                            {
                                if (cookie != null)
                                {
                                    cookie.Expires = DateTime.Now.AddDays(-1);
                                    System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
                                }
                                SetShoppingXuQiuCount(0);
                                cookieval = "[]";
                            }
                            cookieValue = HttpUtility.UrlDecode(cookieval, Encoding.GetEncoding("UTF-8"));
                            //cookieValue =  cookieval;
                            shoppingCart2 = JsonJC.JsonToObject <List <ShoppCookie> >(cookieValue);

                            bool exit = false;
                            if (shoppingCart2 != null && shoppingCart2.Count > 0)
                            {
                                foreach (ShoppCookie i in shoppingCart2)
                                {
                                    exit = false;
                                    foreach (ShoppCookie j in shoppingCart1)
                                    {
                                        if (j.ProDId == i.ProDId)
                                        {
                                            exit = true;
                                            break;
                                        }
                                    }
                                    if (!exit)
                                    {
                                        shoppingCartnew.Add(i);
                                    }
                                }
                                VWShoppingCartInfo shoppingcart = GetShoppingXuQiu(shoppingCartnew);
                                WriteShoppingXuQiuCookie(shoppingcart);
                            }
                        }
                    }
                }
            }
            else
            {
                GetShoppingXuQiuByData();
            }
        }
        public string GetJsonList()
        {
            ListObj result      = new ListObj();
            int     classid     = QueryString.IntSafeQ("cl");
            int     brandid     = QueryString.IntSafeQ("bd");
            int     cartype     = QueryString.IntSafeQ("ct");
            int     producttype = QueryString.IntSafeQ("pt");
            int     jishi       = QueryString.IntSafeQ("js");

            if (jishi == 0)
            {
                jishi = (int)JiShiSongEnum.Normal;
            }
            if (producttype == 0)
            {
                producttype = (int)ProductType.Normal;
            }
            int siteid = QueryString.IntSafeQ("s");

            if (siteid <= 0)
            {
                siteid = (int)SiteEnum.Default;
            }
            int pageindex  = QueryString.IntSafeQ("pageindex");
            int pagesize   = CommonKey.PageSizeList;
            int record     = 0;
            int order_i    = 0;//默认排序
            int _classtype = -1;

            _classtype        = QueryString.IntSafeQ("clt");
            ViewBag.ClassType = _classtype;
            if (pageindex == 0)
            {
                pageindex = 1;
            }
            ViewBag.SelectClassId = classid;
            ViewBag.SelectBrandId = brandid;
            ViewBag.CarType       = cartype;
            int    _classmenutype = (int)ClassMenuTypeEnum.Normal; //分类列表选择类型
            int    rediclassid    = classid;
            string classidstr     = "";                            //分类子集

            //获取选择的车型
            if (cartype > 0)
            {
                CarTypeModelEntity cartypemodel = CarTypeModelBLL.Instance.GetCarTypeModel(cartype);
                ViewBag.SelectCarTypeName = cartypemodel.ModelName;
            }

            if (classid > 0)
            {
                ClassesFoundEntity _classentity = ClassesFoundBLL.Instance.GetClassesFound(classid, true);
                if (_classentity.RedirectClassId > 0)
                {
                    rediclassid = _classentity.RedirectClassId;
                }
                ViewBag.SelectClassName = _classentity.Name;
                IList <int> classintlist = new List <int>();
                if (_classentity.RedirectClassId > 0)
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(_classentity.RedirectClassId);
                }
                else
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(classid);
                }
                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
                else if (_classentity.RedirectClassId > 0)
                {
                    classidstr = StringUtils.GetDbString(_classentity.RedirectClassId);
                }
                else
                {
                    classidstr = StringUtils.GetDbString(classid);
                }
            }
            else
            {
                IList <int> classintlist = new List <int>();
                classintlist = ClassesFoundBLL.Instance.GetSubClassEndListBySite(siteid);

                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
            }


            IList <VWProductEntity> _productlist = new List <VWProductEntity>();// ProductBLL.Instance.GetProductListProcCYC(pagesize, pageindex, ref record, classidstr, brandid, "", order_i, producttype,  cartype ,jishi);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _entity.TradePrice, _entity.Price, _entity.IsBP, _entity.DealerPrice);
                }
            }
            else
            {
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = 0;
                }
            }
            result.Total = record;
            result.List  = _productlist;

            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
Beispiel #24
0
        /// <summary>
        /// 网站首页
        /// </summary>
        /// <returns></returns>
        public ActionResult List()
        {
            int classid        = QueryString.IntSafeQ("cl");
            int brandid        = QueryString.IntSafeQ("bd");
            int cartypemodelid = QueryString.IntSafeQ("ct");//车型
            int siteid         = QueryString.IntSafeQ("s");

            if (siteid == 0)
            {
                siteid = (int)SiteIdEnum.BathRoom;
            }

            int producttype = QueryString.IntSafeQ("pt");

            if (producttype == 0)
            {
                producttype = (int)ProductType.Normal;
            }
            int pageindex      = QueryString.IntSafeQ("pageindex");
            int _classmenutype = (int)ClassMenuTypeEnum.Normal;//分类列表选择类型
            int _pagesize      = CommonKey.PageSizeList;
            int _recordCount   = 0;
            int order_i        = 0;//默认排序
            int _classtype     = -1;

            _classtype        = QueryString.IntSafeQ("clt");
            ViewBag.ClassType = _classtype;
            if (pageindex == 0)
            {
                pageindex = 1;
            }
            ViewBag.SelectClassId  = classid;
            ViewBag.SelectBrandId  = brandid;
            ViewBag.CarTypeModelId = cartypemodelid;
            ViewBag.ProductType    = producttype;
            int    rediclassid = classid;
            string classidstr  = "";//分类子集

            //获取选择的品牌
            if (brandid > 0)
            {
                BrandEntity brand = BrandBLL.Instance.GetBrand(brandid, true);
                ViewBag.SelectBrandName = brand.Name;
            }
            //获取选择的车型
            if (cartypemodelid > 0)
            {
                CarTypeModelEntity cartypemodel = CarTypeModelBLL.Instance.GetCarTypeModel(cartypemodelid);
                ViewBag.SelectCarTypeName = cartypemodel.ModelName;
            }
            if (classid > 0)
            {
                ClassesFoundEntity _classentity = ClassesFoundBLL.Instance.GetClassesFound(classid, true);
                siteid = _classentity.SiteId;
                if (_classentity.RedirectClassId > 0)
                {
                    rediclassid = _classentity.RedirectClassId;
                }
                ViewBag.SelectClassName = _classentity.Name;
                //获取分类子集
                IList <int> classintlist = new List <int>();
                classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(rediclassid);

                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
                else
                {
                    classidstr = StringUtils.GetDbString(rediclassid);
                }
            }
            if (classid > 0)
            {
                ClassesFoundEntity _classentity = ClassesFoundBLL.Instance.GetClassesFound(classid, true);
                if (_classentity.RedirectClassId > 0)
                {
                    rediclassid = _classentity.RedirectClassId;
                }
                ViewBag.SelectClassName = _classentity.Name;
                IList <int> classintlist = new List <int>();
                if (_classentity.RedirectClassId > 0)
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(_classentity.RedirectClassId);
                }
                else
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(classid);
                }
                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
                else if (_classentity.RedirectClassId > 0)
                {
                    classidstr = StringUtils.GetDbString(_classentity.RedirectClassId);
                }
                else
                {
                    classidstr = StringUtils.GetDbString(classid);
                }
            }
            else
            {
                IList <int> classintlist = new List <int>();
                classintlist = ClassesFoundBLL.Instance.GetSubClassEndListBySite(siteid);

                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
            }
            IList <VWProductEntity> _productlist = new List <VWProductEntity>();// ProductBLL.Instance.GetProductListProcCYC(_pagesize, pageindex, ref _recordCount, classidstr, brandid, "", order_i, producttype,  cartypemodelid,jishi);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _entity.TradePrice, _entity.Price, _entity.IsBP, _entity.DealerPrice);
                }
            }
            else
            {
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = 0;
                }
            }

            ViewBag.ProductList = _productlist;
            ViewBag.SiteId      = siteid;
            int maxpage = _recordCount / _pagesize;

            if (_recordCount % _pagesize > 0)
            {
                maxpage = maxpage + 1;
            }
            ViewBag.MaxPageIndex   = maxpage;
            ViewBag.ClassmMenuType = _classmenutype;
            return(View());
        }
Beispiel #25
0
        /// <summary>
        /// 常规商品列表
        /// </summary>
        /// <returns></returns>
        public ActionResult List()
        {
            string title   = "易店心,";
            string _key    = QueryString.SafeQ("key");
            int    classid = QueryString.IntSafeQ("cid");
            int    brandid = QueryString.IntSafeQ("bd");
            int    order_i = QueryString.IntSafeQ("px");//排序类型
            //if (classid == 0) { return Redirect("/");  }
            int siteid = QueryString.IntSafeQ("s");

            if (siteid <= 0)
            {
                siteid = (int)SiteIdEnum.BathRoom;
            }
            ViewBag.SiteId = siteid;
            ///获取已选择的分类属性
            string propertiesstr = QueryString.SafeQ("pp");
            //if (classid == 0) RedirectToAction("Home", "Index");
            ClassesFoundEntity _classentity = ClassesFoundBLL.Instance.GetClassesFound(classid, false);

            if (_classentity != null && _classentity.Id > 0)
            {
                title += "类别:" + _classentity.Name + ",";
            }
            ViewBag.ClassId         = classid;
            ViewBag.SelectClassName = _classentity.Name;
            ViewBag.SiteId          = _classentity.SiteId;
            ViewBag.OrderBy         = order_i;
            ViewBag.ClassEntity     = _classentity;
            ViewBag.BrandId         = brandid;
            int rediclassid = classid;//实际指向分类

            if (rediclassid == -1)
            {
                rediclassid = 0;
            }
            if (_classentity.RedirectClassId > 0)
            {
                rediclassid = _classentity.RedirectClassId;
            }
            siteid = _classentity.SiteId;
            //if(siteid == 0&& rediclassid>0)
            //{
            //    ClassesFoundEntity _classredirectentity = ClassesFoundBLL.Instance.GetClassesFound(rediclassid, false);
            //}
            if (brandid > 0 && classid == 0)
            {
                //获取子集分类
                IList <ClassesFoundEntity> classes = ClassesFoundBLL.Instance.GetClassesAllByBrandId(siteid, brandid, false);
                ViewBag.ClassList = classes;
            }
            else
            {
                //分类导航显示
                if (_classentity.IsEnd == 0)
                {
                    //获取子集分类
                    IList <ClassesFoundEntity> classes = ClassesFoundBLL.Instance.GetClassesAllByPId(rediclassid, false, siteid);
                    ViewBag.ClassList = classes;
                }
            }
            if (classid > 0)
            {
                //ViewBag.RavClassList = ListRavStr(_classentity);
                if (brandid == 0)
                {
                    //获取分类对应品牌
                    IList <BrandEntity> brands = ClassBrandBLL.Instance.GetBrandByClass(rediclassid);
                    ViewBag.BrandList = brands;
                }
                ////获取分类属性
                //IList<ClassPropertiesEntity> _ClassPropertieslist = ClassPropertiesBLL.Instance.GetAllPropertyByClassId(classid);
                //ViewBag.PropertiesList = _ClassPropertieslist;
            }
            if (brandid > 0)
            {
                BrandEntity brand = BrandBLL.Instance.GetBrand(brandid, false);
                ViewBag.SelectBrandName = brand.Name;
                ViewBag.BrandSelect     = brand;
                title += "品牌:" + brand.Name + ",";
            }
            //ViewBag.PropertiesStr = propertiesstr;

            int pageindex = QueryString.IntSafeQ("pageindex");
            int pagesize  = CommonKey.PageSizeList;
            int record    = 0;

            if (pageindex == 0)
            {
                pageindex = 1;
            }
            string classidstr = "";

            if (classid > 0)
            {
                IList <int> classintlist = new List <int>();
                if (_classentity.RedirectClassId > 0)
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(_classentity.RedirectClassId);
                }
                else
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(classid);
                }
                if (classintlist != null && classintlist.Count > 100)
                {
                    classintlist = classintlist.Take(100).ToList <int>();
                }
                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
                else if (_classentity.RedirectClassId > 0)
                {
                    classidstr = StringUtils.GetDbString(_classentity.RedirectClassId);
                }
                else
                {
                    classidstr = StringUtils.GetDbString(classid);
                }
            }
            else
            {
                IList <int> classintlist = new List <int>();
                classintlist = ClassesFoundBLL.Instance.GetSubClassEndListBySite(siteid);
                if (classintlist != null && classintlist.Count > 100)
                {
                    classintlist = classintlist.Take(100).ToList <int>();
                }

                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
                else if (_classentity.RedirectClassId > 0)
                {
                    classidstr = StringUtils.GetDbString(_classentity.RedirectClassId);
                }
                else
                {
                    classidstr = StringUtils.GetDbString(classid);
                }
            }
            IList <VWProductEntity> _productlist = new List <VWProductEntity>();// ProductBLL.Instance.GetProductListProc(pagesize, pageindex, ref record, classidstr, brandid, propertiesstr, order_i,     _key  );

            _productlist = ProductBLL.Instance.GetProductListProc(pagesize, pageindex, ref record, classidstr, brandid, propertiesstr, order_i, _key);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _entity.TradePrice, _entity.Price, _entity.IsBP, _entity.DealerPrice);
                }
            }
            else
            {
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = 0;
                }
            }
            ViewBag.Title       = title;
            ViewBag.ProductList = _productlist;
            ViewBag.TotalNum    = record;
            //ViewBag.ListShowMethod = (int)ListShowMethodEnum.Normal;
            string url = "/Product/list.html?px=" + order_i + "&cid=" + classid + "&bd=" + brandid + "&pp=" + propertiesstr + "&s=" + siteid + "&ct=0&key=" + _key;

            ViewBag.SiteId = siteid;
            string pagehtml = HTMLPage.SetOrderListPage(record, pagesize, pageindex, url);

            ViewBag.PageHtml = pagehtml;
            int maxpage = record / pagesize;

            if (record % pagesize > 0)
            {
                maxpage = maxpage + 1;
            }
            ViewBag.MaxPageIndex = maxpage;
            return(View());
        }
Beispiel #26
0
        /// <summary>
        /// 网站首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            int jishi = QueryString.IntSafeQ("js");

            if (jishi == 0)
            {
                jishi = (int)JiShiSongEnum.Normal;
            }
            int _pagesize = CommonKey.PageSizeList;
            int total     = 0;

            IList <VWProductMenuEntity> listbrand = ProductMenuBLL.Instance.GetProductMenuAll((int)ProductMenuType.BPBrand, 1);

            ViewBag.ListBrand = listbrand;
            //爆品-限量乐购
            IList <VWProductBaoPinEntity> listbpproduct = ProductBaoPinBLL.Instance.GetProductBaoPinShowList();



            //获取精选的第一页
            int _finetype = FormString.IntSafeQ("ft", (int)ProductFineModuleIdEnum.MobileHome);    //精选类型

            IList <VWProductFineEntity> listjx = ProductFineBLL.Instance.GetProductFineList(1, _pagesize, ref total, _finetype);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                if (listbpproduct != null && listbpproduct.Count > 0)
                {
                    foreach (VWProductBaoPinEntity entity in listbpproduct)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
                if (listjx != null && listjx.Count > 0)
                {
                    foreach (VWProductFineEntity entity in listjx)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
            }

            ViewBag.ListProduct = listbpproduct;

            ViewBag.ListJinXuan = listjx;


            ViewBag.PageMenu = "1";

            ////微信处理参数列表
            //string wxappid = WeiXinBLL.APPId;
            //string wxticket = WeiXinBLL.GetWeiXinJsticket();
            //long timestamp = WeiXinBLL.CreateTimestamp();
            //string nonceStr = WeiXinBLL.CreateNonce_str();
            //string url = System.Web.HttpContext.Current.Request.RawUrl;
            //string signature =  WeiXinBLL.GetSignature(wxticket, nonceStr, timestamp, url);
            //ViewBag.WeiXinAppId = wxappid;
            //ViewBag.timestamp = timestamp;
            //ViewBag.nonceStr = nonceStr;
            //ViewBag.signature = signature;
            //GetWeiXinMsg();
            return(View());
        }
Beispiel #27
0
        public ActionResult Detail()
        {
            string title            = "易店心,";
            int    _productdetailid = QueryString.IntSafeQ("pd");
            int    _producttype     = (int)ProductType.Normal;

            if (_productdetailid == 0)
            {
                _productdetailid = StringUtils.GetDbInt(RouteData.Values["pd"]);
                if (_productdetailid == 0)
                {
                    return(Redirect("/"));
                }
            }
            VWProductEntity _vwentity = new VWProductEntity();

            _vwentity = ProductBLL.Instance.GetProVWByDetailId(_productdetailid);
            int _productid = _vwentity.ProductId;

            _producttype = _vwentity.ProductType;

            //if(_vwentity.ProductType== (int)ProductType.SpecialPrice)
            //{
            //    return RedirectToAction(  "SProductDetail", new { pd = _productdetailid });
            //}
            title        += _vwentity.AdTitle;
            ViewBag.Title = title;
            IList <ProductStylePicsEntity> productpiclist = null;

            ClassesFoundEntity _classentity = ClassesFoundBLL.Instance.GetClassesFound(_vwentity.ClassId, false);
            BrandEntity        _brandrntity = BrandBLL.Instance.GetBrand(_vwentity.BrandId, false);

            ViewBag.RavClassList  = ListRavStr(_classentity);
            ViewBag.Brand         = _brandrntity;
            productpiclist        = ProductStylePicsBLL.Instance.GetListPicsByProductId(_productid);
            _vwentity.ProductPics = productpiclist;

            IList <ProductPropertyEntity> productpropertylist = ProductPropertyBLL.Instance.GetListByProductId(_productid);

            _vwentity.ProductPropertys = productpropertylist;

            if (!string.IsNullOrEmpty(_vwentity.Spec1))
            {
                ViewBag.Spec1Name = _vwentity.Spec1;
                IList <VWProductEntity> plist = ProductBLL.Instance.GetListSpecsByStyleId(_vwentity.SiteId, _vwentity.ProductType, _vwentity.CGMemId);
                //ViewBag.SpecList = plist;
                var listfilter = (from c in plist
                                  select new { c.Spec1, c.Spec2, c.PicUrlLittle, c.ProductId, c.ProductDetailId });
                string liststr = JsonJC.ObjectToJson(listfilter);
                ViewBag.SpecListJson = liststr;
                IList <string> OBJSpec1 = (from c in plist
                                           where !string.IsNullOrEmpty(c.Spec1)
                                           select c.Spec1).Distinct().OrderBy(p => p).ToList();
                ViewBag.Spec1List = OBJSpec1;

                if (!string.IsNullOrEmpty(_vwentity.Spec2))
                {
                    ViewBag.Spec2Name = _vwentity.Spec2;
                    IList <string> OBJSpec2 = (from c in plist
                                               where !string.IsNullOrEmpty(c.Spec2)
                                               select c.Spec2).Distinct().OrderBy(p => p).ToList <string>();
                    ViewBag.Spec2List = OBJSpec2;
                }
            }

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId         = member.MemId;
                ViewBag.MemStatus     = member.Status;
                ViewBag.Member        = member;
                _vwentity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _vwentity.TradePrice, _vwentity.Price, _vwentity.IsBP, _vwentity.DealerPrice);
            }
            ViewBag.VWProductEntity = _vwentity;
            return(View());
        }