Exemplo n.º 1
0
        /// <summary>
        /// 投票
        /// </summary>
        /// <param name="voteID"></param>
        protected void Vote(int voteID)
        {
            string result = "ok";

            if (ShopConfig.ReadConfigInfo().AllowAnonymousVote == (int)BoolType.False && base.UserID == 0)
            {
                result = "还未登录";
            }
            else
            {
                string voteCookies = CookiesHelper.ReadCookieValue("VoteCookies" + voteID.ToString());
                if (ShopConfig.ReadConfigInfo().VoteRestrictTime > 0 && voteCookies != string.Empty)
                {
                    result = "请不要频繁提交";
                }
                else
                {
                    VoteRecordInfo voteRecord = new VoteRecordInfo();
                    voteRecord.VoteID   = voteID;
                    voteRecord.ItemID   = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("ItemID"));
                    voteRecord.AddDate  = RequestHelper.DateNow;
                    voteRecord.UserIP   = ClientHelper.IP;
                    voteRecord.UserID   = base.UserID;
                    voteRecord.UserName = base.UserName;
                    VoteRecordBLL.AddVoteRecord(voteRecord);
                    if (ShopConfig.ReadConfigInfo().VoteRestrictTime > 0)
                    {
                        CookiesHelper.AddCookie("VoteCookies" + voteID.ToString(), "VoteCookies" + voteID.ToString(), ShopConfig.ReadConfigInfo().VoteRestrictTime, TimeType.Second);
                    }
                }
            }
            ResponseHelper.Write(result);
            ResponseHelper.End();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 页面加载方法
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         CheckAdminPower("ReadConfig", PowerCheckType.Single);
         //积分抵现的比率
         PointToMoney.Text = ShopConfig.ReadConfigInfo().PointToMoney.ToString();
         //订单付款时限
         OrderPayTime.Text = ShopConfig.ReadConfigInfo().OrderPayTime.ToString();
         //订单单自动收货天数
         OrderRecieveShippingDays.Text = ShopConfig.ReadConfigInfo().OrderRecieveShippingDays.ToString();
         //订单支付模板Id
         OrderPayTemplateId.Text = ShopConfig.ReadConfigInfo().OrderPayTemplateId;
         //订单自提模板Id
         SelfPickTemplateId.Text = ShopConfig.ReadConfigInfo().SelfPickTemplateId;
         //开团成功模板Id
         OpenGroupTemplateId.Text = ShopConfig.ReadConfigInfo().OpenGroupTemplateId;
         //参团成功模板Id
         GroupSignTemplateId.Text = ShopConfig.ReadConfigInfo().GroupSignTemplateId;
         //砍价成功模板Id
         BarGainTemplateId.Text = ShopConfig.ReadConfigInfo().BarGainTemplateId;
         //拼团成功模板Id
         GroupSuccessTemplateId.Text = ShopConfig.ReadConfigInfo().GroupSuccessTemplateId;
         //拼团失败模板Id
         GroupFailTemplateId.Text = ShopConfig.ReadConfigInfo().GroupFailTemplateId;
     }
 }
Exemplo n.º 3
0
        protected override void PageLoad()
        {
            base.PageLoad();

            protocol = ShopConfig.ReadConfigInfo().Agreement;
            Title    = "注册协议";
        }
Exemplo n.º 4
0
        /// <summary>
        /// 提交按钮点击方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            CheckAdminPower("UpdateConfig", PowerCheckType.Single);
            ShopConfigInfo config = ShopConfig.ReadConfigInfo();
            //满立减
            decimal orderMoney = 0; decimal orderDiscount = 0;

            config.PayDiscount = RequestHelper.GetForm <int>("ctl00$ContentPlaceHolder$PayDiscount");
            if (config.PayDiscount == 1)
            {
                if (!decimal.TryParse(OrderMoney.Text, out orderMoney) || !decimal.TryParse(OrderDisCount.Text, out orderDiscount))
                {
                    ScriptHelper.Alert("满立减金额填写错误");
                }
                if (orderMoney <= orderDiscount)
                {
                    ScriptHelper.Alert("满立减金额必须小于订单金额");
                }
            }
            config.OrderMoney    = orderMoney;
            config.OrderDisCount = orderDiscount;
            ShopConfig.UpdateConfigInfo(config);
            AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateConfig"));
            ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 检查用户名
        /// </summary>
        protected void CheckUserName()
        {
            int    result   = 1;
            string userName = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("UserName"));

            if (userName != string.Empty)
            {
                //检查非法字符
                string forbiddinName = ShopConfig.ReadConfigInfo().ForbiddenName;
                if (forbiddinName != string.Empty)
                {
                    foreach (string TempName in forbiddinName.Split('|'))
                    {
                        if (userName.IndexOf(TempName.Trim()) != -1)
                        {
                            result = 3;
                            break;
                        }
                    }
                }
                //检查用户名
                if (result != 3)
                {
                    if (!UserBLL.UniqueUser(userName))
                    {
                        result = 2;
                    }
                }
            }
            ResponseHelper.Write(result.ToString());
            ResponseHelper.End();
        }
Exemplo n.º 6
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            string checkCode = RequestHelper.GetQueryString <string>("CheckCode");

            if (checkCode != string.Empty)
            {
                string decode = StringHelper.Decode(checkCode, ShopConfig.ReadConfigInfo().SecureKey);
                if (decode.IndexOf('|') > 0)
                {
                    int      userID   = Convert.ToInt32(decode.Split('|')[0]);
                    string   email    = decode.Split('|')[1];
                    string   userName = decode.Split('|')[2];
                    string   safeCode = decode.Split('|')[3];
                    UserInfo user     = UserBLL.ReadUserMore(userID);
                    if (user.Id > 0 && user.UserName == userName && user.Email == email && safeCode == user.SafeCode)
                    {
                        if (ShopConfig.ReadConfigInfo().FindPasswordTimeRestrict > 0 && user.FindDate.AddHours(ShopConfig.ReadConfigInfo().FindPasswordTimeRestrict) < RequestHelper.DateNow)
                        {
                            errorMessage = "信息过时,请重新申请";
                        }
                    }
                    else
                    {
                        errorMessage = "错误的信息";
                    }
                }
                else
                {
                    errorMessage = "错误的信息";
                }
            }
            result = RequestHelper.GetQueryString <string>("Result");
        }
Exemplo n.º 7
0
        protected void Vote(int voteID)
        {
            string content = "ok";

            if ((ShopConfig.ReadConfigInfo().AllowAnonymousVote == 0) && (base.UserID == 0))
            {
                content = "»¹Î´µÇ¼";
            }
            else
            {
                string str2 = CookiesHelper.ReadCookieValue("VoteCookies" + voteID.ToString());
                if ((ShopConfig.ReadConfigInfo().VoteRestrictTime > 0) && (str2 != string.Empty))
                {
                    content = "Ç벻ҪƵ·±Ìá½»";
                }
                else
                {
                    VoteRecordInfo voteRecord = new VoteRecordInfo();
                    voteRecord.VoteID   = voteID;
                    voteRecord.ItemID   = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("ItemID"));
                    voteRecord.AddDate  = RequestHelper.DateNow;
                    voteRecord.UserIP   = ClientHelper.IP;
                    voteRecord.UserID   = base.UserID;
                    voteRecord.UserName = base.UserName;
                    VoteRecordBLL.AddVoteRecord(voteRecord);
                    if (ShopConfig.ReadConfigInfo().VoteRestrictTime > 0)
                    {
                        CookiesHelper.AddCookie("VoteCookies" + voteID.ToString(), "VoteCookies" + voteID.ToString(), ShopConfig.ReadConfigInfo().VoteRestrictTime, TimeType.Second);
                    }
                }
            }
            ResponseHelper.Write(content);
            ResponseHelper.End();
        }
Exemplo n.º 8
0
        public void AddProductReply(ref string result)
        {
            int    queryString = RequestHelper.GetQueryString <int>("ProductID");
            int    num2        = RequestHelper.GetQueryString <int>("CommentID");
            string str         = CookiesHelper.ReadCookieValue("ReplytCookies" + num2.ToString());

            if ((ShopConfig.ReadConfigInfo().ReplyRestrictTime > 0) && (str != string.Empty))
            {
                result = "Ç벻ҪƵ·±Ìá½»";
            }
            else
            {
                ProductReplyInfo productReply = new ProductReplyInfo();
                productReply.ProductID = queryString;
                productReply.CommentID = num2;
                productReply.Content   = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Content"));
                productReply.UserIP    = ClientHelper.IP;
                productReply.PostDate  = RequestHelper.DateNow;
                productReply.UserID    = base.UserID;
                productReply.UserName  = base.UserName;
                ProductReplyBLL.AddProductReply(productReply);
                if (ShopConfig.ReadConfigInfo().ReplyRestrictTime > 0)
                {
                    CookiesHelper.AddCookie("ReplytCookies" + num2.ToString(), "ReplytCookies" + num2.ToString(), ShopConfig.ReadConfigInfo().ReplyRestrictTime, TimeType.Second);
                }
            }
        }
Exemplo n.º 9
0
 protected override void PageLoad()
 {
     base.PageLoad();
     AdminLogBLL.Add(ShopLanguage.ReadLanguage("LogoutSystem"));
     CookiesHelper.DeleteCookie(ShopConfig.ReadConfigInfo().AdminCookies);
     ResponseHelper.Redirect("/MobileAdmin/Login.html");
 }
Exemplo n.º 10
0
        protected override void PageLoad()
        {
            base.PageLoad();
            string queryString = RequestHelper.GetQueryString <string>("CheckCode");

            if (queryString != string.Empty)
            {
                string str2 = StringHelper.Decode(queryString, ShopConfig.ReadConfigInfo().SecureKey);
                if (str2.IndexOf('|') > 0)
                {
                    int      id   = Convert.ToInt32(str2.Split(new char[] { '|' })[0]);
                    string   str3 = str2.Split(new char[] { '|' })[1];
                    string   str4 = str2.Split(new char[] { '|' })[2];
                    string   str5 = str2.Split(new char[] { '|' })[3];
                    UserInfo info = UserBLL.ReadUser(id);
                    if ((((info.ID > 0) && (info.UserName == str4)) && (info.Email == str3)) && (str5 == info.SafeCode))
                    {
                        if ((ShopConfig.ReadConfigInfo().FindPasswordTimeRestrict > 0.0) && (info.FindDate.AddHours(ShopConfig.ReadConfigInfo().FindPasswordTimeRestrict) < RequestHelper.DateNow))
                        {
                            this.errorMessage = "信息过时,请重新申请";
                        }
                    }
                    else
                    {
                        this.errorMessage = "错误的信息";
                    }
                }
                else
                {
                    this.errorMessage = "错误的信息";
                }
            }
            this.result = RequestHelper.GetQueryString <string>("Result");
        }
Exemplo n.º 11
0
 /// <summary>
 /// 待收货订单自动收货--指定订单--存储过程
 /// </summary>
 public static void CheckOrderRecieveTimeProg(int userId)
 {
     if (ShopConfig.ReadConfigInfo().OrderRecieveShippingDays > 0)
     {
         dal.CheckOrderRecieveTimeProg(userId);
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// 添加回复
        /// </summary>
        /// <param name="result"></param>
        public void AddProductReply(ref string result)
        {
            int    productID     = RequestHelper.GetQueryString <int>("ProductID");
            int    commentID     = RequestHelper.GetQueryString <int>("CommentID");
            string replytCookies = CookiesHelper.ReadCookieValue("ReplytCookies" + commentID.ToString());

            if (ShopConfig.ReadConfigInfo().ReplyRestrictTime > 0 && replytCookies != string.Empty)
            {
                result = "请不要频繁提交";
            }
            else
            {
                ProductReplyInfo productReply = new ProductReplyInfo();
                productReply.ProductID = productID;
                productReply.CommentID = commentID;
                productReply.Content   = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Content"));
                productReply.UserIP    = ClientHelper.IP;
                productReply.PostDate  = RequestHelper.DateNow;
                productReply.UserID    = base.UserID;
                productReply.UserName  = base.UserName;
                ProductReplyBLL.AddProductReply(productReply);
                if (ShopConfig.ReadConfigInfo().ReplyRestrictTime > 0)
                {
                    CookiesHelper.AddCookie("ReplytCookies" + commentID.ToString(), "ReplytCookies" + commentID.ToString(), ShopConfig.ReadConfigInfo().ReplyRestrictTime, TimeType.Second);
                }
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 检查指定用户的待付款订单是否超时失效,已超时则更新为失效状态
        /// </summary>
        public static void CheckOrderPayTime(int userId)
        {
            int orderPayTime = ShopConfig.ReadConfigInfo().OrderPayTime;

            #region Dapper ORM
            ////付款时限>0才启用
            //if (orderPayTime > 0)
            //{
            //    //待付款且未删除的订单
            //    List<OrderInfo> orderList = SearchList(new OrderSearchInfo { OrderStatus = (int)OrderStatus.WaitPay,UserId=userId });
            //    if (orderList.Count > 0)
            //    {
            //        int[] Ids = orderList.Where(k => k.AddDate.AddHours(orderPayTime) <= DateTime.Now).Select(k => k.Id).ToArray();
            //        CheckOrderPayTime(Ids);
            //    }
            //}
            #endregion
            #region 存储过程
            if (orderPayTime > 0)
            {
                dal.CheckOrderPayTimeProg(userId);
            }

            #endregion
        }
Exemplo n.º 14
0
        protected override void PostBack()
        {
            string imageUrl = "http://" + Request.Url.Host + ShopConfig.ReadConfigInfo().LittlePrgCode;
            string picName  = Guid.NewGuid().ToString("N") + ".jpg";

            WriteResponse(picName, GetImageContent(imageUrl));
        }
Exemplo n.º 15
0
        public void AddProductComment(ref string result)
        {
            int    queryString = RequestHelper.GetQueryString <int>("ProductID");
            string str         = CookiesHelper.ReadCookieValue("CommentCookies" + queryString.ToString());

            if ((ShopConfig.ReadConfigInfo().CommentRestrictTime > 0) && (str != string.Empty))
            {
                result = "Ç벻ҪƵ·±Ìá½»";
            }
            else
            {
                ProductCommentInfo productComment = new ProductCommentInfo();
                productComment.ProductID         = queryString;
                productComment.Title             = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Title"));
                productComment.Content           = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Content"));
                productComment.UserIP            = ClientHelper.IP;
                productComment.PostDate          = RequestHelper.DateNow;
                productComment.Support           = 0;
                productComment.Against           = 0;
                productComment.Status            = ShopConfig.ReadConfigInfo().CommentDefaultStatus;
                productComment.Rank              = RequestHelper.GetQueryString <int>("Rank");
                productComment.ReplyCount        = 0;
                productComment.AdminReplyContent = string.Empty;
                productComment.AdminReplyDate    = RequestHelper.DateNow;
                productComment.UserID            = base.UserID;
                productComment.UserName          = base.UserName;
                ProductCommentBLL.AddProductComment(productComment);
                if (ShopConfig.ReadConfigInfo().CommentRestrictTime > 0)
                {
                    CookiesHelper.AddCookie("CommentCookies" + queryString.ToString(), "CommentCookies" + queryString.ToString(), ShopConfig.ReadConfigInfo().CommentRestrictTime, TimeType.Second);
                }
            }
        }
Exemplo n.º 16
0
        protected void SubmitButton_Click(object sender, EventArgs E)
        {
            string    oldPassword = StringHelper.Password(Password.Text, (PasswordType)ShopConfig.ReadConfigInfo().PasswordType);
            string    newPassword = StringHelper.Password(NewPassword.Text, (PasswordType)ShopConfig.ReadConfigInfo().PasswordType);
            AdminInfo admin       = AdminBLL.Read(Cookies.Admin.GetAdminID(false));

            if (admin.Password == oldPassword)
            {
                AdminBLL.ChangePassword(Cookies.Admin.GetAdminID(false), oldPassword, newPassword);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("ChangePassword"));
                Task.Run(() => {
                    //安全码
                    ShopConfigInfo config = ShopConfig.ReadConfigInfo();
                    config.SecureKey      = Convert.ToBase64String(Guid.NewGuid().ToByteArray());
                    ShopConfig.UpdateConfigInfo(config);
                });
                //清除现有cookie
                CookiesHelper.DeleteCookie(ShopConfig.ReadConfigInfo().AdminCookies);
                ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl);
            }
            else
            {
                ScriptHelper.Alert(ShopLanguage.ReadLanguage("OldPasswordError"), RequestHelper.RawUrl);
            }
        }
Exemplo n.º 17
0
 /// <summary>
 /// 返佣操作
 /// </summary>
 /// <param name="distributor"></param>
 /// <param name="paid_money"></param>
 /// <param name="distributor_grade_list"></param>
 private static void Receive_Shipping_Rebate(UserInfo distributor, UserInfo buy_user, decimal paid_money, int order_id, List <DistributorGradeInfo> distributor_grade_list, int distributor_level = 1)
 {
     if (distributor.Distributor_Status == (int)Distributor_Status.Normal && paid_money > 0)
     {
         decimal first_level_percent  = ShopConfig.ReadConfigInfo().FirstLevelDistributorRebatePercent / 100.00M;
         decimal second_level_percent = ShopConfig.ReadConfigInfo().SecondLevelDistributorRebatePercent / 100.00M;
         decimal level_rebate         = 0;
         //先根据分销商级别返佣
         if (distributor_level == 1)
         {
             level_rebate = paid_money * first_level_percent;
         }
         if (distributor_level == 2)
         {
             level_rebate = paid_money * second_level_percent;
         }
         //分销商等级判断,另算等级返佣
         var     dis_grade        = distributor_grade_list.Where(d => distributor.Total_Commission >= d.Min_Amount && distributor.Total_Commission < d.Max_Amount).FirstOrDefault() ?? new DistributorGradeInfo();
         decimal percent          = dis_grade.Discount / 100.00M;
         decimal commission_amout = level_rebate * percent;
         //返佣
         Add(new RebateInfo
         {
             Distributor_Id = distributor.Id,
             User_Id        = buy_user.Id,
             Order_Id       = order_id,
             Commission     = commission_amout + level_rebate,
             Time           = DateTime.Now
         });
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// 检查cookies
        /// </summary>
        /// <returns></returns>
        private void ReadUserCookies()
        {
            string cookiesName  = ShopConfig.ReadConfigInfo().UserCookies;
            string cookiesValue = CookiesHelper.ReadCookieValue(cookiesName);

            if (cookiesValue != string.Empty)
            {
                try
                {
                    string[] strArray = cookiesValue.Split(new char[] { '|' });
                    string   sign     = strArray[0];
                    string   userID   = strArray[1];
                    string   userName = strArray[2];
                    if (FormsAuthentication.HashPasswordForStoringInConfigFile(userID + userName + ShopConfig.ReadConfigInfo().SecureKey + ClientHelper.Agent, "MD5").ToLower() == sign.ToLower())
                    {
                        UserId   = Convert.ToInt32(userID);
                        UserName = HttpContext.Current.Server.UrlDecode(userName);
                    }
                    else
                    {
                        CookiesHelper.DeleteCookie(cookiesName);
                    }
                }
                catch
                {
                    CookiesHelper.DeleteCookie(cookiesName);
                }
            }
        }
Exemplo n.º 19
0
 /// <summary>
 /// 发送Email,保存发送状态,发送时间
 /// </summary>
 /// <param name="emailSendRecord"></param>
 public static EmailSendRecordInfo SendEmail(EmailSendRecordInfo emailSendRecord)
 {
     //发送
     foreach (string temp in emailSendRecord.EmailList.Split(','))
     {
         if (temp != string.Empty)
         {
             MailInfo mail = new MailInfo();
             mail.ToEmail = temp;
             mail.Title   = emailSendRecord.Title;
             mail.Content = emailSendRecord.Content;
             if (emailSendRecord.IsStatisticsOpendEmail == (int)BoolType.True)
             {
                 mail.Content += "<img style=\"display:none\" src=\"http://" + HttpContext.Current.Request.ServerVariables["Http_Host"] + "/Admin/EmailCheckOpen.aspx?Email=" + temp + "&ID=" + emailSendRecord.ID + "\" >";
             }
             mail.UserName   = ShopConfig.ReadConfigInfo().EmailUserName;
             mail.Password   = ShopConfig.ReadConfigInfo().EmailPassword;
             mail.Server     = ShopConfig.ReadConfigInfo().EmailServer;
             mail.ServerPort = ShopConfig.ReadConfigInfo().EmailServerPort;
             try
             {
                 MailClass.SendEmail(mail);
             }
             catch (Exception ex)
             {
                 ExceptionHelper.ProcessException(ex, true);
             }
         }
     }
     //保存状态
     emailSendRecord.SendDate   = RequestHelper.DateNow;
     emailSendRecord.SendStatus = (int)SendStatus.Finished;
     EmailSendRecordBLL.SaveEmailSendRecordStatus(emailSendRecord);
     return(emailSendRecord);
 }
Exemplo n.º 20
0
 public static EmailSendRecordInfo SendEmail(EmailSendRecordInfo emailSendRecord)
 {
     foreach (string str in emailSendRecord.EmailList.Split(new char[] { ',' }))
     {
         if (str != string.Empty)
         {
             MailInfo mail = new MailInfo();
             mail.ToEmail = str;
             mail.Title   = emailSendRecord.Title;
             mail.Content = emailSendRecord.Content;
             if (emailSendRecord.IsStatisticsOpendEmail == 1)
             {
                 object content = mail.Content;
                 mail.Content = string.Concat(new object[] { content, "<img style=\"display:none\" src=\"http://", HttpContext.Current.Request.ServerVariables["Http_Host"], "/Admin/EmailCheckOpen.aspx?Email=", str, "&ID=", emailSendRecord.ID, "\" >" });
             }
             mail.UserName   = ShopConfig.ReadConfigInfo().EmailUserName;
             mail.Password   = ShopConfig.ReadConfigInfo().EmailPassword;
             mail.Server     = ShopConfig.ReadConfigInfo().EmailServer;
             mail.ServerPort = ShopConfig.ReadConfigInfo().EmailServerPort;
             try
             {
                 MailClass.SendEmail(mail);
             }
             catch (Exception exception)
             {
                 ExceptionHelper.ProcessException(exception, true);
             }
         }
     }
     emailSendRecord.SendDate   = RequestHelper.DateNow;
     emailSendRecord.SendStatus = 3;
     SaveEmailSendRecordStatus(emailSendRecord);
     return(emailSendRecord);
 }
Exemplo n.º 21
0
        public void AgainstComment()
        {
            string content = string.Empty;

            if ((ShopConfig.ReadConfigInfo().AllowAnonymousCommentOperate == 0) && (base.UserID == 0))
            {
                content = "»¹Î´µÇ¼";
            }
            else
            {
                int    queryString = RequestHelper.GetQueryString <int>("CommentID");
                string str2        = CookiesHelper.ReadCookieValue("CommentOperateCookies" + queryString.ToString());
                if ((ShopConfig.ReadConfigInfo().CommentOperateRestrictTime > 0) && (str2 != string.Empty))
                {
                    content = "Ç벻ҪƵ·±Ìá½»";
                }
                else
                {
                    ProductCommentBLL.ChangeProductCommentAgainstCount(queryString.ToString(), ChangeAction.Plus);
                    if (ShopConfig.ReadConfigInfo().CommentOperateRestrictTime > 0)
                    {
                        CookiesHelper.AddCookie("CommentOperateCookies" + queryString.ToString(), "CommentOperateCookies" + queryString.ToString(), ShopConfig.ReadConfigInfo().CommentOperateRestrictTime, TimeType.Second);
                    }
                    content = "ok";
                }
            }
            ResponseHelper.Write(content);
            ResponseHelper.End();
        }
Exemplo n.º 22
0
        public void AddTags(ref string result)
        {
            int    queryString = RequestHelper.GetQueryString <int>("ProductID");
            string str         = CookiesHelper.ReadCookieValue("TagsCookies" + queryString.ToString());

            if ((ShopConfig.ReadConfigInfo().AddTagsRestrictTime > 0) && (str != string.Empty))
            {
                result = "Ç벻ҪƵ·±Ìá½»";
            }
            else
            {
                TagsInfo tags = new TagsInfo();
                tags.ProductID = queryString;
                tags.Word      = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Word"));
                tags.Color     = "#4C5A62";
                tags.Size      = 12;
                tags.IsTop     = 0;
                tags.UserID    = base.UserID;
                tags.UserName  = base.UserName;
                TagsBLL.AddTags(tags);
                if (ShopConfig.ReadConfigInfo().AddTagsRestrictTime > 0)
                {
                    CookiesHelper.AddCookie("TagsCookies" + queryString.ToString(), "TagsCookies" + queryString.ToString(), ShopConfig.ReadConfigInfo().AddTagsRestrictTime, TimeType.Second);
                }
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// 添加评论
        /// </summary>
        /// <param name="result"></param>
        public void AddProductComment(ref string result)
        {
            int    productID      = RequestHelper.GetQueryString <int>("ProductID");
            int    orderID        = RequestHelper.GetQueryString <int>("OrderID");
            string commentCookies = CookiesHelper.ReadCookieValue("CommentCookies" + productID.ToString());

            if (ShopConfig.ReadConfigInfo().CommentRestrictTime > 0 && commentCookies != string.Empty)
            {
                result = "请不要频繁提交";
            }
            else
            {
                ProductCommentInfo productComment = new ProductCommentInfo();
                productComment.ProductId         = productID;
                productComment.Title             = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Title"));
                productComment.Content           = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Content"));
                productComment.UserIP            = ClientHelper.IP;
                productComment.PostDate          = RequestHelper.DateNow;
                productComment.Support           = 0;
                productComment.Against           = 0;
                productComment.Status            = ShopConfig.ReadConfigInfo().CommentDefaultStatus;
                productComment.Rank              = RequestHelper.GetQueryString <int>("Rank");
                productComment.ReplyCount        = 0;
                productComment.AdminReplyContent = string.Empty;
                productComment.AdminReplyDate    = RequestHelper.DateNow;
                productComment.UserId            = base.UserId;
                productComment.UserName          = base.UserName;
                productComment.OrderId           = orderID;
                ProductCommentBLL.Add(productComment);
                if (ShopConfig.ReadConfigInfo().CommentRestrictTime > 0)
                {
                    CookiesHelper.AddCookie("CommentCookies" + productID.ToString(), "CommentCookies" + productID.ToString(), ShopConfig.ReadConfigInfo().CommentRestrictTime, TimeType.Second);
                }
            }
        }
Exemplo n.º 24
0
        protected override void PostBack()
        {
            string newPassword  = RequestHelper.GetForm <string>("NewPassword");
            string newPassword2 = RequestHelper.GetForm <string>("NewPassword2");

            //如果账号不存在
            if (!string.Equals(newPassword, newPassword2, StringComparison.OrdinalIgnoreCase))
            {
                ScriptHelper.AlertFront("两次密码不一致");
            }
            else
            {
                // 验证通过,重置密码

                string checkCode = RequestHelper.GetForm <string>("CheckCode");
                string decode    = StringHelper.Decode(checkCode, ShopConfig.ReadConfigInfo().SecureKey);
                int    adminID   = Convert.ToInt32(decode.Split('|')[0]);
                newPassword = StringHelper.Password(newPassword, (PasswordType)ShopConfig.ReadConfigInfo().PasswordType);
                // 重置密码
                AdminBLL.ChangePassword(adminID, newPassword);
                //清空safecode,finddate恢复
                AdminBLL.ChangeAdminSafeCode(adminID, string.Empty, RequestHelper.DateNow);
                //错误次数清零,解锁
                AdminBLL.UpdateStatus(adminID);
                string msg = "ok";
                //清除原有的user Cookies
                CookiesHelper.DeleteCookie(ShopConfig.ReadConfigInfo().AdminCookies);
                CookiesHelper.DeleteCookie("AdminSign");

                ResponseHelper.Redirect("/mobileadmin/ResetPassword.html?Result=" + Server.UrlEncode(msg));
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// ajaxfileUpload 上传图片
        /// </summary>
        /// <returns></returns>
        protected void UploadPhoto()
        {
            var    flag         = true;
            string originalFile = string.Empty;

            if (HttpContext.Current.Request.Files[0].FileName != string.Empty)
            {
                try
                {
                    //上传文件
                    UploadHelper upload = new UploadHelper();
                    upload.Path     = "/Upload/UserPhoto/Original/";
                    upload.FileType = ShopConfig.ReadConfigInfo().UploadFile;
                    FileInfo file = upload.SaveAs();
                    //生成处理
                    originalFile = upload.Path + file.Name;
                    string otherFile          = string.Empty;
                    string makeFile           = string.Empty;
                    Dictionary <int, int> dic = new Dictionary <int, int>();
                    dic.Add(70, 70);
                    dic.Add(190, 190);
                    foreach (KeyValuePair <int, int> kv in dic)
                    {
                        makeFile   = originalFile.Replace("Original", kv.Key.ToString() + "-" + kv.Value.ToString());
                        otherFile += makeFile + "|";
                        ImageHelper.MakeThumbnailImage(ServerHelper.MapPath(originalFile), ServerHelper.MapPath(makeFile), kv.Key, kv.Value, ThumbnailType.InBox);
                    }
                    otherFile = otherFile.Substring(0, otherFile.Length - 1);
                    //保存数据库
                    UploadInfo tempUpload = new UploadInfo();
                    tempUpload.TableID    = UserBLL.TableID;
                    tempUpload.ClassID    = 0;
                    tempUpload.RecordID   = 0;
                    tempUpload.UploadName = originalFile;
                    tempUpload.OtherFile  = otherFile;
                    tempUpload.Size       = Convert.ToInt32(file.Length);
                    tempUpload.FileType   = file.Extension;
                    tempUpload.Date       = RequestHelper.DateNow;
                    tempUpload.IP         = ClientHelper.IP;
                    UploadBLL.AddUpload(tempUpload);
                }
                catch (Exception ex)
                {
                    ExceptionHelper.ProcessException(ex, false);
                }
            }
            if (!string.IsNullOrEmpty(originalFile))
            {
                flag = true;
            }
            else
            {
                flag = false;
            }
            //return originalFile;
            Response.Clear();
            Response.Write(JsonConvert.SerializeObject(new { flag = flag, imgPath = originalFile }));
            Response.End();
        }
Exemplo n.º 26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("LogoutSystem"));
     CookiesHelper.DeleteCookie(ShopConfig.ReadConfigInfo().UserCookies);
     CookiesHelper.DeleteCookie("SMSIsChecked");
     CookiesHelper.DeleteCookie("SMSCheckCode");
     ResponseHelper.Redirect("Login.aspx");
 }
Exemplo n.º 27
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            string checkCode = RequestHelper.GetQueryString <string>("CheckCode");

            if (checkCode != string.Empty)
            {
                string decode = StringHelper.Decode(checkCode, ShopConfig.ReadConfigInfo().SecureKey);
                if (decode.IndexOf('|') > 0)
                {
                    int    userID = Convert.ToInt32(decode.Split('|')[0]);
                    string email  = decode.Split('|')[1];

                    string   safeCode = decode.Split('|')[2];
                    UserInfo user     = UserBLL.ReadUserMore(userID);
                    if (user.Id > 0 && safeCode == user.SafeCode)
                    {
                        if (ShopConfig.ReadConfigInfo().BindEmailTime > 0 && user.FindDate.AddHours(ShopConfig.ReadConfigInfo().BindEmailTime) < RequestHelper.DateNow)
                        {
                            result = "信息过时,<a href=\"/user/UpdateEmail.html\">请重新申请验证邮箱</a>";
                        }
                        else
                        {
                            if (string.IsNullOrEmpty(email))
                            {
                                result = "错误的信息";
                            }
                            else if (!new Regex("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{2,3}){1,2})$").IsMatch(email))
                            {
                                result = "错误的信息";
                            }
                            else
                            {
                                if (!UserBLL.CheckEmail(email, user.Id))
                                {
                                    result = "此邮箱已被其他会员绑定";
                                }
                                else
                                {
                                    user.Email = email;
                                    UserBLL.Update(user);
                                    CookiesHelper.AddCookie("UserEmail", user.Email);
                                    result = "恭喜您,邮箱验证成功!您可进入<a href=\"/user/useradd.html\">个人信息</a>查看刚才绑定的邮箱";
                                }
                            }
                        }
                    }
                    else
                    {
                        result = "错误的信息";
                    }
                }
                else
                {
                    result = "错误的信息";
                }
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// 显示库存数量
        /// </summary>
        protected string ShowStorageCount(int storageCount, int importActualStorageCount)
        {
            int tempStorageCount = storageCount;

            if (ShopConfig.ReadConfigInfo().ProductStorageType == (int)ProductStorageType.ImportStorageSystem)
            {
                tempStorageCount = importActualStorageCount;
            }
            return(tempStorageCount.ToString());
        }
Exemplo n.º 29
0
        public static string ReadUserPhoto(string size)
        {
            string str = CookiesHelper.ReadCookieValue("UserPhoto");

            if (str == string.Empty)
            {
                return("/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/Style/Images/NoImage.gif");
            }
            return(str.Replace("Original", size));
        }
Exemplo n.º 30
0
        protected string ShowStorageCount(int storageCount, int importActualStorageCount)
        {
            int num = storageCount;

            if (ShopConfig.ReadConfigInfo().ProductStorageType == 2)
            {
                num = importActualStorageCount;
            }
            return(num.ToString());
        }