Ejemplo 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());
            }
        }
Ejemplo n.º 2
0
 public string HomePageRefreshTime = "7200000";//默认2小时
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         HomePageRefreshTime = LinkFun.ConfigString("HomePageRefreshTime", "7200000");
     }
 }
Ejemplo 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);
            }
        }
Ejemplo 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();
 }
Ejemplo n.º 5
0
        public void AddUser(HttpContext context)
        {
            string PwdKey = LinkFun.getPwdKey();
            int    UserID = 0;

            if (!string.IsNullOrEmpty(context.Request.QueryString["UserID"].ToString()))
            {
                UserID = Convert.ToInt32(context.Request.QueryString["UserID"].ToString());
            }


            string   objOrder = GetParam("UsersModel", context);
            Users    users    = JsonConvert.DeserializeObject <Users>(objOrder);
            UsersBLL usersbll = new UsersBLL();


            int result = 0;

            //编辑
            if (UserID > 0)
            {
                if (users.LoginName != "" && users.Password != "")
                {
                    result = usersbll.Update(users) ? 1 : 0;
                    if (result > 0)
                    {
                        #region 通知风控系统

                        #endregion
                    }
                }
            }
            else
            {
                string pwd = DESEncrypt.Encrypt(PwdKey, users.Password);//加密密码
                users.Password = pwd;
                //添加
                if (users.LoginName != "" && users.Password != "")
                {
                    result = usersbll.Add(users);
                    if (result > 0)
                    {
                        #region 通知风控系统

                        #endregion
                    }
                }
            }
            context.Response.Write(result);
        }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CompanyId      = DNTRequest.GetInt("CompanyId", 0);
     openTypeQR     = DNTRequest.GetInt("openTypeQR", 0);
     NetLoanApplyId = DNTRequest.GetInt("NetLoanApplyId", 0);
     if (CompanyId <= 0)
     {
         Response.Redirect("/Product/Index?wd=0");
     }
     try
     {
         int             UserId        = MerchantFrontCookieBLL.GetMerchantFrontUserId();
         CompanyRelation relationModel = oCompanyRelationBLL.GetModel(CompanyId, UserId);//获取商家(只能给多个二维码的)二维码
         if (relationModel != null)
         {
             QRImg = relationModel.QRCode;
             if (string.IsNullOrEmpty(QRImg))
             {
                 if (!string.IsNullOrEmpty(relationModel.API))
                 {
                     string imgName = relationModel.CompanyRelationId + "_" + relationModel.CompanyId.ToString() + "_" + UserId.ToString();//组合文件名格式:渠道扩展编号加横杆加渠道编号
                     QRImg = GetQRImg(relationModel.API, imgName, "", "");
                 }
             }
         }
         else
         {
             model = opCompanyBLL.GetModel(CompanyId);
             if (model != null)
             {
                 if (!string.IsNullOrEmpty(model.QRCode))
                 {
                     QRImg = model.QRCode;
                 }
                 else
                 {
                     string url          = string.Empty;
                     string referralCode = string.Empty;
                     string imgName      = string.Empty;
                     if (!model.IsAPK)
                     {
                         QRType = 0;
                         url    = model.API;
                         if (model.IsRelyOnPrimaryKey == 1)
                         {
                             string prefix    = model.RecommendationPrefix;
                             int    maxlength = model.RecommendationLength;
                             referralCode = prefix + "-" + UserId.ToString() + "-" + NetLoanApplyId.ToString().PadLeft(maxlength, '0');
                         }
                         else
                         {
                             referralCode = model.RecommendationCode;
                         }
                         if (url.IndexOf("{0}") > 0)
                         {
                             url = string.Format(url, referralCode);
                         }
                         //if (!string.IsNullOrEmpty(model.ReplaceUrlParam))
                         //{
                         //    url = WebUtils.ReplaceUrlParamValue(model.API, model.ReplaceUrlParam, referralCode);
                         //}
                     }
                     else
                     {
                         QRType = 1;
                         string domain = LinkFun.getBWJSDomain();
                         url = domain + "/Product/NetLoanMiddlePage.aspx?openTypeQR=" + QRType + "&CompanyId=" + CompanyId;
                     }
                     imgName = model.CompanyId.ToString() + "_" + UserId;//渠道编号加下划线加经销商编号
                     QRImg   = GetQRImg(url, imgName, model.Logo, "");
                 }
             }
         }
         if (!string.IsNullOrEmpty(QRImg))//追加时间戳
         {
             if (QRImg.IndexOf("?") == -1)
             {
                 QRImg += string.Format("?{0}={1}", "times", DateTime.Now.ToFileTime());
             }
             else
             {
                 QRImg += string.Format("&{0}={1}", "times", DateTime.Now.ToFileTime());
             }
         }
     }
     catch (Exception ex) { ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); }
 }