protected void Page_Load(object sender, System.EventArgs e) { if (!int.TryParse(this.Page.Request.QueryString["activityId"], out this.activityId)) { base.GotoResourceNotFound(); return; } this.btnSave.Click += new System.EventHandler(this.btnSave_Click); if (!this.Page.IsPostBack) { PromotionInfo promotion = SubsitePromoteHelper.GetPromotion(this.activityId); this.promotionView.Promotion = promotion; this.txtPromoteType.Text = ((int)promotion.PromoteType).ToString(); if (promotion.PromoteType != PromoteType.FullQuantityDiscount) { if (promotion.PromoteType != PromoteType.FullQuantityReduced) { this.txtCondition.Text = promotion.Condition.ToString("F2"); goto IL_DB; } } this.txtCondition.Text = promotion.Condition.ToString("F0"); IL_DB: this.txtDiscountValue.Text = promotion.DiscountValue.ToString("F2"); } }
private void grdPromotionProducts_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { if (SubsitePromoteHelper.DeletePromotionProducts(this.activityId, new int?((int)this.grdPromotionProducts.DataKeys[e.RowIndex].Value))) { base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true); } }
private void lkbtnDeleteCheck_Click(object sender, System.EventArgs e) { int num = 0; foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdBundlingList.Rows) { System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol"); if (checkBox.Checked) { num++; int bundlingID = System.Convert.ToInt32(this.grdBundlingList.DataKeys[gridViewRow.RowIndex].Value, System.Globalization.CultureInfo.InvariantCulture); SubsitePromoteHelper.DeleteBundlingProduct(bundlingID); } } if (num != 0) { this.ShowMsg(string.Format(System.Globalization.CultureInfo.InvariantCulture, "成功删除\"{0}\"个捆绑商品", new object[] { num }), true); this.BindBundlingProducts(); return; } this.ShowMsg("请先选择需要删除的捆绑商品", false); }
protected void Page_Load(object sender, System.EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["isCallback"]) && base.Request.QueryString["isCallback"] == "true") { this.DoCallback(); return; } if (!int.TryParse(this.Page.Request.QueryString["activityId"], out this.activityId)) { base.GotoResourceNotFound(); return; } this.btnFinesh.Click += new System.EventHandler(this.btnFinesh_Click); this.hdactivy.Value = this.activityId.ToString(); this.btnDeleteAll.Click += new System.EventHandler(this.btnDeleteAll_Click); this.grdPromotionProducts.RowDeleting += new System.Web.UI.WebControls.GridViewDeleteEventHandler(this.grdPromotionProducts_RowDeleting); if (!this.Page.IsPostBack) { PromotionInfo promotion = SubsitePromoteHelper.GetPromotion(this.activityId); if (promotion == null) { base.GotoResourceNotFound(); return; } this.litPromotionName.Text = promotion.Name; this.BindPromotionProducts(); } }
private void btnDeleteAll_Click(object sender, System.EventArgs e) { if (SubsitePromoteHelper.DeletePromotionProducts(this.activityId, null)) { base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true); } }
protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(base.Request.QueryString["CountDownId"], out this.countDownId)) { base.GotoResourceNotFound(); } else { this.btnUpdateCountDown.Click += new EventHandler(this.btnUpdateGroupBuy_Click); if (!base.IsPostBack) { this.dropGroupBuyProduct.DataBind(); this.dropCategories.DataBind(); this.HourDropDownList1.DataBind(); this.drophours.DataBind(); CountDownInfo countDownInfo = SubsitePromoteHelper.GetCountDownInfo(this.countDownId); if (countDownInfo == null) { base.GotoResourceNotFound(); } else { this.LoadCountDown(countDownInfo); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(this.Page.Request.QueryString["activityId"], out this.activityId)) { base.GotoResourceNotFound(); } else { this.btnNext.Click += new EventHandler(this.btnNext_Click); if (!this.Page.IsPostBack) { PromotionInfo promotion = SubsitePromoteHelper.GetPromotion(this.activityId); this.promotionView.Promotion = promotion; this.txtPromoteType.Text = ((int)promotion.PromoteType).ToString(); if (promotion.Condition != 0M) { this.txtCondition.Text = promotion.Condition.ToString("F0"); } if (promotion.DiscountValue != 0M) { if (promotion.PromoteType == PromoteType.SentProduct) { this.txtDiscountValue.Text = promotion.DiscountValue.ToString("F0"); } else { this.txtDiscountValue.Text = promotion.DiscountValue.ToString("F2"); } } } } }
protected void grdGroupBuyList_RowCommand(object sender, GridViewCommandEventArgs e) { int rowIndex = ((GridViewRow)((Control)e.CommandSource).NamingContainer).RowIndex; int countDownId = (int)grdCountDownsList.DataKeys[rowIndex].Value; int displaySequence = int.Parse((grdCountDownsList.Rows[rowIndex].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None); int replaceCountDownId = 0; int replaceDisplaySequence = 0; if (e.CommandName == "Fall") { if (rowIndex < (grdCountDownsList.Rows.Count - 1)) { replaceCountDownId = (int)grdCountDownsList.DataKeys[rowIndex + 1].Value; replaceDisplaySequence = int.Parse((grdCountDownsList.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None); } } else if ((e.CommandName == "Rise") && (rowIndex > 0)) { replaceCountDownId = (int)grdCountDownsList.DataKeys[rowIndex - 1].Value; replaceDisplaySequence = int.Parse((grdCountDownsList.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None); } if (replaceCountDownId > 0) { SubsitePromoteHelper.SwapCountDownSequence(countDownId, replaceCountDownId, displaySequence, replaceDisplaySequence); BindCountDown(); } }
private void btnSend_Click(object sender, EventArgs e) { CouponItemInfo item = new CouponItemInfo(); IList <CouponItemInfo> listCouponItem = new List <CouponItemInfo>(); IList <Member> memdersByNames = new List <Member>(); if (this.rdoName.Checked) { if (!string.IsNullOrEmpty(this.txtMemberNames.Text.Trim())) { IList <string> names = new List <string>(); string[] strArray = this.txtMemberNames.Text.Trim().Replace("\r\n", "\n").Replace("\n", "*").Split(new char[] { '*' }); for (int i = 0; i < strArray.Length; i++) { if (this.IsMembers(strArray[i])) { names.Add(strArray[i]); } } memdersByNames = SubsitePromoteHelper.GetMemdersByNames(names); } string claimCode = string.Empty; foreach (Member member in memdersByNames) { claimCode = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 15); item = new CouponItemInfo(this.couponId, claimCode, new int?(member.UserId), member.Username, member.Email, DateTime.Now); listCouponItem.Add(item); } if (listCouponItem.Count <= 0) { this.ShowMsg("你输入的会员名中没有一个正确的,请输入正确的会员名", false); return; } SubsiteCouponHelper.SendClaimCodes(this.couponId, listCouponItem); this.txtMemberNames.Text = string.Empty; this.ShowMsg(string.Format("此次发送操作已成功,优惠券发送数量:{0}", listCouponItem.Count), true); } if (this.rdoRank.Checked) { memdersByNames = SubsitePromoteHelper.GetMembersByRank(this.rankList.SelectedValue); string str3 = string.Empty; foreach (Member member2 in memdersByNames) { str3 = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 15); item = new CouponItemInfo(this.couponId, str3, new int?(member2.UserId), member2.Username, member2.Email, DateTime.Now); listCouponItem.Add(item); } if (listCouponItem.Count <= 0) { this.ShowMsg("您选择的会员等级下面没有会员", false); } else { SubsiteCouponHelper.SendClaimCodes(this.couponId, listCouponItem); this.txtMemberNames.Text = string.Empty; this.ShowMsg(string.Format("此次发送操作已成功,优惠券发送数量:{0}", listCouponItem.Count), true); } } }
protected void btnUpdateGroupBuy_Click(object sender, EventArgs e) { CountDownInfo countDownInfo = new CountDownInfo(); countDownInfo.CountDownId = countDownId; string str = string.Empty; if (dropGroupBuyProduct.SelectedValue > 0) { if ((SubsitePromoteHelper.GetCountDownInfo(countDownId).ProductId != dropGroupBuyProduct.SelectedValue.Value) && SubsitePromoteHelper.ProductCountDownExist(dropGroupBuyProduct.SelectedValue.Value)) { ShowMsg("已经存在此商品的限时抢购活动", false); return; } countDownInfo.ProductId = dropGroupBuyProduct.SelectedValue.Value; } else { str = str + Formatter.FormatErrorMessage("请选择限时抢购商品"); } if (!calendarEndDate.SelectedDate.HasValue) { str = str + Formatter.FormatErrorMessage("请选择结束日期"); } else { countDownInfo.EndDate = calendarEndDate.SelectedDate.Value; } if (!string.IsNullOrEmpty(txtPrice.Text)) { decimal num; if (decimal.TryParse(txtPrice.Text.Trim(), out num)) { countDownInfo.CountDownPrice = num; } else { str = str + Formatter.FormatErrorMessage("价格填写格式不正确"); } } if (!string.IsNullOrEmpty(str)) { ShowMsg(str, false); } else { countDownInfo.Content = txtContent.Text; if (SubsitePromoteHelper.UpdateCountDown(countDownInfo)) { ShowMsg("编辑限时抢购活动成功", true); } else { ShowMsg("编辑限时抢购活动失败", true); } } }
private void grdPromoteSales_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int activityId = int.Parse(this.grdPromoteSales.DataKeys[e.Row.RowIndex].Value.ToString()); Label label = (Label)e.Row.FindControl("lblmemberGrades"); Label label2 = (Label)e.Row.FindControl("lblPromoteType"); Literal literal = (Literal)e.Row.FindControl("ltrPromotionInfo"); IList <MemberGradeInfo> promoteMemberGrades = SubsitePromoteHelper.GetPromoteMemberGrades(activityId); string str = string.Empty; foreach (MemberGradeInfo info in promoteMemberGrades) { str = str + info.Name + ","; } if (!string.IsNullOrEmpty(str)) { str = str.Remove(str.Length - 1); } label.Text = str; switch (((PromoteType)((int)DataBinder.Eval(e.Row.DataItem, "PromoteType")))) { case PromoteType.Discount: label2.Text = "直接打折"; literal.Text = string.Format("折扣值:{0}", DataBinder.Eval(e.Row.DataItem, "DiscountValue", "{0:f2}")); return; case PromoteType.Amount: label2.Text = "固定金额出售"; literal.Text = string.Format("固定金额值:{0}", DataBinder.Eval(e.Row.DataItem, "DiscountValue", "{0:f2}")); return; case PromoteType.Reduced: label2.Text = "优惠金额出售"; literal.Text = string.Format("优惠金额值:{0}", DataBinder.Eval(e.Row.DataItem, "DiscountValue", "{0:f2}")); return; case PromoteType.QuantityDiscount: label2.Text = "按批发数量打折"; literal.Text = string.Format("购买数量:{0} 折扣值:{1}", DataBinder.Eval(e.Row.DataItem, "Condition", "{0:f0}"), DataBinder.Eval(e.Row.DataItem, "DiscountValue", "{0:f2}")); return; case PromoteType.SentGift: label2.Text = "买商品送礼品"; literal.Text = "<a target=\"_blank\" href=\"mygiftlist.aspx?isPromotion=true\">查看促销礼品</a>"; return; case PromoteType.SentProduct: label2.Text = "有买有送"; literal.Text = string.Format("购买数量:{0} 赠送数量:{1}", DataBinder.Eval(e.Row.DataItem, "Condition", "{0:f0}"), DataBinder.Eval(e.Row.DataItem, "DiscountValue", "{0:f0}")); return; default: return; } } }
private void grdGroupBuyList_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow) { FormatedMoneyLabel formatedMoneyLabel = (FormatedMoneyLabel)e.Row.FindControl("lblCurrentPrice"); int groupBuyId = System.Convert.ToInt32(this.grdGroupBuyList.DataKeys[e.Row.RowIndex].Value.ToString()); int prodcutQuantity = int.Parse(System.Web.UI.DataBinder.Eval(e.Row.DataItem, "ProdcutQuantity").ToString()); formatedMoneyLabel.Money = SubsitePromoteHelper.GetCurrentPrice(groupBuyId, prodcutQuantity); } }
private void grdBundlingList_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { if (SubsitePromoteHelper.DeleteBundlingProduct((int)this.grdBundlingList.DataKeys[e.RowIndex].Value)) { this.BindBundlingProducts(); this.ShowMsg("成功删除了选择的捆绑商品!", true); return; } this.ShowMsg("删除失败", false); }
private void grdGroupBuyList_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { if (SubsitePromoteHelper.DeleteCountDown((int)this.grdCountDownsList.DataKeys[e.RowIndex].Value)) { this.BindCountDown(); this.ShowMsg("成功删除了选择的限时抢购活动", true); return; } this.ShowMsg("删除失败", false); }
private void btnSendToRank_Click(object sender, System.EventArgs e) { System.Collections.Generic.IList <MessageBoxInfo> list = new System.Collections.Generic.List <MessageBoxInfo>(); if (this.rdoName.Checked && !string.IsNullOrEmpty(this.txtMemberNames.Text.Trim())) { string text = this.txtMemberNames.Text.Trim().Replace("\r\n", "\n"); string[] array = text.Replace("\n", "*").Split(new char[] { '*' }); for (int i = 0; i < array.Length; i++) { Hidistro.Membership.Context.Member member = this.GetMember(array[i]); if (member != null) { list.Add(new MessageBoxInfo { Accepter = array[i], Sernder = Hidistro.Membership.Context.HiContext.Current.User.Username, Title = this.MessageTitle, Content = this.Content }); } } if (list.Count <= 0) { this.ShowMsg("没有要发送的对象", false); return; } SubsiteCommentsHelper.SendMessageToMember(list); this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", list.Count), true); } if (this.rdoRank.Checked) { System.Collections.Generic.IList <Hidistro.Membership.Context.Member> list2 = new System.Collections.Generic.List <Hidistro.Membership.Context.Member>(); list2 = SubsitePromoteHelper.GetMembersByRank(this.rankList.SelectedValue); foreach (Hidistro.Membership.Context.Member current in list2) { list.Add(new MessageBoxInfo { Accepter = current.Username, Sernder = Hidistro.Membership.Context.HiContext.Current.User.Username, Title = this.MessageTitle, Content = this.Content }); } if (list.Count > 0) { SubsiteCommentsHelper.SendMessageToMember(list); this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", list.Count), true); return; } this.ShowMsg("没有要发送的对象", false); } }
private void btnSuccess_Click(object sender, System.EventArgs e) { if (SubsitePromoteHelper.SetGroupBuyStatus(this.groupBuyId, GroupBuyStatus.Success)) { this.btnFail.Visible = false; this.btnSuccess.Visible = false; this.ShowMsg("成功设置团购活动为成功状态", true); return; } this.ShowMsg("设置团购活动状态失败", true); }
protected void btnEditBindProduct_Click(object sender, System.EventArgs e) { if (string.IsNullOrEmpty(base.Request.Form["selectProductsinfo"])) { this.ShowMsg("获取绑定商品信息错误", false); return; } if (string.IsNullOrEmpty(this.txtBindName.Text) || string.IsNullOrEmpty(this.txtNum.Text) || string.IsNullOrEmpty(this.txtSalePrice.Text)) { this.ShowMsg("你的资料填写不完整", false); return; } BundlingInfo bundlingInfo = new BundlingInfo(); bundlingInfo.BundlingID = this.bundlingid; bundlingInfo.AddTime = System.DateTime.Now; bundlingInfo.Name = this.txtBindName.Text; bundlingInfo.Price = System.Convert.ToDecimal(this.txtSalePrice.Text); bundlingInfo.SaleStatus = System.Convert.ToInt32(this.radstock.SelectedValue); bundlingInfo.Num = System.Convert.ToInt32(this.txtNum.Text); if (!string.IsNullOrEmpty(this.txtShortDescription.Text)) { bundlingInfo.ShortDescription = this.txtShortDescription.Text; } string text = base.Request.Form["selectProductsinfo"]; string[] array = text.Split(new char[] { ',' }); System.Collections.Generic.List <BundlingItemInfo> list = new System.Collections.Generic.List <BundlingItemInfo>(); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text2 = array2[i]; BundlingItemInfo bundlingItemInfo = new BundlingItemInfo(); string[] array3 = text2.Split(new char[] { '|' }); bundlingItemInfo.ProductID = System.Convert.ToInt32(array3[0]); bundlingItemInfo.SkuId = array3[1]; bundlingItemInfo.ProductNum = System.Convert.ToInt32(array3[2]); list.Add(bundlingItemInfo); } bundlingInfo.BundlingItemInfos = list; if (SubsitePromoteHelper.UpdateBundlingProduct(bundlingInfo)) { this.ShowMsg("修改绑定商品成功", true); this.BindEditBindProduct(); return; } this.ShowMsg("修改绑定商品错误", false); }
protected void BindEditBindProduct() { BundlingInfo bundlingInfo = SubsitePromoteHelper.GetBundlingInfo(this.bundlingid); this.txtBindName.Text = bundlingInfo.Name; this.txtNum.Text = bundlingInfo.Num.ToString(); this.txtSalePrice.Text = bundlingInfo.Price.ToString("F"); this.radstock.SelectedValue = Convert.ToBoolean(bundlingInfo.SaleStatus); this.txtShortDescription.Text = bundlingInfo.ShortDescription; this.Rpbinditems.DataSource = bundlingInfo.BundlingItemInfos; this.Rpbinditems.DataBind(); }
private void grdPromoteSales_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { int activityId = (int)this.grdPromoteSales.DataKeys[e.RowIndex].Value; if (SubsitePromoteHelper.DeletePromotion(activityId)) { this.ShowMsg("成功删除了选择的促销活动", true); this.BindProductPromotions(); return; } this.ShowMsg("删除失败", false); }
protected void grdGroupBuyList_RowDeleting(object sender, GridViewDeleteEventArgs e) { if (SubsitePromoteHelper.DeleteCountDown((int)grdCountDownsList.DataKeys[e.RowIndex].Value)) { BindCountDown(); ShowMsg("成功删除了选择的限时抢购活动", true); } else { ShowMsg("删除失败", false); } }
private void btnFinish_Click(object sender, System.EventArgs e) { if (SubsitePromoteHelper.SetGroupBuyEndUntreated(this.groupBuyId)) { this.btnFail.Visible = true; this.btnSuccess.Visible = true; this.btnFinish.Visible = false; this.ShowMsg("成功设置团购活动为结束状态", true); return; } this.ShowMsg("设置团购活动状态失败", true); }
private void dlstSearchProducts_DeleteCommand(object source, DataListCommandEventArgs e) { IList <int> productIds = ProductIds; int itemIndex = e.Item.ItemIndex; int item = int.Parse(dlstSearchProducts.DataKeys[itemIndex].ToString()); productIds.Remove(item); ProductIds = productIds; if (SubsitePromoteHelper.DeletePromotionProducts(activeId, item)) { BindPromoteProducts(); } }
protected void btnSuccess_Click(object sender, EventArgs e) { if (SubsitePromoteHelper.SetGroupBuyStatus(groupBuyId, GroupBuyStatus.Success)) { btnFail.Visible = false; btnSuccess.Visible = false; ShowMsg("成功设置团购活动为成功状态", true); } else { ShowMsg("设置团购活动状态失败", true); } }
private void btnFail_Click(object sender, EventArgs e) { if (SubsitePromoteHelper.SetGroupBuyStatus(this.groupBuyId, GroupBuyStatus.Failed)) { this.btnFail.Visible = false; this.btnSuccess.Visible = false; this.ShowMsg("成功设置团购活动为失败状态", true); } else { this.ShowMsg("设置团购活动状态失败", true); } }
private void btnOrder_Click(object sender, System.EventArgs e) { foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdGroupBuyList.Rows) { int displaySequence = 0; System.Web.UI.WebControls.TextBox textBox = (System.Web.UI.WebControls.TextBox)gridViewRow.FindControl("txtSequence"); if (int.TryParse(textBox.Text.Trim(), out displaySequence)) { int groupBuyId = (int)this.grdGroupBuyList.DataKeys[gridViewRow.RowIndex].Value; SubsitePromoteHelper.SwapGroupBuySequence(groupBuyId, displaySequence); } } this.BindGroupBuy(); }
private void BindPromoteProducts() { Pagination page = new Pagination(); page.PageSize = 10; page.PageIndex = pagerBuyToSend.PageIndex; page.SortOrder = SortAction.Desc; page.SortBy = "DisplaySequence"; DbQueryResult activeProducts = SubsitePromoteHelper.GetActiveProducts(page, activeId); dlstSearchProducts.DataSource = activeProducts.Data; dlstSearchProducts.DataBind(); pagerBuyToSend.TotalRecords = activeProducts.TotalRecords; }
private void btnSendToRank_Click(object sender, EventArgs e) { IList <MessageBoxInfo> messageBoxInfos = new List <MessageBoxInfo>(); if (this.rdoName.Checked && !string.IsNullOrEmpty(this.txtMemberNames.Text.Trim())) { string[] strArray = this.txtMemberNames.Text.Trim().Replace("\r\n", "\n").Replace("\n", "*").Split(new char[] { '*' }); for (int i = 0; i < strArray.Length; i++) { if (this.GetMember(strArray[i]) != null) { MessageBoxInfo item = new MessageBoxInfo(); item.Accepter = strArray[i]; item.Sernder = HiContext.Current.User.Username; item.Title = this.MessageTitle; item.Content = this.Content; messageBoxInfos.Add(item); } } if (messageBoxInfos.Count <= 0) { this.ShowMsg("没有要发送的对象", false); return; } SubsiteCommentsHelper.SendMessageToMember(messageBoxInfos); this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", messageBoxInfos.Count), true); } if (this.rdoRank.Checked) { IList <Member> list2 = new List <Member>(); foreach (Member member2 in SubsitePromoteHelper.GetMembersByRank(this.rankList.SelectedValue)) { MessageBoxInfo info2 = new MessageBoxInfo(); info2.Accepter = member2.Username; info2.Sernder = HiContext.Current.User.Username; info2.Title = this.MessageTitle; info2.Content = this.Content; messageBoxInfos.Add(info2); } if (messageBoxInfos.Count > 0) { SubsiteCommentsHelper.SendMessageToMember(messageBoxInfos); this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", messageBoxInfos.Count), true); } else { this.ShowMsg("没有要发送的对象", false); } } }
protected void btnFinish_Click(object sender, EventArgs e) { if (SubsitePromoteHelper.SetGroupBuyEndUntreated(groupBuyId)) { btnFail.Visible = true; btnSuccess.Visible = true; btnFinish.Visible = false; ShowMsg("成功设置团购活动为结束状态", true); } else { ShowMsg("设置团购活动状态失败", true); } }
private void btnOrder_Click(object sender, EventArgs e) { foreach (GridViewRow row in this.grdCountDownsList.Rows) { int result = 0; TextBox box = (TextBox)row.FindControl("txtSequence"); if (int.TryParse(box.Text.Trim(), out result)) { int countDownId = (int)this.grdCountDownsList.DataKeys[row.RowIndex].Value; SubsitePromoteHelper.SwapCountDownSequence(countDownId, result); } } this.BindCountDown(); }
private void grdPromoteSales_RowDeleting(object sender, GridViewDeleteEventArgs e) { int activityId = (int)grdPromoteSales.DataKeys[e.RowIndex].Value; if (SubsitePromoteHelper.DeletePromotion(activityId)) { ShowMsg("成功删除了选择的促销活动", true); BindPromoteSales(); } else { ShowMsg("删除失败", false); } }