Esempio n. 1
0
        public int BackgroundRefreshTime = int.Parse(LinkFun.ConfigString("BackgroundRefreshTime", "7200000")); //背景刷新时间


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ProductIndexRefreshTime = LinkFun.ConfigString("ProductIndexRefreshTime", "7200000"); //LinkFun.getProductIndexRefreshTime();
                ProductsBLL        adHelper            = new ProductsBLL();
                ProductCategoryBLL oProductCategoryBLL = new ProductCategoryBLL();
                oCategoryList = oProductCategoryBLL.GetCardTypeList();
                LoginUserCookie cookie = MerchantFrontCookieBLL.GetMerchantFrontUserCookie();
                magName = cookie.LoginName;
                CompanyBLL opCompanyBLL = new CompanyBLL();

                StringBuilder where = new StringBuilder();
                //where.AppendFormat("IsDeleted=0 and CompanyCategoryId=2 order by OrderId asc");
                //litCompanyNetLoan = opCompanyBLL.GetModelList(where.ToString());

                where = new StringBuilder();
                where.AppendFormat("IsDeleted=0 and CompanyCategoryId=4 order by OrderId asc");
                litCompanyBank = opCompanyBLL.GetModelList(where.ToString());

                where = new StringBuilder();
                where.AppendFormat("IsDeleted=0 and CompanyCategoryId=5 order by OrderId asc");
                litCompanyOther = opCompanyBLL.GetModelList(where.ToString());
            }
        }
Esempio n. 2
0
 public string HomePageRefreshTime = "7200000";//默认2小时
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         HomePageRefreshTime = LinkFun.ConfigString("HomePageRefreshTime", "7200000");
     }
 }
Esempio n. 3
0
        private void GetLoginOn(HttpContext context)
        {
            UsersBLL    bll         = new UsersBLL();
            ReturnModel ReturnModel = new ReturnModel();
            //int IsManager = 0;

            int result = 0;

            try
            {
                string LoginName = context.Request.Params["LoginName"];
                string Password  = context.Request.Params["Password"];
                string CardID    = context.Request.Params["CardID"];
                //string IsRemember = context.Request.Params["IsRemember"];

                if (!string.IsNullOrEmpty(LoginName) && !string.IsNullOrEmpty(Password) && !string.IsNullOrEmpty(CardID))
                {
                    Users  users  = new Users();
                    string PwdKey = LinkFun.getPwdKey();
                    Password    = DESEncrypt.Encrypt(PwdKey, Password);//旧密码加密
                    ReturnModel = bll.VerificationPassword(LoginName, Password, CardID);
                    if (ReturnModel.IsSuccess)
                    {
                        int UserID = (int)ReturnModel.Data;
                        result = UserID;

                        MerchantFrontCookieBLL.SetMerchantFrontCookie(UserID, LoginName);

                        #region 改造前端登录方法存储到缓存
                        UsersBLL bllUsers = new UsersBLL();
                        Users    model    = bllUsers.GetModel(UserID);
                        if (model != null)
                        {
                            string key = ComPage.memberModelCacheDependency + model.UserID;
                            ComPage.SetBWJSCache(key, Guid.NewGuid(), null, DateTime.Now.AddMinutes(ComPage.SafeToDouble(LinkFun.ConfigString("FrontEndCookieExpires", "120"))), TimeSpan.Zero);

                            HttpCookie cookie = new HttpCookie(LinkFun.ConfigString("FrontEndCookieName", "BWJSFrontEnd20180108"));
                            cookie.Expires = DateTime.Now.AddMinutes(ComPage.SafeToDouble(LinkFun.ConfigString("FrontEndCookieExpires", "120")));
                            cookie.Values.Add("Id", HttpContext.Current.Server.UrlEncode(model.UserID.ToString()));

                            System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
                            System.Web.HttpContext.Current.Response.AppendCookie(cookie);

                            model.LastAccessIP     = HttpContext.Current.Request.UserHostAddress;
                            model.LoginTimes       = ComPage.SafeToInt(model.LoginTimes) + 1;
                            model.RecordUpdateTime = DateTime.Now;
                            model.IsLogined        = 1;
                            bllUsers.Update(model);
                        }
                        #endregion
                    }
                }
                context.Response.Write(ObjectToJson(ReturnModel));
            }
            catch (Exception ex)
            {
                context.Response.Write(ex);
            }
        }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["u"] != null)
     {
         u = Request.QueryString["u"].ToString();
     }
     adRefreshTime = LinkFun.ConfigString("AdRefreshTime", "180000");// LinkFun.getAdRefreshTime();
 }