示例#1
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request["isCallback"]) && base.Request["isCallback"] == "true")
     {
         string a   = base.Request["ctype"];
         string arg = "";
         if (a == "CheckRole")
         {
             if (!this.CheckRole())
             {
                 arg = "0";
             }
             else
             {
                 arg = "1";
             }
         }
         base.Response.Clear();
         base.Response.ContentType = "application/json";
         base.Response.Write("{ ");
         base.Response.Write(string.Format("\"flag\":\"{0}\"", arg));
         base.Response.Write("}");
         base.Response.End();
     }
     Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.HiContext.Current.User;
     if (!user.IsInRole("供应商"))
     {
         this.Page.Response.Redirect("login.aspx");
         return;
     }
     this.Page.Response.Redirect("default.html");
 }
示例#2
0
        private void btnSendEmail_Click(object sender, System.EventArgs e)
        {
            Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.HiContext.Current.SiteSettings;
            Hidistro.Membership.Core.IUser           user         = Hidistro.Membership.Context.Users.FindUserByUsername(this.txtUserName.Text.Trim());
            ForgotPassword.emailCode = Hidistro.Membership.Context.HiContext.Current.CreateVerifyCode(6);
            string     body = string.Format("亲爱的{0}:<br>您好!感谢您使用{1}。<br>您正在进行账户基础信息维护,请在校验码输入框中输入:{2},以完成操作。 <br>注意:此操作可能会修改您的密码、登录邮箱或绑定手机。如非本人操作,请及时登录并修改密码以保证账户安全。(工作人员不会向您索取此校验码,请勿泄漏!) ", user.Username, siteSettings.SiteName, ForgotPassword.emailCode);
            string     text;
            SendStatus sendStatus = Messenger.SendMail("验证码", body, user.Email, siteSettings, out text);

            if (sendStatus == SendStatus.NoProvider || sendStatus == SendStatus.ConfigError)
            {
                this.ShowMessage("后台设置错误,请自行联系后台管理员", false);
            }
            else
            {
                if (sendStatus == SendStatus.Fail)
                {
                    this.ShowMessage("发送失败", false);
                }
                else
                {
                    if (sendStatus == SendStatus.Success)
                    {
                        this.ShowMessage("发送成功", true);
                    }
                }
            }
        }
示例#3
0
 private void btnSetPassword_Click(object sender, System.EventArgs e)
 {
     Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.FindUserByUsername(this.txtUserName.Text.Trim());
     if (string.IsNullOrEmpty(this.txtPassword.Text.Trim()) || string.IsNullOrEmpty(this.txtRePassword.Text.Trim()))
     {
         this.ShowMessage("密码不允许为空!", false);
     }
     else
     {
         if (this.txtPassword.Text.Trim() != this.txtRePassword.Text.Trim())
         {
             this.ShowMessage("两次输入的密码需一致", false);
         }
         else
         {
             if (this.txtPassword.Text.Length < System.Web.Security.Membership.Provider.MinRequiredPasswordLength || this.txtPassword.Text.Length > HiConfiguration.GetConfig().PasswordMaxLength)
             {
                 this.ShowMessage(string.Format("密码的长度只能在{0}和{1}个字符之间", System.Web.Security.Membership.Provider.MinRequiredPasswordLength, HiConfiguration.GetConfig().PasswordMaxLength), false);
             }
             else
             {
                 bool flag = false;
                 if (this.dropType.SelectedIndex == 0)
                 {
                     flag = user.ChangePasswordWithAnswer(this.txtUserAnswer.Text, this.txtPassword.Text);
                 }
                 else
                 {
                     if (user is Hidistro.Membership.Context.Member)
                     {
                         Hidistro.Membership.Context.Member member = user as Hidistro.Membership.Context.Member;
                         flag = member.ChangePasswordWithoutAnswer(this.txtPassword.Text);
                     }
                     else
                     {
                         if (user is Hidistro.Membership.Context.Distributor)
                         {
                             Hidistro.Membership.Context.Distributor distributor = user as Hidistro.Membership.Context.Distributor;
                             //flag = distributor.ChangePasswordWithoutAnswer(this.txtPassword.Text);
                         }
                         else
                         {
                             flag = user.ChangePassword(this.txtPassword.Text);
                         }
                     }
                 }
                 if (flag)
                 {
                     Messenger.UserPasswordForgotten(user, this.txtPassword.Text);
                     this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("ForgotPasswordSuccess") + string.Format("?UserName={0}", user.Username));
                 }
                 else
                 {
                     this.ShowMessage("登录密码修改失败,请重试", false);
                 }
             }
         }
     }
 }
 private void UserPayOrder()
 {
     if (this.Order.OrderStatus == OrderStatus.BuyerAlreadyPaid)
     {
         this.ResponseStatus(true, "success");
     }
     else
     {
         int num  = 0;
         int num2 = 0;
         int num3 = 0;
         if (this.Order.GroupBuyId > 0)
         {
             GroupBuyInfo groupBuy = TradeHelper.GetGroupBuy(this.Order.GroupBuyId);
             if (groupBuy == null || groupBuy.Status != GroupBuyStatus.UnderWay)
             {
                 this.ResponseStatus(false, "groupbuyalreadyfinished");
                 return;
             }
             num2 = TradeHelper.GetOrderCount(this.Order.GroupBuyId);
             num3 = this.Order.GetGroupBuyOerderNumber();
             num  = groupBuy.MaxCount;
             if (num < num2 + num3)
             {
                 this.ResponseStatus(false, "exceedordermax");
                 return;
             }
         }
         if (this.Order.CheckAction(OrderActions.BUYER_PAY) && TradeHelper.UserPayOrder(this.Order, false))
         {
             TradeHelper.SaveDebitNote(new DebitNote
             {
                 NoteId   = Globals.GetGenerateId(),
                 OrderId  = this.Order.OrderId,
                 Operator = this.Order.Username,
                 Remark   = "客户订单在线支付成功"
             });
             if (this.Order.GroupBuyId > 0 && num == num2 + num3)
             {
                 TradeHelper.SetGroupBuyEndUntreated(this.Order.GroupBuyId);
             }
             if (this.Order.UserId != 0 && this.Order.UserId != 1100)
             {
                 Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(this.Order.UserId);
                 if (user != null && (user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling))
                 {
                     Messenger.OrderPayment(user, this.Order.OrderId, this.Order.GetTotal());
                 }
             }
             this.Order.OnPayment();
             this.ResponseStatus(true, "success");
         }
         else
         {
             this.ResponseStatus(false, "fail");
         }
     }
 }
示例#5
0
 private void btnSendMobile_Click(object sender, System.EventArgs e)
 {
     Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.HiContext.Current.SiteSettings;
     Hidistro.Membership.Core.IUser           user         = Hidistro.Membership.Context.Users.FindUserByUsername(this.txtUserName.Text.Trim());
     if (user is Hidistro.Membership.Context.Member)
     {
         Hidistro.Membership.Context.Member member = user as Hidistro.Membership.Context.Member;
         ForgotPassword.mobileCode = Hidistro.Membership.Context.HiContext.Current.CreateVerifyCode(6);
         string     text;
         SendStatus sendStatus = Messenger.SendSMS(member.CellPhone, "您本次的验证码是:" + ForgotPassword.mobileCode, siteSettings, out text);
         if (sendStatus == SendStatus.NoProvider || sendStatus == SendStatus.ConfigError)
         {
             this.ShowMessage("后台设置错误,请自行联系后台管理员", false);
         }
         else
         {
             if (sendStatus == SendStatus.Fail)
             {
                 this.ShowMessage("发送失败", false);
             }
             else
             {
                 if (sendStatus == SendStatus.Success)
                 {
                     this.ShowMessage("发送成功", true);
                 }
             }
         }
     }
     else
     {
         if (user is Hidistro.Membership.Context.Distributor)
         {
             Hidistro.Membership.Context.Distributor distributor = user as Hidistro.Membership.Context.Distributor;
             ForgotPassword.mobileCode = Hidistro.Membership.Context.HiContext.Current.CreateVerifyCode(6);
             string     text;
             SendStatus sendStatus = Messenger.SendSMS(distributor.CellPhone, "您本次的验证码是:" + ForgotPassword.mobileCode, siteSettings, out text);
             if (sendStatus == SendStatus.NoProvider || sendStatus == SendStatus.ConfigError)
             {
                 this.ShowMessage("后台设置错误,请自行联系后台管理员", false);
             }
             else
             {
                 if (sendStatus == SendStatus.Fail)
                 {
                     this.ShowMessage("发送失败", false);
                 }
                 else
                 {
                     if (sendStatus == SendStatus.Success)
                     {
                         this.ShowMessage("发送成功", true);
                     }
                 }
             }
         }
     }
 }
示例#6
0
 private void BindAnswerAndQuestion()
 {
     Hidistro.Membership.Core.IUser user = Users.GetUser(HiContext.Current.User.UserId, false);
     if (user != null)
     {
         this.tblrOldQuestion.Visible = (this.tblrOldAnswer.Visible = !string.IsNullOrEmpty(user.PasswordQuestion));
         this.litOldQuestion.Text     = user.PasswordQuestion;
     }
 }
示例#7
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.HiContext.Current.User;
     if (user.IsInRole("供应商") || user.IsInRole("区域发货点"))
     {
         this.Page.Response.Redirect(Globals.GetAdminAbsolutePath("/Login.aspx"));
     }
     this.litMessage.Text = string.Format("您登录的管理员帐号 “{0}” 没有权限访问当前页面或进行当前操作", Hidistro.Membership.Context.HiContext.Current.User.Username);
 }
示例#8
0
        private void btnAdminLogin_Click(object sender, System.EventArgs e)
        {
            if (!Hidistro.Membership.Context.HiContext.Current.CheckVerifyCode(this.txtCode.Text.Trim()))
            {
                this.ShowMessage("验证码不正确");
                return;
            }
            Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(0, this.txtAdminName.Text, false, true);
            if (user == null || user.IsAnonymous || user.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager || !user.IsInRole("区域发货点"))
            {
                this.ShowMessage("无效的用户信息");
                return;
            }
            string text = null;

            Hidistro.Membership.Context.SiteManager siteManager = user as Hidistro.Membership.Context.SiteManager;
            siteManager.Password = this.txtAdminPassWord.Text;
            Hidistro.Membership.Core.Enums.LoginUserStatus loginUserStatus = ManagerHelper.ValidLogin(siteManager);
            if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.Success)
            {
                System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(siteManager.Username, false);
                Hidistro.Membership.Core.IUserCookie userCookie = siteManager.GetUserCookie();
                userCookie.WriteCookie(authCookie, 30, false);
                Hidistro.Membership.Context.HiContext.Current.User = siteManager;
                if (!string.IsNullOrEmpty(this.Page.Request.QueryString["returnUrl"]))
                {
                    text = this.Page.Request.QueryString["returnUrl"];
                }
                if (text == null && this.ReferralLink != null && !string.IsNullOrEmpty(this.ReferralLink.Trim()))
                {
                    text = this.ReferralLink;
                }
                if (!string.IsNullOrEmpty(text) && (text.ToLower().IndexOf(Globals.GetSiteUrls().Logout.ToLower()) >= 0 || text.ToLower().IndexOf(Globals.GetSiteUrls().UrlData.FormatUrl("register").ToLower()) >= 0 || text.ToLower().IndexOf(Globals.GetSiteUrls().UrlData.FormatUrl("vote").ToLower()) >= 0 || text.ToLower().IndexOf("loginexit") >= 0))
                {
                }
                this.Page.Response.Redirect("default.html", true);
                return;
            }
            if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountPending)
            {
                this.ShowMessage("用户账号还没有通过审核");
                return;
            }
            if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountLockedOut)
            {
                this.ShowMessage("用户账号已被锁定,暂时不能登录系统");
                return;
            }
            if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.InvalidCredentials)
            {
                this.ShowMessage("用户名或密码错误");
                return;
            }
            this.ShowMessage("登录失败,未知错误");
        }
示例#9
0
 private void btnCheckAnswer_Click(object sender, System.EventArgs e)
 {
     Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.FindUserByUsername(this.txtUserName.Text.Trim());
     if (user.MembershipUser.ValidatePasswordAnswer(this.txtUserAnswer.Text.Trim()))
     {
         this.panelShow("InputPassword");
     }
     else
     {
         this.litAnswerMessage.Visible = true;
     }
 }
示例#10
0
 protected override void OnInit(System.EventArgs e)
 {
     Hidistro.Membership.Core.IUser contexUser = Hidistro.Membership.Context.Users.GetContexUser();
     if (!Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && contexUser.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager)
     {
         this.Page.Response.Redirect(Globals.GetAdminAbsolutePath("login.aspx"), true);
     }
     if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && contexUser.UserRole != Hidistro.Membership.Core.Enums.UserRole.Distributor)
     {
         this.Page.Response.Redirect(Globals.ApplicationPath + "Shopadmin/DistributorLogin.aspx", true);
     }
 }
 private void LoadOldControl()
 {
     Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(Hidistro.Membership.Context.HiContext.Current.User.UserId, false);
     if (user != null)
     {
         this.ulOld.Visible       = !string.IsNullOrEmpty(user.PasswordQuestion);
         this.litOldQuestion.Text = user.PasswordQuestion;
         this.txtOldAnswer.Text   = string.Empty;
         this.txtNewQuestion.Text = string.Empty;
         this.txtNewAnswer.Text   = string.Empty;
     }
 }
示例#12
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.hlinkProductOfTitle   = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkProductOfTitle");
     this.hlinkProductOfContext = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkProductOfContext");
     this.hlinkHome             = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkHome");
     this.litProductUrl         = (System.Web.UI.WebControls.Literal) this.FindControl("litProductUrl");
     this.txtFriendEmail        = (System.Web.UI.WebControls.TextBox) this.FindControl("txtFriendEmail");
     this.txtFriendName         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtFriendName");
     this.txtUserName           = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtMessage            = (System.Web.UI.WebControls.TextBox) this.FindControl("txtMessage");
     this.btnRefer        = (System.Web.UI.WebControls.Button) this.FindControl("btnRefer");
     this.txtTJCode       = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtTJCode");
     this.btnRefer.Click += new System.EventHandler(this.btnRefer_Click);
     if (!this.Page.IsPostBack)
     {
         ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);
         if (productSimpleInfo != null)
         {
             Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.HiContext.Current.User;
             this.txtUserName.Text                = user.Username;
             this.hlinkProductOfTitle.Text        = productSimpleInfo.ProductName;
             this.hlinkProductOfTitle.NavigateUrl = Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
             {
                 this.productId
             });
             this.hlinkProductOfContext.Text        = productSimpleInfo.ProductName;
             this.hlinkProductOfContext.NavigateUrl = Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
             {
                 this.productId
             });
             this.hlinkHome.NavigateUrl = Globals.GetSiteUrls().UrlData.FormatUrl("home");
             this.hlinkHome.Text        = Hidistro.Membership.Context.HiContext.Current.SiteSettings.SiteName;
             this.txtTJCode.Value       = string.Empty;
             if (user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling)
             {
                 this.litProductUrl.Text = Globals.FullPath(System.Web.HttpContext.Current.Request.Url.PathAndQuery).Replace("IntroducedToFriend", "productDetails") + "&ReferralUserId=" + user.UserId;
             }
             else
             {
                 this.litProductUrl.Text = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                 {
                     this.productId
                 }));
             }
             PageTitle.AddSiteNameTitle(productSimpleInfo.ProductName + " 推荐给好友", Hidistro.Membership.Context.HiContext.Current.Context);
         }
     }
 }
示例#13
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productID"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.lblProductNameLinkText = (System.Web.UI.WebControls.Label) this.FindControl("lblProductNameLinkText");
     this.hlinkProductTitle      = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkProductTitle");
     this.hlinkProductContent    = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkProductContent");
     this.lblImgUrl = (System.Web.UI.WebControls.Label) this.FindControl("lblImgUrl");
     this.lblUrl    = (System.Web.UI.WebControls.Label) this.FindControl("lblUrl");
     this.lblUrl2   = (System.Web.UI.WebControls.Label) this.FindControl("lblUrl2");
     this.imgUrl    = (HiImage)this.FindControl("imgUrl");
     if (!this.Page.IsPostBack)
     {
         ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);
         if (productSimpleInfo == null)
         {
             base.GotoResourceNotFound();
         }
         PageTitle.AddSiteNameTitle(productSimpleInfo.ProductName + " 推荐到博客", Hidistro.Membership.Context.HiContext.Current.Context);
         string text = "productDetails";
         if (productSimpleInfo.SaleStatus == ProductSaleStatus.UnSale)
         {
             text = "unproductdetails";
         }
         string text2 = Globals.GetSiteUrls().UrlData.FormatUrl(text, new object[]
         {
             this.productId
         });
         this.hlinkProductTitle.Text        = (this.hlinkProductContent.Text = productSimpleInfo.ProductName);
         this.hlinkProductTitle.NavigateUrl = (this.hlinkProductContent.NavigateUrl = text2);
         this.lblProductNameLinkText.Text   = string.Format("插入这段代码,可以在你的博客中显示“{0}”的文字链接", string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", text2, "Text"));
         this.imgUrl.ImageUrl = productSimpleInfo.ImageUrl1;
         if (!string.IsNullOrEmpty(productSimpleInfo.ImageUrl1))
         {
             this.lblImgUrl.Text = Globals.FullPath(Globals.ApplicationPath + this.imgUrl.ImageUrl);
         }
         Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.HiContext.Current.User;
         if (user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling)
         {
             this.lblUrl.Text = (this.lblUrl2.Text = Globals.FullPath(System.Web.HttpContext.Current.Request.Url.PathAndQuery).Replace("BlogIt", text) + "&ReferralUserId=" + user.UserId);
         }
         else
         {
             this.lblUrl.Text = (this.lblUrl2.Text = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl(text, new object[]
             {
                 this.productId
             })));
         }
     }
 }
示例#14
0
 public ApiErrorCode SendOrders(OrderInfo order, ShippingModeInfo shippingmode, string out_id, ExpressCompanyInfo express)
 {
     if (order.GroupBuyId > 0 && order.GroupBuyStatus != GroupBuyStatus.Success)
     {
         return(ApiErrorCode.Group_Error);
     }
     if (!order.CheckAction(OrderActions.SELLER_SEND_GOODS))
     {
         return(ApiErrorCode.NoPay_Error);
     }
     if (shippingmode.ModeId <= 0)
     {
         return(ApiErrorCode.NoShippingMode);
     }
     if (string.IsNullOrEmpty(out_id) || out_id.Length > 20)
     {
         return(ApiErrorCode.ShipingOrderNumber_Error);
     }
     order.RealShippingModeId = shippingmode.ModeId;
     order.RealModeName       = shippingmode.Name;
     order.ExpressCompanyName = express.Name;
     order.ExpressCompanyAbb  = express.Kuaidi100Code;
     order.ShipOrderNumber    = out_id;
     if (OrderHelper.SendAPIGoods(order))
     {
         if (!string.IsNullOrEmpty(order.GatewayOrderId) && order.GatewayOrderId.Trim().Length > 0)
         {
             PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(order.PaymentTypeId);
             if (paymentMode != null)
             {
                 PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), order.OrderId, order.GetTotal(), "订单发货", "订单号-" + order.OrderId, order.EmailAddress, order.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[]
                 {
                     paymentMode.Gateway
                 })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[]
                 {
                     paymentMode.Gateway
                 })), "");
                 paymentRequest.SendGoods(order.GatewayOrderId, order.RealModeName, order.ShipOrderNumber, "EXPRESS");
             }
         }
         int num = order.UserId;
         if (num == 1100)
         {
             num = 0;
         }
         Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num);
         Messenger.OrderShipping(order, user);
         order.OnDeliver();
         return(ApiErrorCode.Success);
     }
     return(ApiErrorCode.Unknown_Error);
 }
示例#15
0
 private void btnCloseOrder_Click(object sender, System.EventArgs e)
 {
     this.order.CloseReason = this.ddlCloseReason.SelectedValue;
     if (OrderHelper.CloseTransaction(this.order))
     {
         Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(this.order.UserId);
         Messenger.OrderClosed(user, this.order.OrderId, this.order.CloseReason);
         this.order.OnClosed();
         this.ShowMsg("关闭订单成功", true);
         return;
     }
     this.ShowMsg("关闭订单失败", false);
 }
示例#16
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Hidistro.Membership.Core.IUser user      = Hidistro.Membership.Context.Users.GetUser(0, Hidistro.Membership.Context.Users.GetLoggedOnUsername(), true, true);
            System.Collections.Hashtable   hashtable = new System.Collections.Hashtable();
            if (user.UserRole != Hidistro.Membership.Core.Enums.UserRole.Distributor)
            {
                base.Response.Write("没有权限!");
                base.Response.End();
                return;
            }
            string a = "false";

            if (base.Request.QueryString["isAdvPositions"] != null)
            {
                a = base.Request.QueryString["isAdvPositions"].ToString().ToLower().Trim();
            }
            string path;
            string url;

            if (a == "false")
            {
                path = string.Format("~/Storage/sites/{0}/fckfiles/", user.UserId);
                url  = string.Format("/Storage/sites/{0}/fckfiles/", user.UserId);
            }
            else
            {
                Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.SettingsManager.GetSiteSettings(user.UserId);
                path = string.Format("~/Templates/sites/{0}/{1}/fckfiles/Files/Image/", user.UserId, siteSettings.Theme);
                url  = string.Format("/Templates/sites/{0}/{1}/fckfiles/Files/Image/", user.UserId, siteSettings.Theme);
            }
            string text = base.Request.QueryString["order"];

            text = (string.IsNullOrEmpty(text) ? "uploadtime" : text.ToLower());
            if (base.Request.QueryString["cid"] == null)
            {
            }
            this.FillTableForPath(path, url, text, hashtable);
            string text2 = base.Request.Url.ToString();

            text2  = text2.Substring(0, text2.IndexOf("/", 7));
            text2 += base.Request.ApplicationPath;
            if (text2.EndsWith("/"))
            {
                text2 = text2.Substring(0, text2.Length - 1);
            }
            hashtable["domain"] = text2;
            base.Response.AddHeader("Content-Type", "application/json; charset=UTF-8");
            base.Response.Write(JsonMapper.ToJson(hashtable));
            base.Response.End();
        }
示例#17
0
 protected override void OnInit(System.EventArgs eventArgs_0)
 {
     Hidistro.Membership.Core.IUser contexUser = Hidistro.Membership.Context.Users.GetContexUser();
     if (!Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && contexUser.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager)
     {
         this.Page.Response.Redirect(Globals.GetAdminAbsolutePath("login.aspx"), true);
     }
     if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && contexUser.UserRole != Hidistro.Membership.Core.Enums.UserRole.Distributor)
     {
         this.Page.Response.Redirect(Globals.ApplicationPath + "Shopadmin/DistributorLogin.aspx", true);
     }
     this.SetDesignSkinName();
     if (this.SkinName == null || this.tempurl == "")
     {
         base.GotoResourceNotFound();
     }
     base.OnInit(eventArgs_0);
 }
示例#18
0
 public void ProcessRequest(System.Web.HttpContext context)
 {
     Hidistro.Membership.Core.IUser user      = Hidistro.Membership.Context.Users.GetUser(0, Hidistro.Membership.Context.Users.GetLoggedOnUsername(), true, true);
     System.Collections.Hashtable   hashtable = new System.Collections.Hashtable();
     if (user.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager && user.UserRole != Hidistro.Membership.Core.Enums.UserRole.Distributor)
     {
         this.message = "没有权限";
     }
     else
     {
         string text = context.Request.QueryString["cid"];
         if (text == null || text == "-1")
         {
             text = "AdvertImg";
         }
         string text2 = string.Format("{0}/UploadImage/" + text + "/", Hidistro.Membership.Context.HiContext.Current.GetSkinPath());
         string url;
         if (context.Request.ApplicationPath != "/")
         {
             url = text2.Substring(context.Request.ApplicationPath.Length);
         }
         else
         {
             url = text2;
         }
         string text3 = context.Request.QueryString["order"];
         text3        = (string.IsNullOrEmpty(text3) ? "uploadtime" : text3.ToLower());
         this.message = "未知错误";
         if (this.FillTableForPath(text2, url, text3, hashtable, text))
         {
             string text4 = context.Request.Url.ToString();
             text4  = text4.Substring(0, text4.IndexOf("/", 7));
             text4 += context.Request.ApplicationPath;
             if (text4.EndsWith("/"))
             {
                 text4 = text4.Substring(0, text4.Length - 1);
             }
             hashtable["domain"] = text4;
             this.message        = JsonMapper.ToJson(hashtable);
         }
     }
     context.Response.ContentType = "text/json";
     context.Response.Write(this.message);
 }
示例#19
0
 private void btnOK3_Click(object sender, System.EventArgs e)
 {
     Hidistro.Membership.Core.IUser user = Users.GetUser(HiContext.Current.User.UserId, false);
     if (user.MembershipUser != null && user.MembershipUser.IsLockedOut)
     {
         this.ShowMessage(this.StatusPasswordProtection, "你已经被管理员锁定", false);
     }
     else
     {
         if (string.IsNullOrEmpty(this.txtQuestion.Text) || string.IsNullOrEmpty(this.txtAnswer.Text))
         {
             this.ShowMessage(this.StatusPasswordProtection, "问题和答案为必填项", false);
         }
         else
         {
             if (!string.IsNullOrEmpty(user.PasswordQuestion))
             {
                 if (user.ChangePasswordQuestionAndAnswer(Globals.HtmlEncode(this.txtOdeAnswer.Text), Globals.HtmlEncode(this.txtQuestion.Text), Globals.HtmlEncode(this.txtAnswer.Text)))
                 {
                     Users.ClearUserCache(user);
                     this.BindAnswerAndQuestion();
                     this.ShowMessage(this.StatusPasswordProtection, "成功修改了密码答案", true);
                 }
                 else
                 {
                     this.ShowMessage(this.StatusPasswordProtection, "修改密码答案失败", false);
                 }
             }
             else
             {
                 if (user.ChangePasswordQuestionAndAnswer(Globals.HtmlEncode(this.txtQuestion.Text), Globals.HtmlEncode(this.txtAnswer.Text)))
                 {
                     Users.ClearUserCache(user);
                     this.BindAnswerAndQuestion();
                     this.ShowMessage(this.StatusPasswordProtection, "成功修改了密码答案", true);
                 }
                 else
                 {
                     this.ShowMessage(this.StatusPasswordProtection, "修改密码答案失败", false);
                 }
             }
         }
     }
 }
示例#20
0
        private void btnCloseOrder_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.hidOrderId.Value);

            orderInfo.CloseReason = this.ddlCloseReason.SelectedValue;
            if (SubsiteSalesHelper.CloseTransaction(orderInfo))
            {
                int num = orderInfo.UserId;
                if (num == 1100)
                {
                    num = 0;
                }
                Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num);
                Messenger.OrderClosed(user, orderInfo.OrderId, orderInfo.CloseReason);
                orderInfo.OnClosed();
                this.BindOrders();
                this.ShowMsg("关闭订单成功", true);
                return;
            }
            this.ShowMsg("关闭订单失败", false);
        }
示例#21
0
 protected override void AttachChildControls()
 {
     System.Web.UI.WebControls.Literal literal  = (System.Web.UI.WebControls.Literal) this.FindControl("litPageName");
     System.Web.UI.WebControls.Literal literal2 = (System.Web.UI.WebControls.Literal) this.FindControl("litTempete");
     System.Web.UI.WebControls.Literal literal3 = (System.Web.UI.WebControls.Literal) this.FindControl("litaccount");
     System.Web.UI.WebControls.Literal literal4 = (System.Web.UI.WebControls.Literal) this.FindControl("litview");
     System.Web.UI.WebControls.Literal literal5 = (System.Web.UI.WebControls.Literal) this.FindControl("litDefault");
     if (!this.Page.IsPostBack)
     {
         if (literal != null)
         {
             literal.Text = "<script>Hidistro_designer.CurrentPageName='" + this.skintemp + "'</script>";
         }
         if (literal2 != null)
         {
             literal2.Text = "<div id=\"assistdiv\" class=\"assistdiv\"></div><div class=\"edit_div\" id=\"grounddiv\"><div class=\"cover\"></div></div><div class=\"edit_bar\" id=\"groundeidtdiv\"><a href=\"javascript:Hidistro_designer.EditeDesigDialog();\" title=\"编辑\" id=\"a_design_Edit\">编辑</a><a href=\"javascript:Hidistro_designer.moveUp()\" class=\"up updisable\" id=\"a_design_up\" title=\"上移\">上移</a><a href=\"javascript:Hidistro_designer.moveDown()\" class=\"down downdisable\" title=\"下移\" id=\"a_design_down\">下移</a><a href=\"javascript:void(0);\" id=\"a_design_delete\" title=\"删除\" onclick=\"Hidistro_designer.del_element()\">删除</a><a class=\"controlinfo\" href=\"javascript:void(0);\" onclick=\"Hidistro_designer.gethelpdailog();\" title=\"控件说明\" rel=\"#SetingTempalte\">控件说明</a></div> <div class=\"apple_overlay\" id=\"taboverlaycontent\"></div><div id=\"tempdiv\" style=\"height: 260px; display: none;\"></div><div class=\"design_coverbg\" id=\"design_coverbg\"></div><div class=\"controlnamediv\" id=\"ctrnamediv\">图片控件轮播组件</div><script>Hidistro_designer.Design_Page_Init();</script>";
         }
         if (literal3 != null)
         {
             Hidistro.Membership.Core.IUser contexUser = Hidistro.Membership.Context.Users.GetContexUser();
             if (contexUser != null)
             {
                 literal3.Text = "<a>我的账号:" + contexUser.Username + "</a>";
             }
         }
         if (literal5 != null)
         {
             literal5.Text = "<a href=\"" + Globals.ApplicationPath + "/\">查看店铺</a>";
         }
         if (literal4 != null)
         {
             string str = Globals.ApplicationPath + "/";
             if (this.viewname != "")
             {
                 str = Globals.GetSiteUrls().UrlData.FormatUrl(this.viewname);
             }
             literal4.Text = "<a href=\"" + str + "\" target=\"_blank\" class=\"button\">预览</a>";
         }
     }
 }
示例#22
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
     base.Response.AddHeader("Content-Type", "application/json; charset=UTF-8");
     Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(0, Hidistro.Membership.Context.Users.GetLoggedOnUsername(), true, true);
     if (user.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager)
     {
         base.Response.Write(JsonMapper.ToJson(hashtable));
         base.Response.End();
         return;
     }
     System.Collections.Generic.List <System.Collections.Hashtable> list = new System.Collections.Generic.List <System.Collections.Hashtable>();
     hashtable["category_list"] = list;
     System.Data.DataTable photoCategories = GalleryHelper.GetPhotoCategories();
     foreach (System.Data.DataRow dataRow in photoCategories.Rows)
     {
         System.Collections.Hashtable hashtable2 = new System.Collections.Hashtable();
         hashtable2["cId"]   = dataRow["CategoryId"];
         hashtable2["cName"] = dataRow["CategoryName"];
         list.Add(hashtable2);
     }
     base.Response.Write(JsonMapper.ToJson(hashtable));
     base.Response.End();
 }
示例#23
0
 private bool CheckRole()
 {
     Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.HiContext.Current.User;
     return(user.IsInRole("供应商"));
 }
        private void btnSendGoods_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.orderId);

            if (orderInfo == null)
            {
                return;
            }
            if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Success)
            {
                this.ShowMsg("当前订单为团购订单,团购活动还未成功结束,所以不能发货", false);
                return;
            }
            if (!orderInfo.CheckAction(OrderActions.SELLER_SEND_GOODS))
            {
                this.ShowMsg("当前订单状态没有付款或不是等待发货的订单,所以不能发货", false);
                return;
            }
            if (Methods.Supplier_OrderIsFenPei(this.orderId))
            {
                this.ShowMsg("生成成功", true);
                return;
            }
            string text = Methods.Supplier_OrderItemSupplierUpdate(orderInfo);

            if (text != "true")
            {
                this.ShowMsg(text, false);
                return;
            }
            orderInfo.RealShippingModeId = 0;
            orderInfo.RealModeName       = "配送方式(已实际发货单为准)";
            orderInfo.ShipOrderNumber    = string.Format("{0}", string.Format(" <a style=\"color:red;cursor:pointer;\" target=\"_blank\" onclick=\"{0}\">物流详细</a>", "showWindow_ShipInfoPage('" + orderInfo.OrderId + "')"));
            if (OrderHelper.SendGoods(orderInfo))
            {
                Methods.Supplier_OrderItemsSupplierFenPeiOverUpdate(orderInfo.OrderId);
                if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && orderInfo.GatewayOrderId.Trim().Length > 0)
                {
                    PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(orderInfo.PaymentTypeId);
                    if (paymentMode != null)
                    {
                        PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单发货", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[]
                        {
                            paymentMode.Gateway
                        })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[]
                        {
                            paymentMode.Gateway
                        })), "");
                        paymentRequest.SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, "物流单(已实际发货单为准,可在下单网站查看)", "EXPRESS");
                    }
                }
                int num = orderInfo.UserId;
                if (num == 1100)
                {
                    num = 0;
                }
                Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num);
                Messenger.OrderShipping(orderInfo, user);
                orderInfo.OnDeliver();
                this.CloseWindow();
                return;
            }
            this.ShowMsg("发货失败", false);
        }
示例#25
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(0, Hidistro.Membership.Context.Users.GetLoggedOnUsername(), true, true);
            string str = "AdvertImg";

            if (!Hidistro.Membership.Context.HiContext.Current.Context.User.IsInRole("manager") && !Hidistro.Membership.Context.HiContext.Current.Context.User.IsInRole("systemadministrator") && user.UserRole != Hidistro.Membership.Core.Enums.UserRole.Distributor && user.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager)
            {
                this.showError("您没有权限执行此操作");
            }
            else
            {
                if (context.Request.Form["fileCategory"] != null)
                {
                    str = context.Request.Form["fileCategory"];
                }
                string text = string.Empty;
                if (context.Request.Form["imgTitle"] != null)
                {
                    text = context.Request.Form["imgTitle"];
                }
                this.savePath = string.Format("{0}/UploadImage/" + str + "/", Hidistro.Membership.Context.HiContext.Current.GetSkinPath());
                if (context.Request.ApplicationPath != "/")
                {
                    this.saveUrl = this.savePath.Substring(context.Request.ApplicationPath.Length);
                }
                else
                {
                    this.saveUrl = this.savePath;
                }
                System.Web.HttpPostedFile httpPostedFile = context.Request.Files["imgFile"];
                string text2 = "";
                if (this.CheckUploadFile(httpPostedFile, ref text2))
                {
                    if (!System.IO.Directory.Exists(text2))
                    {
                        System.IO.Directory.CreateDirectory(text2);
                    }
                    string fileName = httpPostedFile.FileName;
                    if (text.Length == 0)
                    {
                    }
                    string str2     = System.IO.Path.GetExtension(fileName).ToLower();
                    string str3     = System.DateTime.Now.ToString("yyyyMMddHHmmss_ffff", System.Globalization.DateTimeFormatInfo.InvariantInfo) + str2;
                    string filename = text2 + str3;
                    string str4     = this.saveUrl + str3;
                    try
                    {
                        httpPostedFile.SaveAs(filename);
                        System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
                        hashtable["error"] = 0;
                        hashtable["url"]   = Globals.ApplicationPath + str4;
                        this.message       = JsonMapper.ToJson(hashtable);
                    }
                    catch
                    {
                        this.showError("保存文件出错");
                    }
                }
            }
            context.Response.ContentType = "text/html";
            context.Response.Write(this.message);
        }
示例#26
0
        private void dlstOrders_ItemCommand(object sender, System.Web.UI.WebControls.DataListCommandEventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(e.CommandArgument.ToString());

            if (orderInfo != null)
            {
                if (e.CommandName == "CONFIRM_PAY" && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY))
                {
                    int num  = 0;
                    int num2 = 0;
                    int num3 = 0;
                    if (orderInfo.CountDownBuyId > 0)
                    {
                        CountDownInfo countDownInfo = SubsitePromoteHelper.GetCountDownInfo(orderInfo.CountDownBuyId);
                        if (countDownInfo == null || countDownInfo.EndDate < System.DateTime.Now)
                        {
                            this.ShowMsg("当前的订单为限时抢购订单,此活动已结束,所以不能支付", false);
                            return;
                        }
                    }
                    if (orderInfo.GroupBuyId > 0)
                    {
                        GroupBuyInfo groupBuy = SubsitePromoteHelper.GetGroupBuy(orderInfo.GroupBuyId);
                        if (groupBuy != null)
                        {
                            if (groupBuy.Status == GroupBuyStatus.UnderWay)
                            {
                                num2 = SubsitePromoteHelper.GetOrderCount(orderInfo.GroupBuyId);
                                num  = groupBuy.MaxCount;
                                num3 = orderInfo.GetGroupBuyOerderNumber();
                                if (num < num2 + num3)
                                {
                                    this.ShowMsg("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付", false);
                                    return;
                                }
                                goto IL_DB;
                            }
                        }
                        this.ShowMsg("当前的订单为团购订单,此团购活动已结束,所以不能支付", false);
                        return;
                    }
IL_DB:
                    if (SubsiteSalesHelper.ConfirmPay(orderInfo))
                    {
                        DebitNote debitNote = new DebitNote();
                        debitNote.NoteId   = Globals.GetGenerateId();
                        debitNote.OrderId  = e.CommandArgument.ToString();
                        debitNote.Operator = Hidistro.Membership.Context.HiContext.Current.User.Username;
                        debitNote.Remark   = "后台" + debitNote.Operator + "支付成功";
                        SubsiteSalesHelper.SaveDebitNote(debitNote);
                        if (orderInfo.GroupBuyId > 0 && num == num2 + num3)
                        {
                            SubsitePromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId);
                        }
                        this.BindOrders();
                        int num4 = orderInfo.UserId;
                        if (num4 == 1100)
                        {
                            num4 = 0;
                        }
                        Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num4);
                        Messenger.OrderPayment(user, orderInfo.OrderId, orderInfo.GetTotal());
                        orderInfo.OnPayment();
                        this.ShowMsg("成功的确认了订单收款", true);
                        return;
                    }
                    this.ShowMsg("确认订单收款失败", false);
                    return;
                }
                else
                {
                    if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE))
                    {
                        if (SubsiteSalesHelper.ConfirmOrderFinish(orderInfo))
                        {
                            this.BindOrders();
                            this.ShowMsg("成功的完成了该订单", true);
                            return;
                        }
                        this.ShowMsg("完成订单失败", false);
                        return;
                    }
                    else
                    {
                        if (e.CommandName == "CREATE_PURCHASEORDER" && orderInfo.CheckAction(OrderActions.SUBSITE_CREATE_PURCHASEORDER))
                        {
                            if (SubsiteSalesHelper.CreatePurchaseOrder(orderInfo))
                            {
                                this.BindOrders();
                                this.ShowMsg("生成采购单成功", true);
                                return;
                            }
                            this.ShowMsg(" 生成采购单失败", false);
                        }
                    }
                }
            }
        }
示例#27
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(0, Hidistro.Membership.Context.Users.GetLoggedOnUsername(), true, true);
            if (user.UserRole != Hidistro.Membership.Core.Enums.UserRole.Distributor && user.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager)
            {
                this.showError("您没有权限执行此操作!");
                return;
            }
            string a = "false";

            if (base.Request.Form["isAdvPositions"] != null)
            {
                a = base.Request.Form["isAdvPositions"].ToString().ToLower().Trim();
            }
            if (user.UserRole == Hidistro.Membership.Core.Enums.UserRole.SiteManager)
            {
                if (a == "false")
                {
                    this.savePath = "~/Storage/master/gallery/";
                    this.saveUrl  = "/Storage/master/gallery/";
                }
                else
                {
                    this.savePath = string.Format("{0}/fckfiles/Files/Image/", Hidistro.Membership.Context.HiContext.Current.GetSkinPath());
                    if (base.Request.ApplicationPath != "/")
                    {
                        this.saveUrl = this.savePath.Substring(base.Request.ApplicationPath.Length);
                    }
                    else
                    {
                        this.saveUrl = this.savePath;
                    }
                }
            }
            else
            {
                if (a == "false")
                {
                    this.savePath = string.Format("~/Storage/sites/{0}/fckfiles/", user.UserId);
                    this.saveUrl  = string.Format("/Storage/sites/{0}/fckfiles/", user.UserId);
                }
                else
                {
                    Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.SettingsManager.GetSiteSettings(user.UserId);
                    this.savePath = string.Format("~/Templates/sites/{0}/{1}/fckfiles/Files/Image/", user.UserId, siteSettings.Theme);
                    this.saveUrl  = string.Format("/Templates/sites/{0}/{1}/fckfiles/Files/Image/", user.UserId, siteSettings.Theme);
                }
            }
            int num = 0;

            if (base.Request.Form["fileCategory"] != null)
            {
                int.TryParse(base.Request.Form["fileCategory"], out num);
            }
            string text = string.Empty;

            if (base.Request.Form["imgTitle"] != null)
            {
                text = base.Request.Form["imgTitle"];
            }
            System.Web.HttpPostedFile httpPostedFile = base.Request.Files["imgFile"];
            if (httpPostedFile == null)
            {
                this.showError("请先选择文件!");
            }
            if (!ResourcesHelper.CheckPostedFile(httpPostedFile))
            {
                this.showError("不能上传空文件,且必须是有效的图片文件!");
                return;
            }
            string text2 = base.Server.MapPath(this.savePath);

            if (!System.IO.Directory.Exists(text2))
            {
                this.showError("上传目录不存在。");
            }
            if (a == "false" && user.UserRole == Hidistro.Membership.Core.Enums.UserRole.SiteManager)
            {
                text2        += string.Format("{0}/", System.DateTime.Now.ToString("yyyyMM"));
                this.saveUrl += string.Format("{0}/", System.DateTime.Now.ToString("yyyyMM"));
            }
            if (!System.IO.Directory.Exists(text2))
            {
                System.IO.Directory.CreateDirectory(text2);
            }
            string fileName = httpPostedFile.FileName;

            if (text.Length == 0)
            {
                text = fileName;
            }
            string str      = System.IO.Path.GetExtension(fileName).ToLower();
            string str2     = System.DateTime.Now.ToString("yyyyMMddHHmmss_ffff", System.Globalization.DateTimeFormatInfo.InvariantInfo) + str;
            string filename = text2 + str2;
            string text3    = this.saveUrl + str2;

            try
            {
                httpPostedFile.SaveAs(filename);
                if (user.UserRole == Hidistro.Membership.Core.Enums.UserRole.SiteManager && a == "false")
                {
                    Database database = DatabaseFactory.CreateDatabase();
                    System.Data.Common.DbCommand sqlStringCommand = database.GetSqlStringCommand("insert into Hishop_PhotoGallery(CategoryId,PhotoName,PhotoPath,FileSize,UploadTime,LastUpdateTime)values(@cid,@name,@path,@size,@time,@time1)");
                    database.AddInParameter(sqlStringCommand, "cid", System.Data.DbType.Int32, num);
                    database.AddInParameter(sqlStringCommand, "name", System.Data.DbType.String, text);
                    database.AddInParameter(sqlStringCommand, "path", System.Data.DbType.String, text3);
                    database.AddInParameter(sqlStringCommand, "size", System.Data.DbType.Int32, httpPostedFile.ContentLength);
                    database.AddInParameter(sqlStringCommand, "time", System.Data.DbType.DateTime, System.DateTime.Now);
                    database.AddInParameter(sqlStringCommand, "time1", System.Data.DbType.DateTime, System.DateTime.Now);
                    database.ExecuteNonQuery(sqlStringCommand);
                }
            }
            catch
            {
                this.showError("保存文件出错!");
            }
            System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
            hashtable["error"] = 0;
            hashtable["url"]   = Globals.ApplicationPath + text3;
            base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            base.Response.Write(JsonMapper.ToJson(hashtable));
            base.Response.End();
        }
示例#28
0
        protected void dlstOrders_ItemCommand(object sender, System.Web.UI.WebControls.DataListCommandEventArgs e)
        {
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString());

            if (orderInfo != null)
            {
                if (e.CommandName == "CONFIRM_PAY" && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY))
                {
                    int num  = 0;
                    int num2 = 0;
                    int num3 = 0;
                    if (orderInfo.CountDownBuyId > 0)
                    {
                        CountDownInfo countDownBuy = TradeHelper.GetCountDownBuy(orderInfo.CountDownBuyId);
                        if (countDownBuy == null || countDownBuy.EndDate < System.DateTime.Now)
                        {
                            this.ShowMsg("当前的订单为限时抢购订单,此活动已结束,所以不能支付", false);
                            return;
                        }
                    }
                    if (orderInfo.GroupBuyId > 0)
                    {
                        GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(orderInfo.GroupBuyId);
                        if (groupBuy != null)
                        {
                            if (groupBuy.Status == GroupBuyStatus.UnderWay)
                            {
                                num2 = PromoteHelper.GetOrderCount(orderInfo.GroupBuyId);
                                num  = groupBuy.MaxCount;
                                num3 = orderInfo.GetGroupBuyOerderNumber();
                                if (num < num2 + num3)
                                {
                                    this.ShowMsg("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付", false);
                                    return;
                                }
                                goto IL_E2;
                            }
                        }
                        this.ShowMsg("当前的订单为团购订单,此团购活动已结束,所以不能支付", false);
                        return;
                    }
IL_E2:
                    if (OrderHelper.ConfirmPay(orderInfo))
                    {
                        DebitNote debitNote = new DebitNote();
                        debitNote.NoteId   = Globals.GetGenerateId();
                        debitNote.OrderId  = e.CommandArgument.ToString();
                        debitNote.Operator = Hidistro.Membership.Context.HiContext.Current.User.Username;
                        debitNote.Remark   = "后台" + debitNote.Operator + "收款成功";
                        OrderHelper.SaveDebitNote(debitNote);
                        if (orderInfo.GroupBuyId > 0 && num == num2 + num3)
                        {
                            PromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId);
                        }
                        this.BindOrders();
                        int num4 = orderInfo.UserId;
                        if (num4 == 1100)
                        {
                            num4 = 0;
                        }
                        Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num4);
                        Messenger.OrderPayment(user, orderInfo.OrderId, orderInfo.GetTotal());
                        orderInfo.OnPayment();
                        this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "sucess", string.Format("<script language=\"javascript\" >alert('确认收款成功');window.location.href=\"{0}\"</script>", System.Web.HttpContext.Current.Request.RawUrl));
                        return;
                    }
                    this.ShowMsg("确认订单收款失败", false);
                    return;
                }
                else
                {
                    if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE))
                    {
                        if (OrderHelper.ConfirmOrderFinish(orderInfo))
                        {
                            this.BindOrders();
                            this.ShowMsg("成功的完成了该订单", true);
                            return;
                        }
                        this.ShowMsg("完成订单失败", false);
                        return;
                    }
                    else
                    {
                        if (e.CommandName == "Match_Order")
                        {
                            if (orderInfo == null)
                            {
                                return;
                            }
                            if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Success)
                            {
                                this.ShowMsg("当前订单为团购订单,团购活动还未成功结束,所以不能发货", false);
                                return;
                            }
                            if (!orderInfo.CheckAction(OrderActions.SELLER_SEND_GOODS))
                            {
                                this.ShowMsg("当前订单状态没有付款或不是等待发货的订单,所以不能发货", false);
                                return;
                            }
                            if (Methods.Supplier_OrderIsFenPei(e.CommandArgument.ToString()))
                            {
                                this.ShowMsg("生成成功", true);
                                return;
                            }
                            string text = Methods.Supplier_OrderItemSupplierUpdate(orderInfo);
                            if (text != "true")
                            {
                                this.ShowMsg(text, false);
                                return;
                            }
                            orderInfo.RealShippingModeId = 0;
                            orderInfo.RealModeName       = "配送方式(已实际发货单为准)";
                            orderInfo.ShipOrderNumber    = string.Format("{0}", string.Format(" <a style=\"color:red;cursor:pointer;\" target=\"_blank\" onclick=\"{0}\">物流详细</a>", "showWindow_ShipInfoPage('" + orderInfo.OrderId + "')"));
                            if (OrderHelper.SendGoods(orderInfo))
                            {
                                Methods.Supplier_OrderItemsSupplierFenPeiOverUpdate(orderInfo.OrderId);
                                if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && orderInfo.GatewayOrderId.Trim().Length > 0)
                                {
                                    PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(orderInfo.PaymentTypeId);
                                    if (paymentMode != null)
                                    {
                                        PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单发货", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[]
                                        {
                                            paymentMode.Gateway
                                        })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[]
                                        {
                                            paymentMode.Gateway
                                        })), "");
                                        paymentRequest.SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS");
                                    }
                                }
                                int num5 = orderInfo.UserId;
                                if (num5 == 1100)
                                {
                                    num5 = 0;
                                }
                                Hidistro.Membership.Core.IUser user2 = Hidistro.Membership.Context.Users.GetUser(num5);
                                Messenger.OrderShipping(orderInfo, user2);
                                orderInfo.OnDeliver();
                                this.ShowMsg("生成成功", true);
                                this.BindOrders();
                                return;
                            }
                            this.ShowMsg("发货失败", false);
                            this.ShowMsg("生成成功", true);
                        }
                    }
                }
            }
        }
示例#29
0
文件: Pay.cs 项目: uvbs/eshopSanQiang
        protected void btnPay_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
            int       num       = 0;
            int       num2      = 0;
            int       num3      = 0;

            if (orderInfo.CountDownBuyId > 0)
            {
                CountDownInfo countDownBuy = TradeHelper.GetCountDownBuy(orderInfo.CountDownBuyId);
                if (countDownBuy == null || countDownBuy.EndDate < System.DateTime.Now)
                {
                    this.ShowMessage("当前的订单为限时抢购订单,此活动已结束,所以不能支付", false);
                    return;
                }
            }
            if (orderInfo.GroupBuyId > 0)
            {
                GroupBuyInfo groupBuy = TradeHelper.GetGroupBuy(orderInfo.GroupBuyId);
                if (groupBuy == null || groupBuy.Status != GroupBuyStatus.UnderWay)
                {
                    this.ShowMessage("当前的订单为团购订单,此团购活动已结束,所以不能支付", false);
                    return;
                }
                num2 = TradeHelper.GetOrderCount(orderInfo.GroupBuyId);
                num3 = orderInfo.GetGroupBuyOerderNumber();
                num  = groupBuy.MaxCount;
                if (num < num2 + num3)
                {
                    this.ShowMessage("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付", false);
                    return;
                }
            }
            if (!orderInfo.CheckAction(OrderActions.BUYER_PAY))
            {
                this.ShowMessage("当前的订单订单状态不是等待付款,所以不能支付", false);
            }
            else
            {
                if (HiContext.Current.User.UserId != orderInfo.UserId)
                {
                    this.ShowMessage("预付款只能为自己下的订单付款,查一查该订单是不是你的", false);
                }
                else
                {
                    if ((decimal)this.litUseableBalance.Money < orderInfo.GetTotal())
                    {
                        this.ShowMessage("预付款余额不足,支付失败", false);
                    }
                    else
                    {
                        Hidistro.Membership.Core.IUser user = HiContext.Current.User;
                        user.TradePassword = this.txtPassword.Text;
                        if (Users.ValidTradePassword(user))
                        {
                            System.Collections.Generic.Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems;
                            foreach (LineItemInfo current in lineItems.Values)
                            {
                                int stock = ShoppingProcessor.GetStock(current.ProductId, current.SkuId);
                                if (stock < current.ShipmentQuantity)
                                {
                                    this.ShowMessage("订单中商品库存不足,禁止支付!", false);
                                    return;
                                }
                            }
                            if (TradeHelper.UserPayOrder(orderInfo, true))
                            {
                                TradeHelper.SaveDebitNote(new DebitNote
                                {
                                    NoteId   = Globals.GetGenerateId(),
                                    OrderId  = this.orderId,
                                    Operator = HiContext.Current.User.Username,
                                    Remark   = "客户预付款订单支付成功"
                                });
                                if (orderInfo.GroupBuyId > 0 && num == num2 + num3)
                                {
                                    TradeHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId);
                                }
                                Messenger.OrderPayment(user, orderInfo.OrderId, orderInfo.GetTotal());
                                orderInfo.OnPayment();
                                this.Page.Response.Redirect(Globals.ApplicationPath + "/user/PaySucceed.aspx?orderId=" + this.orderId);
                            }
                            else
                            {
                                this.ShowMessage(string.Format("对订单{0} 支付失败", orderInfo.OrderId), false);
                            }
                        }
                        else
                        {
                            this.ShowMessage("交易密码有误,请重试", false);
                        }
                    }
                }
            }
        }
示例#30
0
        private void btnCheckUserName_Click(object sender, System.EventArgs e)
        {
            string pattern = "[\\u4e00-\\u9fa5a-zA-Z0-9]+[\\u4e00-\\u9fa5_a-zA-Z0-9]*";

            System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(pattern);
            if (!regex.IsMatch(this.txtUserName.Text.Trim()) || this.txtUserName.Text.Trim().Length < 2 || this.txtUserName.Text.Trim().Length > 20)
            {
                this.ShowMessage("用户名不能为空,必须以汉字或是字母开头,且在2-20个字符之间", false);
            }
            else
            {
                if (this.txtUserName.Text.Contains(","))
                {
                    this.ShowMessage("用户名不能包含逗号", false);
                }
                else
                {
                    Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.FindUserByUsername(this.txtUserName.Text.Trim());
                    if (user != null && user.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager && user.UserRole != Hidistro.Membership.Core.Enums.UserRole.Anonymous)
                    {
                        Hidistro.Membership.Core.IUser user2 = Hidistro.Membership.Context.Users.GetUser(0, this.txtUserName.Text.Trim(), false, true);
                        if (user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Distributor)
                        {
                            if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && user2.UserId != Hidistro.Membership.Context.HiContext.Current.SiteSettings.UserId.Value)
                            {
                                this.ShowMessage("分销商只能在自己的站点或主站上登录", false);
                                return;
                            }
                        }
                        else
                        {
                            if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings)
                            {
                                Hidistro.Membership.Context.Member member = user2 as Hidistro.Membership.Context.Member;
                                if (!member.ParentUserId.HasValue || member.ParentUserId.Value != Hidistro.Membership.Context.HiContext.Current.SiteSettings.UserId)
                                {
                                    this.ShowMessage("您不是本站会员,请您进行注册", false);
                                    return;
                                }
                            }
                            else
                            {
                                Hidistro.Membership.Context.Member member = user2 as Hidistro.Membership.Context.Member;
                                if (member.ParentUserId.HasValue && member.ParentUserId.Value != 0)
                                {
                                    this.ShowMessage("您不是本站会员,请您进行注册", false);
                                    return;
                                }
                            }
                        }
                        if (this.dropType.SelectedIndex == 0)
                        {
                            if (!string.IsNullOrEmpty(user.PasswordQuestion))
                            {
                                if (this.litUserQuestion != null)
                                {
                                    this.litUserQuestion.Text = user.PasswordQuestion.ToString();
                                }
                                this.panelShow("InputAnswer");
                            }
                            else
                            {
                                this.ShowMessage("您没有设置密保问题,无法找回密码,请自行联系管理员修改密码", false);
                            }
                        }
                        else
                        {
                            if (this.dropType.SelectedIndex == 1)
                            {
                                if (user is Hidistro.Membership.Context.Member)
                                {
                                    Hidistro.Membership.Context.Member member = user as Hidistro.Membership.Context.Member;
                                    if (!string.IsNullOrEmpty(member.CellPhone))
                                    {
                                        if (this.litMobile != null)
                                        {
                                            this.litMobile.Text = member.CellPhone.Substring(0, 3) + "****" + member.CellPhone.Substring(7);
                                        }
                                        this.panelShow("CellPhone");
                                    }
                                    else
                                    {
                                        this.ShowMessage("没有设置手机号码", false);
                                    }
                                }
                                else
                                {
                                    if (user is Hidistro.Membership.Context.Distributor)
                                    {
                                        Hidistro.Membership.Context.Distributor distributor = user as Hidistro.Membership.Context.Distributor;
                                        if (!string.IsNullOrEmpty(distributor.CellPhone))
                                        {
                                            if (this.litMobile != null)
                                            {
                                                this.litMobile.Text = distributor.CellPhone.Substring(0, 3) + "****" + distributor.CellPhone.Substring(7);
                                            }
                                            this.panelShow("CellPhone");
                                        }
                                        else
                                        {
                                            this.ShowMessage("没有设置手机号码", false);
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (this.dropType.SelectedIndex == 2)
                                {
                                    if (!string.IsNullOrEmpty(user.Email))
                                    {
                                        if (this.litEmail != null)
                                        {
                                            this.litEmail.Text = user.Email;
                                        }
                                        this.panelShow("Email");
                                    }
                                    else
                                    {
                                        this.ShowMessage("没有设置电子邮箱", false);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        this.ShowMessage("该用户不存在", false);
                    }
                }
            }
        }