private void btnEditHotkeyword_Click(object sender, System.EventArgs e) { int int_ = System.Convert.ToInt32(this.txtHid.Value); if (string.IsNullOrEmpty(this.txtEditHotKeyword.Text.Trim()) || this.txtEditHotKeyword.Text.Trim().Length > 60) { this.ShowMsg("热门关键字不能为空,长度限制在60个字符以内", false); return; } if (!this.dropEditCategory.SelectedValue.HasValue) { this.ShowMsg("请选择商品主分类", false); return; } System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("^(?!_)(?!.*?_$)(?!-)(?!.*?-$)[a-zA-Z0-9_一-龥-]+$"); if (!regex.IsMatch(this.txtEditHotKeyword.Text.Trim())) { this.ShowMsg("热门关键字只能输入汉字,数字,英文,下划线,减号,不能以下划线、减号开头或结尾", false); return; } if (string.Compare(this.txtEditHotKeyword.Text.Trim(), this.hiHotKeyword.Value) != 0 && this.IsSame(this.txtEditHotKeyword.Text.Trim(), System.Convert.ToInt32(this.dropEditCategory.SelectedValue.Value))) { this.ShowMsg("存在相同的的关键字,编辑失败", false); return; } if (((string.Compare(this.dropEditCategory.SelectedValue.Value.ToString(), this.hicategory.Value) == 0 & string.Compare(this.txtEditHotKeyword.Text, this.hiHotKeyword.Value) != 0) && this.IsSame(this.txtEditHotKeyword.Text.Trim(), System.Convert.ToInt32(this.dropEditCategory.SelectedValue.Value))) || (string.Compare(this.txtEditHotKeyword.Text.Trim(), this.hiHotKeyword.Value) == 0 && string.Compare(this.dropEditCategory.SelectedValue.Value.ToString(), this.hicategory.Value) != 0 && this.IsSame(this.txtEditHotKeyword.Text.Trim(), System.Convert.ToInt32(this.dropEditCategory.SelectedValue.Value)))) { this.ShowMsg("同一分类型不允许存在相同的关键字,编辑失败", false); return; } SubsiteStoreHelper.UpdateHotWords(int_, this.dropEditCategory.SelectedValue.Value, this.txtEditHotKeyword.Text.Trim()); this.BindData(); }
private void grdHotKeywords_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "Fall" || e.CommandName == "Rise") { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int int_ = (int)this.grdHotKeywords.DataKeys[rowIndex].Value; int displaySequence = int.Parse((this.grdHotKeywords.Rows[rowIndex].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text); int num = 0; int replaceDisplaySequence = 0; if (e.CommandName == "Fall") { if (rowIndex + 1 != this.grdHotKeywords.Rows.Count) { num = (int)this.grdHotKeywords.DataKeys[rowIndex + 1].Value; replaceDisplaySequence = int.Parse((this.grdHotKeywords.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text); } } else { if (e.CommandName == "Rise" && rowIndex != 0) { num = (int)this.grdHotKeywords.DataKeys[rowIndex - 1].Value; replaceDisplaySequence = int.Parse((this.grdHotKeywords.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text); } } if (num != 0) { SubsiteStoreHelper.SwapHotWordsSequence(int_, num, displaySequence, replaceDisplaySequence); this.BindData(); } } }
private void grdHotKeywords_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { int int_ = (int)this.grdHotKeywords.DataKeys[e.RowIndex].Value; SubsiteStoreHelper.DeleteHotKeywords(int_); this.BindData(); }
private void btnEditTradePassword_Click(object sender, EventArgs e) { Distributor user = SubsiteStoreHelper.GetDistributor(); if (string.IsNullOrEmpty(txtOldTradePassword.Text)) { ShowMsg("请输入旧交易密码", false); } else if ((string.IsNullOrEmpty(txtNewTradePassword.Text) || (txtNewTradePassword.Text.Length > 20)) || (txtNewTradePassword.Text.Length < 6)) { ShowMsg("交易密码不能为空,长度限制在6-20个字符之间", false); } else if (txtNewTradePassword.Text != txtTradePasswordCompare.Text) { ShowMsg("输入的两次密码不一致", false); } else if (user.ChangeTradePassword(txtOldTradePassword.Text, txtNewTradePassword.Text)) { Messenger.UserDealPasswordChanged(user, txtNewTradePassword.Text); user.OnDealPasswordChanged(new UserEventArgs(user.Username, null, txtNewTradePassword.Text)); ShowMsg("交易密码修改成功", true); } else { ShowMsg("交易密码修改失败", false); } }
private void btnSubmit_Click(object sender, System.EventArgs e) { string text = base.Request["PurchaseOrderId"]; PaymentModeInfo paymentMode = SubsiteStoreHelper.GetPaymentMode(int.Parse(this.radioPaymentMode.SelectedValue)); if (paymentMode != null) { SubsiteSalesHelper.SetPayment(text, paymentMode.ModeId, paymentMode.Name, paymentMode.Gateway); } if (paymentMode != null && paymentMode.Gateway.ToLower().Equals("hishop.plugins.payment.podrequest")) { this.ShowMsg("您选择的是货到付款方式,请等待主站发货", true); return; } if (paymentMode != null && paymentMode.Gateway.ToLower().Equals("hishop.plugins.payment.bankrequest")) { this.ShowMsg("您选择的是线下付款方式,请与主站管理员联系", true); return; } base.Response.Redirect(string.Concat(new string[] { Globals.ApplicationPath, "/Shopadmin/purchaseOrder/Pay.aspx?PurchaseOrderId=", text, "&PayMode=", this.radioPaymentMode.SelectedValue })); }
private void dlstVote_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { long voteId = System.Convert.ToInt64(this.dlstVote.DataKeys[e.Item.ItemIndex]); VoteInfo voteById = SubsiteStoreHelper.GetVoteById(voteId); System.Collections.Generic.IList <VoteItemInfo> voteItems = SubsiteStoreHelper.GetVoteItems(voteId); for (int i = 0; i < voteItems.Count; i++) { if (voteById.VoteCounts != 0) { decimal num = voteItems[i].ItemCount / voteById.VoteCounts * 100m; voteItems[i].Percentage = decimal.Parse(num.ToString("F", System.Globalization.CultureInfo.InvariantCulture)); } else { voteItems[i].Percentage = 0m; } } System.Web.UI.WebControls.GridView gridView = (System.Web.UI.WebControls.GridView)e.Item.FindControl("grdVoteItem"); if (gridView != null) { gridView.DataSource = voteItems; gridView.DataBind(); } } }
/// <summary> /// 发送HTTP请求 /// </summary> /// <returns></returns> protected string SendHttpRequest() { string responseStr; Distributor distributor = SubsiteStoreHelper.GetDistributor(); SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); WebRequest request = WebRequest.Create("http://saas.92hi.com/CreateDistributors.aspx"); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; string args = "Host=" + masterSettings.SiteUrl + "&DistributorUserId=" + distributor.UserId + "&Email=" + Page.Server.UrlEncode(distributor.Email) + "&RealName=" + Page.Server.UrlEncode(distributor.RealName) + "&CompanyName=" + Page.Server.UrlEncode(distributor.CompanyName) + "&Address=" + Page.Server.UrlEncode(distributor.Address) + "&TelPhone=" + Page.Server.UrlEncode(distributor.TelPhone) + "&QQ=" + Page.Server.UrlEncode(distributor.QQ) + "&Wangwang=" + Page.Server.UrlEncode(distributor.Wangwang); byte[] bytes = new ASCIIEncoding().GetBytes(args); request.ContentLength = bytes.Length; //写数据 using (Stream stream = request.GetRequestStream()) { stream.Write(bytes, 0, bytes.Length); } //读数据 using (StreamReader reader = new StreamReader(request.GetResponse().GetResponseStream(), Encoding.Default)) { responseStr = reader.ReadToEnd(); } return(responseStr); }
private void ProcessRequestStatus() { if (SubsiteStoreHelper.GetMySiteRequest() != null) { base.Response.Redirect(Globals.ApplicationPath + "/ShopAdmin/store/ShowSiteRequestStatus.aspx"); } }
private void btnEditLoginPassword_Click(object sender, EventArgs e) { Distributor user = SubsiteStoreHelper.GetDistributor(); if (string.IsNullOrEmpty(txtOldPassword.Text)) { ShowMsg("旧登录密码不能为空", false); } else if ((string.IsNullOrEmpty(txtNewPassword.Text) || (txtNewPassword.Text.Length > 20)) || (txtNewPassword.Text.Length < 6)) { ShowMsg("新登录密码不能为空,长度限制在6-20个字符之间", false); } else if (txtNewPassword.Text != txtPasswordCompare.Text) { ShowMsg("两次输入的密码不一致", false); } else if (user.ChangePassword(txtOldPassword.Text, txtNewPassword.Text)) { Messenger.UserPasswordChanged(user, txtNewPassword.Text); user.OnPasswordChanged(new UserEventArgs(user.Username, txtNewPassword.Text, null)); ShowMsg("登录密码修改成功", true); } else { ShowMsg("登录密码修改失败", false); } }
protected void Page_Load(object sender, EventArgs e) { btnSubmitLinks.Click += new EventHandler(btnSubmitLinks_Click); btnPicDelete.Click += new EventHandler(btnPicDelete_Click); if (!int.TryParse(base.Request.QueryString["linkId"], out linkId)) { base.GotoResourceNotFound(); } else if (!base.IsPostBack) { FriendlyLinksInfo friendlyLink = SubsiteStoreHelper.GetFriendlyLink(linkId); if (friendlyLink == null) { base.GotoResourceNotFound(); } else { txtaddTitle.Text = Globals.HtmlDecode(friendlyLink.Title); txtaddLinkUrl.Text = friendlyLink.LinkUrl; radioShowLinks.SelectedValue = friendlyLink.Visible; imgPic.ImageUrl = friendlyLink.ImageUrl; btnPicDelete.Visible = !string.IsNullOrEmpty(imgPic.ImageUrl); imgPic.Visible = !string.IsNullOrEmpty(imgPic.ImageUrl); } } }
protected void Page_Load(object sender, EventArgs e) { this.btnRequestAgain.Click += new EventHandler(this.btnRequestAgain_Click); if (!this.Page.IsPostBack) { SiteRequestInfo mySiteRequest = SubsiteStoreHelper.GetMySiteRequest(); if (mySiteRequest == null) { base.GotoResourceNotFound(); } else { this.litFirstUrl.Text = mySiteRequest.FirstSiteUrl; this.litRefuseReason.Text = mySiteRequest.RefuseReason; if (mySiteRequest.RequestStatus == SiteRequestStatus.Dealing) { this.liWait.Visible = true; } else if (mySiteRequest.RequestStatus == SiteRequestStatus.Fail) { this.liFail.Visible = true; this.divRequestAgain.Visible = true; } else if (mySiteRequest.RequestStatus == SiteRequestStatus.Success) { this.liSuccess.Visible = true; } } } }
public PaymentRadioButtonList() { base.Items.Clear(); foreach (PaymentModeInfo info in SubsiteStoreHelper.GetPaymentModes()) { string str = info.Gateway.ToLower(); if ((info.IsUseInpour && !str.Equals("hishop.plugins.payment.advancerequest")) && (!str.Equals("hishop.plugins.payment.bankrequest") && !str.Equals("hishop.plugins.payment.codrequest"))) { if (str.Equals("hishop.plugins.payment.alipay_shortcut.shortcutrequest")) { HttpCookie cookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.User.UserId.ToString()]; if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value)) { this.Items.Add(new ListItem(Globals.HtmlDecode(info.Name), info.ModeId.ToString(CultureInfo.InvariantCulture))); } } else { this.Items.Add(new ListItem(Globals.HtmlDecode(info.Name), info.ModeId.ToString(CultureInfo.InvariantCulture))); } } } this.SelectedIndex = 0; this.RepeatDirection = RepeatDirection.Horizontal; }
public PaymentRadioButtonList() { base.Items.Clear(); System.Collections.Generic.IList <PaymentModeInfo> paymentModes = SubsiteStoreHelper.GetPaymentModes(); foreach (PaymentModeInfo current in paymentModes) { string text = current.Gateway.ToLower(); if (current.IsUseInpour && !text.Equals("hishop.plugins.payment.advancerequest") && !text.Equals("hishop.plugins.payment.bankrequest") && !text.Equals("hishop.plugins.payment.codrequest")) { if (text.Equals("hishop.plugins.payment.alipay_shortcut.shortcutrequest")) { System.Web.HttpCookie httpCookie = Hidistro.Membership.Context.HiContext.Current.Context.Request.Cookies["Token_" + Hidistro.Membership.Context.HiContext.Current.User.UserId.ToString()]; if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value)) { this.Items.Add(new System.Web.UI.WebControls.ListItem(Globals.HtmlDecode(current.Name), current.ModeId.ToString(System.Globalization.CultureInfo.InvariantCulture))); } } else { this.Items.Add(new System.Web.UI.WebControls.ListItem(Globals.HtmlDecode(current.Name), current.ModeId.ToString(System.Globalization.CultureInfo.InvariantCulture))); } } } this.SelectedIndex = 0; this.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Horizontal; }
private void grdHotKeywords_RowCommand(object sender, GridViewCommandEventArgs e) { if ((e.CommandName == "Fall") || (e.CommandName == "Rise")) { int rowIndex = ((GridViewRow)((Control)e.CommandSource).NamingContainer).RowIndex; int hid = (int)grdHotKeywords.DataKeys[rowIndex].Value; int displaySequence = int.Parse((grdHotKeywords.Rows[rowIndex].FindControl("lblDisplaySequence") as Literal).Text); int replaceHid = 0; int replaceDisplaySequence = 0; if (e.CommandName == "Fall") { if ((rowIndex + 1) != grdHotKeywords.Rows.Count) { replaceHid = (int)grdHotKeywords.DataKeys[rowIndex + 1].Value; replaceDisplaySequence = int.Parse((grdHotKeywords.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as Literal).Text); } } else if ((e.CommandName == "Rise") && (rowIndex != 0)) { replaceHid = (int)grdHotKeywords.DataKeys[rowIndex - 1].Value; replaceDisplaySequence = int.Parse((grdHotKeywords.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as Literal).Text); } if (replaceHid != 0) { SubsiteStoreHelper.SwapHotWordsSequence(hid, replaceHid, displaySequence, replaceDisplaySequence); BindData(); } } }
void Notify_Finished(object sender, FinishedEventArgs e) { DateTime now = DateTime.Now; TradeTypes selfhelpInpour = TradeTypes.SelfhelpInpour; Distributor user = Users.GetUser(InpourRequest.UserId, false) as Distributor; decimal num = user.Balance + InpourRequest.InpourBlance; BalanceDetailInfo balanceDetails = new BalanceDetailInfo(); balanceDetails.UserId = InpourRequest.UserId; balanceDetails.UserName = user.Username; balanceDetails.TradeDate = now; balanceDetails.TradeType = selfhelpInpour; balanceDetails.Income = new decimal?(InpourRequest.InpourBlance); balanceDetails.Balance = num; if (paymode != null) { balanceDetails.Remark = "充值支付方式:" + paymode.Name; } if (SubsiteStoreHelper.AddBalanceDetail(balanceDetails, InpourId)) { Users.ClearUserCache(user); ResponseStatus(true, "success"); } else { SubsiteStoreHelper.RemoveInpourRequest(InpourId); ResponseStatus(false, "fail"); } }
private void btnEditHotkeyword_Click(object sender, EventArgs e) { int hid = Convert.ToInt32(txtHid.Value); if (string.IsNullOrEmpty(txtEditHotKeyword.Text.Trim()) || (txtEditHotKeyword.Text.Trim().Length > 60)) { ShowMsg("热门关键字不能为空,长度限制在60个字符以内", false); } else if (!dropEditCategory.SelectedValue.HasValue) { ShowMsg("请选择商品主分类", false); } else { Regex regex = new Regex("^(?!_)(?!.*?_$)(?!-)(?!.*?-$)[a-zA-Z0-9_一-龥-]+$"); if (!regex.IsMatch(txtEditHotKeyword.Text.Trim())) { ShowMsg("热门关键字只能输入汉字,数字,英文,下划线,减号,不能以下划线、减号开头或结尾", false); } else if ((string.Compare(txtEditHotKeyword.Text.Trim(), hiHotKeyword.Value) != 0) && IsSame(txtEditHotKeyword.Text.Trim(), Convert.ToInt32(dropEditCategory.SelectedValue.Value))) { ShowMsg("存在相同的的关键字,编辑失败", false); } else if ((((string.Compare(dropEditCategory.SelectedValue.Value.ToString(), hicategory.Value) == 0) & (string.Compare(txtEditHotKeyword.Text, hiHotKeyword.Value) != 0)) && IsSame(txtEditHotKeyword.Text.Trim(), Convert.ToInt32(dropEditCategory.SelectedValue.Value))) || (((string.Compare(txtEditHotKeyword.Text.Trim(), hiHotKeyword.Value) == 0) && (string.Compare(dropEditCategory.SelectedValue.Value.ToString(), hicategory.Value) != 0)) && IsSame(txtEditHotKeyword.Text.Trim(), Convert.ToInt32(dropEditCategory.SelectedValue.Value)))) { ShowMsg("同一分类型不允许存在相同的关键字,编辑失败", false); } else { SubsiteStoreHelper.UpdateHotWords(hid, dropEditCategory.SelectedValue.Value, txtEditHotKeyword.Text.Trim()); BindData(); } } }
private void btnSubmitHotkeyword_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtHotKeywords.Text.Trim()) || (txtHotKeywords.Text.Trim().Length > 60)) { ShowMsg("热门关键字不能为空", false); } else if (!dropCategory.SelectedValue.HasValue) { ShowMsg("请选择商品主分类", false); } else { string[] strArray = txtHotKeywords.Text.Trim().Replace("\r\n", "\n").Replace("\n", "*").Split(new char[] { '*' }); int num = 0; foreach (string str in strArray) { Regex regex = new Regex("^(?!_)(?!.*?_$)(?!-)(?!.*?-$)[a-zA-Z0-9_一-龥-]+$"); if (!(!regex.IsMatch(str) || IsSame(str, Convert.ToInt32(dropCategory.SelectedValue.Value)))) { SubsiteStoreHelper.AddHotkeywords(dropCategory.SelectedValue.Value, str); num++; } } if (num > 0) { ShowMsg(string.Format("成功添加了{0}个热门关键字", num), true); txtHotKeywords.Text = ""; BindData(); } } }
private void dlstVote_ItemDataBound(object sender, DataListItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { long voteId = Convert.ToInt64(this.dlstVote.DataKeys[e.Item.ItemIndex]); VoteInfo voteById = SubsiteStoreHelper.GetVoteById(voteId); IList <VoteItemInfo> voteItems = SubsiteStoreHelper.GetVoteItems(voteId); for (int i = 0; i < voteItems.Count; i++) { if (voteById.VoteCounts != 0) { voteItems[i].Percentage = decimal.Parse(((voteItems[i].ItemCount / voteById.VoteCounts) * 100M).ToString("F", CultureInfo.InvariantCulture)); } else { voteItems[i].Percentage = 0M; } } GridView view = (GridView)e.Item.FindControl("grdVoteItem"); if (view != null) { view.DataSource = voteItems; view.DataBind(); } } }
private void grdHotKeywords_RowDeleting(object sender, GridViewDeleteEventArgs e) { int hid = (int)grdHotKeywords.DataKeys[e.RowIndex].Value; SubsiteStoreHelper.DeleteHotKeywords(hid); BindData(); }
private void BindFriendlyLinks() { IList <FriendlyLinksInfo> friendlyLinks = SubsiteStoreHelper.GetFriendlyLinks(); grdGroupList.DataSource = friendlyLinks; grdGroupList.DataBind(); }
private void btnEditTradePassword_Click(object sender, System.EventArgs e) { Hidistro.Membership.Context.Distributor distributor = SubsiteStoreHelper.GetDistributor(); if (string.IsNullOrEmpty(this.txtOldTradePassword.Text)) { this.ShowMsg("请输入旧交易密码", false); return; } if (string.IsNullOrEmpty(this.txtNewTradePassword.Text) || this.txtNewTradePassword.Text.Length > 20 || this.txtNewTradePassword.Text.Length < 6) { this.ShowMsg("交易密码不能为空,长度限制在6-20个字符之间", false); return; } if (this.txtNewTradePassword.Text != this.txtTradePasswordCompare.Text) { this.ShowMsg("输入的两次密码不一致", false); return; } if (distributor.ChangeTradePassword(this.txtOldTradePassword.Text, this.txtNewTradePassword.Text)) { distributor.OnDealPasswordChanged(new Hidistro.Membership.Context.UserEventArgs(distributor.Username, null, this.txtNewTradePassword.Text)); this.ShowMsg("交易密码修改成功", true); return; } this.ShowMsg("交易密码修改失败", false); }
private void btnSubmit_Click(object sender, EventArgs e) { if (this.ValidateCreateOrder()) { PurchaseOrderInfo purchaseOrderInfo = this.GetPurchaseOrderInfo(); if (purchaseOrderInfo.PurchaseOrderItems.Count == 0) { this.ShowMsg("您暂时未选择您要添加的商品", false); } else if (SubsiteSalesHelper.CreatePurchaseOrder(purchaseOrderInfo)) { SubsiteSalesHelper.ClearPurchaseShoppingCart(); int.Parse(this.radioPaymentMode.SelectedValue); PaymentModeInfo paymentMode = SubsiteStoreHelper.GetPaymentMode(int.Parse(this.radioPaymentMode.SelectedValue)); if ((paymentMode != null) && paymentMode.Gateway.ToLower().Equals("hishop.plugins.payment.podrequest")) { this.ShowMsg("您选择的是货到付款方式,请等待主站发货", true); } else if ((paymentMode != null) && paymentMode.Gateway.ToLower().Equals("hishop.plugins.payment.bankrequest")) { this.ShowMsg("您选择的是线下付款方式,请与主站管理员联系", true); } else { base.Response.Redirect(Globals.ApplicationPath + "/Shopadmin/purchaseOrder/Pay.aspx?PurchaseOrderId=" + purchaseOrderInfo.PurchaseOrderId + "&PayMode=" + this.radioPaymentMode.SelectedValue); } } else { this.ShowMsg("提交采购单失败", false); } } }
protected void Page_Load(object sender, EventArgs e) { if (!long.TryParse(this.Page.Request.QueryString["VoteId"], out this.voteId)) { base.GotoResourceNotFound(); } else { this.btnEditVote.Click += new EventHandler(this.btnEditVote_Click); if (!this.Page.IsPostBack) { VoteInfo voteById = SubsiteStoreHelper.GetVoteById(this.voteId); IList <VoteItemInfo> voteItems = SubsiteStoreHelper.GetVoteItems(this.voteId); if (voteById == null) { base.GotoResourceNotFound(); } else { this.txtAddVoteName.Text = Globals.HtmlDecode(voteById.VoteName); this.checkIsBackup.Checked = voteById.IsBackup; this.txtMaxCheck.Text = voteById.MaxCheck.ToString(); string str = ""; foreach (VoteItemInfo info2 in voteItems) { str = str + Globals.HtmlDecode(info2.VoteItemName) + "\r\n"; } this.txtValues.Text = str; } } } }
private void btnSave_Click(object sender, EventArgs e) { if (this.ValidationInput()) { Distributor distributor = SubsiteStoreHelper.GetDistributor(); distributor.RealName = this.txtRealName.Text.Trim().Replace('"', '“'); distributor.CompanyName = this.txtCompanyName.Text.Trim(); if (this.rsddlRegion.GetSelectedRegionId().HasValue) { distributor.RegionId = this.rsddlRegion.GetSelectedRegionId().Value; distributor.TopRegionId = RegionHelper.GetTopRegionId(distributor.RegionId); } distributor.Email = this.txtprivateEmail.Text.Trim(); distributor.Address = this.txtAddress.Text.Trim(); distributor.Zipcode = this.txtZipcode.Text.Trim(); distributor.QQ = this.txtQQ.Text.Trim(); distributor.Wangwang = this.txtWangwang.Text.Trim(); distributor.MSN = this.txtMSN.Text.Trim(); distributor.TelPhone = this.txtTel.Text.Trim(); distributor.CellPhone = this.txtCellPhone.Text.Trim(); distributor.IsCreate = false; if (this.ValidationDistributorRequest(distributor)) { if (SubsiteStoreHelper.UpdateDistributor(distributor)) { this.ShowMsg("成功的修改了信息", true); } else { this.ShowMsg("修改失败", false); } } } }
private void btnConfirm_Click(object sender, System.EventArgs e) { PaymentModeInfo paymentMode = SubsiteStoreHelper.GetPaymentMode(this.paymentModeId); InpourRequestInfo inpourRequestInfo = new InpourRequestInfo { InpourId = this.GenerateInpourId(), TradeDate = System.DateTime.Now, InpourBlance = this.balance, UserId = Hidistro.Membership.Context.HiContext.Current.User.UserId, PaymentId = paymentMode.ModeId }; if (SubsiteStoreHelper.AddInpourBalance(inpourRequestInfo)) { string attach = ""; System.Web.HttpCookie httpCookie = Hidistro.Membership.Context.HiContext.Current.Context.Request.Cookies["Token_" + Hidistro.Membership.Context.HiContext.Current.User.UserId.ToString()]; if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value)) { attach = httpCookie.Value; } string text = inpourRequestInfo.InpourId.ToString(System.Globalization.CultureInfo.InvariantCulture); PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), text, inpourRequestInfo.InpourBlance + paymentMode.CalcPayCharge(inpourRequestInfo.InpourBlance), "预付款充值", "操作流水号-" + text, Hidistro.Membership.Context.HiContext.Current.User.Email, inpourRequestInfo.TradeDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("DistributorInpourReturn_url", new object[] { paymentMode.Gateway })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("DistributorInpourNotify_url", new object[] { paymentMode.Gateway })), attach); paymentRequest.SendRequest(); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!long.TryParse(this.Page.Request.QueryString["VoteId"], out this.voteId)) { base.GotoResourceNotFound(); return; } this.btnEditVote.Click += new System.EventHandler(this.btnEditVote_Click); if (!this.Page.IsPostBack) { VoteInfo voteById = SubsiteStoreHelper.GetVoteById(this.voteId); System.Collections.Generic.IList <VoteItemInfo> voteItems = SubsiteStoreHelper.GetVoteItems(this.voteId); if (voteById == null) { base.GotoResourceNotFound(); return; } this.txtAddVoteName.Text = Globals.HtmlDecode(voteById.VoteName); this.checkIsBackup.Checked = voteById.IsBackup; this.txtMaxCheck.Text = voteById.MaxCheck.ToString(); string text = ""; foreach (VoteItemInfo current in voteItems) { text = text + Globals.HtmlDecode(current.VoteItemName) + "\r\n"; } this.txtValues.Text = text; } }
private void Notify_Finished(object sender, FinishedEventArgs e) { System.DateTime now = System.DateTime.Now; Hidistro.Membership.Context.Distributor distributor = Hidistro.Membership.Context.Users.GetUser(this.InpourRequest.UserId, false) as Hidistro.Membership.Context.Distributor; decimal balance = distributor.Balance + this.InpourRequest.InpourBlance; BalanceDetailInfo balanceDetailInfo = new BalanceDetailInfo(); balanceDetailInfo.UserId = this.InpourRequest.UserId; balanceDetailInfo.UserName = distributor.Username; balanceDetailInfo.TradeDate = now; balanceDetailInfo.TradeType = TradeTypes.SelfhelpInpour; balanceDetailInfo.Income = new decimal?(this.InpourRequest.InpourBlance); balanceDetailInfo.Balance = balance; balanceDetailInfo.InpourId = this.InpourRequest.InpourId; if (this.paymode != null) { balanceDetailInfo.Remark = "充值支付方式:" + this.paymode.Name; } if (SubsiteStoreHelper.Recharge(balanceDetailInfo)) { Hidistro.Membership.Context.Users.ClearUserCache(distributor); this.ResponseStatus(true, "success"); } else { SubsiteStoreHelper.RemoveInpourRequest(this.InpourId); this.ResponseStatus(false, "fail"); } }
private void dlstVote_ItemCommand(object source, DataListCommandEventArgs e) { if ((e.CommandName != "Sort") && (e.CommandName == "IsBackup")) { SubsiteStoreHelper.SetVoteIsBackup(Convert.ToInt64(this.dlstVote.DataKeys[e.Item.ItemIndex])); this.BindVote(); } }
private void dlstVote_ItemCommand(object sender, System.Web.UI.WebControls.DataListCommandEventArgs e) { if (e.CommandName != "Sort" && e.CommandName == "IsBackup") { SubsiteStoreHelper.SetVoteIsBackup(System.Convert.ToInt64(this.dlstVote.DataKeys[e.Item.ItemIndex])); this.BindVote(); } }
private void btnConfirmPay_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.txtTradePassword.Text)) { this.ShowMsg("请输入交易密码", false); } else { int num; int.TryParse(base.Request["PayMode"], out num); SubsiteStoreHelper.GetPaymentMode(num); if (((decimal)this.lblUseableBalance.Money) < ((decimal)this.lblTotalPrice.Money)) { this.ShowMsg("您的预付款金额不足", false); } else { Distributor user = SubsiteStoreHelper.GetDistributor(); if ((user.Balance - user.RequestBalance) < this.purchaseOrder.GetPurchaseTotal()) { this.ShowMsg("您的预付款金额不足", false); } else { BalanceDetailInfo balance = new BalanceDetailInfo(); balance.UserId = user.UserId; balance.UserName = user.Username; balance.TradeType = TradeTypes.Consume; balance.TradeDate = DateTime.Now; balance.Expenses = new decimal?(this.purchaseOrder.GetPurchaseTotal()); balance.Balance = user.Balance - this.purchaseOrder.GetPurchaseTotal(); balance.Remark = string.Format("采购单{0}的付款", this.purchaseOrder.PurchaseOrderId); user.TradePassword = this.txtTradePassword.Text; if (Users.ValidTradePassword(user)) { if (!SubsiteSalesHelper.ConfirmPay(balance, this.purchaseOrder)) { this.ShowMsg("付款失败", false); } else { PurchaseDebitNote note = new PurchaseDebitNote(); note.NoteId = Globals.GetGenerateId(); note.PurchaseOrderId = this.purchaseOrderId; note.Operator = HiContext.Current.User.Username; note.Remark = "分销商采购单预付款支付成功"; SubsiteSalesHelper.SavePurchaseDebitNote(note); this.ShowMsg("采购单预付款支付成功", true); } } else { this.ShowMsg("交易密码错误", false); } } } } }