您好,欢迎来到暴趣科技网。
搜索
您的当前位置:首页后台数据管理

后台数据管理

来源:暴趣科技网
        #region 全选
        protected void cbAll_CheckedChanged(object sender, EventArgs e)
        {
            foreach (RepeaterItem item in rptList.Items)
            {
                CheckBox cb = item.FindControl("cbItems") as CheckBox;
                cb.Checked = cbAll.Checked;
            }
        } 
        #endregion


        #region 删除
        protected void btnDel_Click(object sender, EventArgs e)
        {
            string ids = "";
            foreach (RepeaterItem item in rptList.Items)
            {
                CheckBox cb = item.FindControl("cbItems") as CheckBox;
                if (cb.Checked) 
                {
                    ids = ids + cb.ToolTip + ",";
                }
            }
            ids = ids.TrimEnd(',');
            if (string.IsNullOrWhiteSpace(ids))
            {
                HtmlCommon.ShowMsg("请选择您要删除的数据");
                return;
            }
            else 
            {
                string[] strArry = ids.Split(',');
                BLL.QuestionBLL Bll = new BLL.QuestionBLL();
                int result = Bll.DeleteByIDs(strArry);
                if (result > 0)
                {
                    HtmlCommon.ShowMsg("删除成功!", "dept.aspx");
                }
                else 
                {
                    HtmlCommon.ShowMsg("删除失败!");
                }
            }


        } 
        #endregion

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- baoquwan.com 版权所有 湘ICP备2024080961号-7

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务