Example #1
0
        private void lkbtnDeleteCheck_Click(object sender, System.EventArgs e)
        {
            int num = 0;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdCountDownsList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    num++;
                    int countDownId = System.Convert.ToInt32(this.grdCountDownsList.DataKeys[gridViewRow.RowIndex].Value, System.Globalization.CultureInfo.InvariantCulture);
                    PromoteHelper.DeleteCountDown(countDownId);
                }
            }
            if (num != 0)
            {
                this.BindCountDown();
                this.ShowMsg(string.Format(System.Globalization.CultureInfo.InvariantCulture, "成功删除\"{0}\"条限时抢购活动", new object[]
                {
                    num
                }), true);
                return;
            }
            this.ShowMsg("请先选择需要删除的限时抢购活动", false);
        }
Example #2
0
 private void grdGroupBuyList_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
 {
     if (PromoteHelper.DeleteCountDown((int)this.grdCountDownsList.DataKeys[e.RowIndex].Value))
     {
         this.BindCountDown();
         this.ShowMsg("成功删除了选择的限时抢购活动", true);
         return;
     }
     this.ShowMsg("删除失败", false);
 }
Example #3
0
 private void grdGroupBuyList_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     if (PromoteHelper.DeleteCountDown((int)grdCountDownsList.DataKeys[e.RowIndex].Value))
     {
         BindCountDown();
         ShowMsg("成功删除了选择的限时抢购活动", true);
     }
     else
     {
         ShowMsg("删除失败", false);
     }
 }
Example #4
0
        private void lkbtnDeleteCheck_Click(object sender, EventArgs e)
        {
            int num = 0;

            foreach (GridViewRow row in grdCountDownsList.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if (box.Checked)
                {
                    num++;
                    PromoteHelper.DeleteCountDown(Convert.ToInt32(grdCountDownsList.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture));
                }
            }
            if (num != 0)
            {
                BindCountDown();
                ShowMsg(string.Format(CultureInfo.InvariantCulture, "成功删除\"{0}\"条限时抢购活动", new object[] { num }), true);
            }
            else
            {
                ShowMsg("请先选择需要删除的限时抢购活动", false);
            }
        }
Example #5
0
        public void Delete(HttpContext context)
        {
            string text = context.Request["CountDownIds"];

            if (string.IsNullOrWhiteSpace(text))
            {
                throw new HidistroAshxException("错误的活动编号");
            }
            int[] array = (from d in text.Split(',')
                           select int.Parse(d)).ToArray();
            int num  = 0;
            int num2 = array.Count();

            int[] array2 = array;
            foreach (int countDownId in array2)
            {
                CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(countDownId, 0);
                if (DateTime.Now >= countDownInfo.StartDate && DateTime.Now <= countDownInfo.EndDate)
                {
                    if (num2 == 1)
                    {
                        throw new HidistroAshxException("活动正在进行中,不能删除!");
                    }
                }
                else
                {
                    num++;
                    PromoteHelper.DeleteCountDown(countDownId);
                }
            }
            if (num > 0)
            {
                base.ReturnSuccessResult(context, $"成功删除{num}条活动!", 0, true);
                return;
            }
            throw new HidistroAshxException("选择的活动暂不可删除!");
        }