Esempio n. 1
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 + "')"));
        }
Esempio n. 2
0
        /// <summary>
        /// 上传证件
        /// </summary>
        /// <returns></returns>
        public ActionResult Reg2()
        {
            int _memId = QueryString.IntSafeQ("memId");

            if (_memId == 0)
            {
                _memId = CookieBLL.GetRegisterCookie();
            }
            if (_memId > 0)
            {
                MemberInfoEntity enti = MemberInfoBLL.Instance.GetMemberInfoByMemId(_memId);
                if (enti != null && enti.Id > 0)
                {
                    ViewBag.LegalIdentityPre = enti.IdentityPre;
                    ViewBag.LegalIdentityBeh = enti.IdentityBeh;
                }
                ViewBag.MemId = _memId;
            }
            else
            {
                RedirectToAction("Reg");
            }

            return(View());
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
        public ActionResult Register3()
        {
            int memid = CookieBLL.GetRegisterCookie();

            if (memid > 0)
            {
                MemStoreEntity _en = StoreBLL.Instance.GetStoreByMemId(memid);
                if (_en != null)
                {
                    MemberEntity _mementity = MemberBLL.Instance.GetMember(memid);
                    if (_mementity.Status == (int)MemberStatus.Active)
                    {
                        //Response.Write("您已注册通过,请直接登录");
                        return(RedirectToAction("Login"));
                    }
                    else
                    {
                        ViewBag.LicensePath = _en.LicensePath;
                    }
                }
            }
            else
            {
                return(RedirectToAction("Login"));
            }
            return(View());
        }
Esempio n. 5
0
        public string UserLogin()
        {
            ResultObj _result = new ResultObj();

            _result.Status = (int)CommonStatus.Fail;
            string useraccount = StringUtils.SafeStr(Request.Form["useraccount"]);
            string password    = StringUtils.SafeStr(Request.Form["password"]);
            string VerCode     = StringUtils.SafeStr(FormString.SafeQ("verCode"));
            int    autologin   = FormString.IntSafeQ("autologin");

            //if (VerCode.Length == 4)
            //{
            //    //string svercode = StringUtils.GetDbString(System.Web.HttpContext.Current.Session["verify_login"]);

            //    HttpCookie cookie = Request.Cookies["verify_login"];
            //    string svercode = "";
            //    if (cookie != null)
            //    {
            //        svercode = CryptDES.DESDecrypt(cookie.Value);
            //    }

            //    if (svercode != "")
            //    {
            //        if (VerCode.ToLower() != svercode.ToLower())
            //        {
            //            return "验证码输入错误";
            //        }
            //    }
            //}
            MemberLoginEntity _loginmodel = new MemberLoginEntity();

            _result = MemberLoginBLL.Instance.Login("", useraccount, password, (int)ClientTypeEnum.PC, IPAddress.IP);

            if (_result != null && _result.Obj != null)
            {
                _loginmodel = (MemberLoginEntity)_result.Obj;
                try
                {
                    if (_result.Status == (int)CommonStatus.Success)
                    {
                        if (_loginmodel.Status == (int)MemberStatus.WaitCheck)
                        {
                            CookieBLL.SetRegisterCookie(_loginmodel.MemId);
                        }
                        else
                        {
                            CookieBLL.SetLoginCookie(_loginmodel, autologin == 1);
                            CookieBLL.ComBineCart(1);
                            CookieBLL.ComBineCartXuQiu(1);
                        }
                    }
                }
                catch (Exception ex)
                {
                    LogUtil.Log(ex);
                    _result.Status = (int)CommonStatus.ServerError;
                }
            }
            return(JsonJC.ObjectToJson(_result));
        }
Esempio n. 6
0
        public string SaveLicense()
        {
            ResultObj _loginentity = new ResultObj();
            int       memid        = CookieBLL.GetRegisterCookie();
            string    path         = FormString.SafeQ("licensepath");

            if (memid > 0)
            {
                MemberEntity _mem = new MemberEntity();
                _mem = MemberBLL.Instance.GetMember(memid);
                if (_mem != null && _mem.Status == (int)MemberStatus.WaitCheck)
                {
                    MemberBLL.Instance.RegisterCompanyLicense(memid, path);
                    _loginentity.Status = (int)CommonStatus.Success;
                }
                else
                {
                    _loginentity.Status = (int)CommonStatus.Fail;
                }
            }
            else
            {
                _loginentity.Status = (int)CommonStatus.Fail;
            }
            return(JsonJC.ObjectToJson(_loginentity));
        }
Esempio n. 7
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);
        }
Esempio n. 9
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);
            }
        }
Esempio n. 10
0
        public string SaveBasicMsg()
        {
            ResultObj _loginentity = new ResultObj();
            int       memid        = CookieBLL.GetRegisterCookie();
            string    mobile       = FormString.SafeQ("mobile");
            string    nikename     = FormString.SafeQ("nikename");

            if (memid > 0)
            {
                VWMemberEntity _mem = new VWMemberEntity();
                _mem.MemId       = memid;
                _mem.MemNikeName = nikename;
                int rei = MemberBLL.Instance.BasicMsgUpdate(_mem);
                if (rei > 0)
                {
                    _loginentity.Status = (int)CommonStatus.Success;
                }
                else
                {
                    _loginentity.Status = (int)CommonStatus.Fail;
                }
            }
            else
            {
                _loginentity.Status = (int)CommonStatus.Fail;
            }
            return(JsonJC.ObjectToJson(_loginentity));
        }
Esempio n. 11
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);
        }
Esempio n. 12
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());
        }
Esempio n. 13
0
        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);
        }
Esempio n. 14
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());
        }
Esempio n. 15
0
        public string CompanyRegister()
        {
            ResultObj _obj            = new ResultObj();
            string    useraccount     = FormString.SafeQ("useraccount");
            string    password        = FormString.SafeQ("password");
            string    mobile          = FormString.SafeQ("mobile");
            string    mobilecode      = FormString.SafeQ("mobilecode");
            string    companyname     = FormString.SafeQ("companyname");
            int       province        = FormString.IntSafeQ("province");
            int       city            = FormString.IntSafeQ("city");
            int       comtype         = FormString.IntSafeQ("comtype");
            string    contractmanname = FormString.SafeQ("contractmanname");
            string    email           = FormString.SafeQ("email");
            string    address         = FormString.SafeQ("address", 300);
            string    recommend       = FormString.SafeQ("recommend");
            string    lisenceurl      = FormString.SafeQ("lisencepath", 500);

            if (System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] == null)
            {
                _obj.Status = (int)CommonStatus.RegisterVerCodeHasExDay;
            }
            else if (System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister].ToString() != mobile || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode].ToString() != mobilecode)
            {
                _obj.Status = (int)CommonStatus.RegisterErrorVerCode;
            }
            else
            {
                VWMemberEntity _mem = new VWMemberEntity();
                _mem.MemCode           = useraccount;
                _mem.PassWord          = password;
                _mem.ContactsMobile    = mobile;
                _mem.CompanyName       = companyname;
                _mem.CompanyProvinceId = province;
                _mem.CompanyCityId     = city;
                _mem.CompanyAddress    = address;
                _mem.ContactsManName   = contractmanname;
                _mem.ContactsEmail     = email;
                _mem.CompanyType       = comtype;
                _mem.RecommendCode     = recommend;
                _mem.CreateClientType  = (int)ClientTypeEnum.PC;
                _mem.CreateIp          = IPAddress.IP;
                _mem.IsStore           = 1;
                _mem.LicensePath       = lisenceurl;
                _mem.IsSupplier        = 0;
                ResultObj _loginentity = MemberLoginBLL.Instance.RegisterStore(_mem);
                if (_loginentity.Status == (int)CommonStatus.Success)
                {
                    CookieBLL.SetRegisterCookie(StringUtils.GetDbInt(_loginentity.Obj));
                }
                _obj = _loginentity;
            }
            return(JsonJC.ObjectToJson(_obj));
        }
Esempio n. 16
0
        public string Reg2Submit()
        {
            ResultObj    _obj            = new ResultObj();
            string       useraccount     = FormString.SafeQ("useraccount");
            string       mobile          = FormString.SafeQ("mobile");
            string       stamp           = FormString.SafeQ("stamp");
            string       companyname     = FormString.SafeQ("companyname");
            int          province        = FormString.IntSafeQ("province");
            int          city            = FormString.IntSafeQ("city");
            int          comtype         = FormString.IntSafeQ("comtype");
            string       contractmanname = FormString.SafeQ("contractmanname");
            string       address         = FormString.SafeQ("address", 300);
            MemberEntity mem             = MemberBLL.Instance.GetMemByMethod(mobile, LoginMethodEnum.MobilePhone);

            if (mem.Status != (int)MemberStatus.Register1)
            {
                _obj.Status = (int)CommonStatus.RegisterNoModify;

                return(JsonJC.ObjectToJson(_obj));
            }
            if (!(mem.TimeStampTab == stamp && CookieBLL.GetRegisterCookie() == mem.Id))
            {
                _obj.Status = (int)CommonStatus.RegisterFail;
            }
            else
            {
                mem.MemCode = useraccount;
                MemberInfoEntity _meminfo = MemberInfoBLL.Instance.GetMemberInfoByMemId(mem.Id);
                _meminfo.MemId       = mem.Id;
                _meminfo.Nickname    = contractmanname;
                _meminfo.MemName     = contractmanname;
                _meminfo.MobilePhone = mobile;
                MemberInfoBLL.Instance.AddMemberInfo(_meminfo);
                MemStoreEntity _store = new MemStoreEntity();
                _store.Address         = address;
                _store.CityId          = city;
                _store.CompanyName     = companyname;
                _store.ContactsManName = contractmanname;
                _store.CreateTime      = DateTime.Now;
                _store.ProvinceId      = province;
                _store.Status          = (int)MemberStatus.WaitCheck;
                _store.StoreType       = mem.StoreType;
                _store.MobilePhone     = mobile;
                _store.MemId           = mem.Id;
                ResultObj _loginentity = MemberLoginBLL.Instance.Register2(mem, _meminfo, _store);
                //if (_loginentity.Status == (int)CommonStatus.Success)
                //{
                //    CookieBLL.SetRegisterCookie(StringUtils.GetDbInt(_loginentity.Obj));
                //}
                _obj = _loginentity;
            }
            return(JsonJC.ObjectToJson(_obj));
        }
Esempio n. 17
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());
        }
Esempio n. 18
0
        public string CheckMemberHasLogin()
        {
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null)
            {
                if (!string.IsNullOrEmpty(member.MobilePhone))
                {
                    return("1");
                }
            }
            return("0");
        }
Esempio n. 19
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);
        }
Esempio n. 20
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 + ")"));
        }
Esempio n. 21
0
        public ActionResult Register4()
        {
            MemBillVATEntity _en = new MemBillVATEntity();
            int memid            = CookieBLL.GetRegisterCookie();

            if (memid > 0)
            {
                _en = MemBillVATBLL.Instance.GetMemBillVATByMemId(memid);
            }
            else
            {
                return(RedirectToAction("Login"));
            }
            ViewBag.BillEntity = _en;
            return(View());
        }
Esempio n. 22
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());
        }
Esempio n. 23
0
        public string  RegSubmit()
        {
            ResultObj _obj       = new ResultObj();
            string    password   = FormString.SafeQ("password");
            string    mobile     = FormString.SafeQ("mobile");
            string    mobilecode = FormString.SafeQ("mobilecode");

            if (System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] == null)
            {
                _obj.Status = (int)CommonStatus.RegisterVerCodeHasExDay;
            }
            else if (System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister].ToString() != mobile || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode].ToString() != mobilecode)
            {
                _obj.Status = (int)CommonStatus.RegisterErrorVerCode;
            }
            else
            {
                MemberEntity _mem = new MemberEntity();
                _mem.MobilePhone = mobile;
                _mem.PassWord    = password;
                //_mem.IsSupplier = issupplier;
                //_mem.IsStore = isstore;
                string code = CookieBLL.GetWeiXinWebCode();
                if (!string.IsNullOrEmpty(code))
                {
                    MemWeChatMsgEntity shortmsg = WeiXinJsSdk.Instance.GetWeChatShortInfo(code);
                    if (!string.IsNullOrEmpty(shortmsg.OpenId) && !string.IsNullOrEmpty(shortmsg.UnionId))
                    {
                        _mem.WeChat = shortmsg.UnionId;
                    }
                }
                _mem.CreateClientType = Globals.IsMobileDevice()? (int)ClientTypeEnum.Mobile:(int)ClientTypeEnum.PC;
                _mem.CreateIp         = IPAddress.IP;
                _mem.Status           = (int)MemberStatus.Active;
                _mem.LoginNum         = 0;
                ResultObj _loginentity = MemberLoginBLL.Instance.Register1(_mem);
                if (_loginentity.Status == (int)CommonStatus.Success)
                {
                    MemberEntity member = (MemberEntity)_loginentity.Obj;
                    CookieBLL.SetRegisterCookie(StringUtils.GetDbInt(member.Id));
                }
                _obj = _loginentity;
            }
            return(JsonJC.ObjectToJson(_obj));
        }
Esempio n. 24
0
 public static VWShoppingCartInfo GetCartSession()
 {
     #region 重新获取购物车SESSSION
     System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[Core.SysCookieName.ComBineCart];
     string result = "0";
     if (cookie != null)
     {
         result = cookie.Value;
     }
     if (result == "1")
     {
         RemoveCartSession();
         ShoppingCartProcessor.WriteShoppingCartCookieByLogin();
         CookieBLL.ComBineCart(0);
     }
     #endregion
     VWShoppingCartInfo shoppingCart = ShoppingCartProcessor.GetShoppingCart();
     return(shoppingCart);
 }
Esempio n. 25
0
        ///// <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("");
        }
Esempio n. 26
0
        public string UploadLicense()
        {
            int    memid    = CookieBLL.GetRegisterCookie();
            string memcodes = "";

            if (memid <= 0)
            {
                if (System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister] != null && System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] != null)
                {
                    memcodes = System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister].ToString();
                }
            }
            else
            {
                memcodes      = memid.ToString();
                ViewBag.MemId = memid;
            }
            if (!string.IsNullOrEmpty(memcodes))
            {
                HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
                int             aa       = files.Count;
                int             _pictype = FormString.IntSafeQ("pictype");
                HttpPostedFile  file     = System.Web.HttpContext.Current.Request.Files[0];
                CertificateType _certype = (CertificateType)_pictype;
                if (file != null)
                {
                    byte[] bytes = null;
                    using (var binaryReader = new BinaryReader(file.InputStream))
                    {
                        bytes = binaryReader.ReadBytes(file.ContentLength);
                    }
                    FtpUtil _ftp        = new FtpUtil();
                    Random  _rd         = new Random();
                    string  dicpath     = FilePath.PathCombine(ConfigCore.Instance.ConfigCommonEntity.FtpImagesSystemName, ImagesSysPathCode.Certifacate.ToString(), memcodes, DateTime.Now.ToString("yyyy"), DateTime.Now.ToString("MM"), DateTime.Now.ToString("dd"), _rd.Next(100000, 999999).ToString());
                    string  dicpathfull = dicpath + file.FileName.Substring(file.FileName.LastIndexOf("."));
                    string  certifapath = FilePath.PathCombine(ConfigCore.Instance.ConfigCommonEntity.FtpImagesRootPath, dicpathfull);
                    _ftp.UploadFile(certifapath, bytes, true);
                    //return dicpathfull;
                    return("{\"jsonrpc\" : \"2.0\", \"result\" : null, \"pic_raw\" : \"" + dicpathfull + "\"}");
                }
            }
            return("");
        }
        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);
            }
        }
Esempio n. 28
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);
        }
Esempio n. 29
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());
        }
Esempio n. 30
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);
                    }
                }
            }
        }