Пример #1
0
        private void lkbtnDeleteCheck_Click(object sender, System.EventArgs e)
        {
            System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>();
            int num = 0;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdHelpList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    num++;
                    int item = System.Convert.ToInt32(this.grdHelpList.DataKeys[gridViewRow.RowIndex].Value, System.Globalization.CultureInfo.InvariantCulture);
                    list.Add(item);
                }
            }
            if (num != 0)
            {
                int num2 = ArticleHelper.DeleteHelps(list);
                this.BindSearch();
                this.ShowMsg(string.Format(System.Globalization.CultureInfo.InvariantCulture, "成功删除\"{0}\"篇帮助", new object[]
                {
                    num2
                }), true);
                return;
            }
            this.ShowMsg("请先选择需要删除的帮助", false);
        }
Пример #2
0
        private void Deletes(HttpContext context)
        {
            string      text = context.Request["ids"];
            IList <int> list = new List <int>();

            if (text.Length < 0)
            {
                throw new HidistroAshxException("错误的参数!");
            }
            string[] array = text.Split(',');
            foreach (string text2 in array)
            {
                if (!string.IsNullOrEmpty(text2))
                {
                    list.Add(text2.ToInt(0));
                }
            }
            int num = ArticleHelper.DeleteHelps(list);

            if (num > 0)
            {
                base.ReturnSuccessResult(context, $"成功删除{num}篇帮助", 0, true);
                return;
            }
            throw new HidistroAshxException("删除失败!");
        }
Пример #3
0
        private void lkbtnDeleteCheck_Click(object sender, EventArgs e)
        {
            IList <int> helps = new List <int>();
            int         num2  = 0;

            foreach (GridViewRow row in this.grdHelpList.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if (box.Checked)
                {
                    num2++;
                    int item = Convert.ToInt32(this.grdHelpList.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture);
                    helps.Add(item);
                }
            }
            if (num2 != 0)
            {
                int num3 = ArticleHelper.DeleteHelps(helps);
                this.BindSearch();
                this.ShowMsg(string.Format(CultureInfo.InvariantCulture, "成功删除\"{0}\"篇帮助", new object[] { num3 }), true);
            }
            else
            {
                this.ShowMsg("请先选择需要删除的帮助", false);
            }
        }