Example #1
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            //ChkAdminLevel("sys_customer_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            BLL.Contacts bll    = new BLL.Contacts();
            string       result = "";

            log = new Model.business_log();
            string        idstr = string.Empty;
            int           success = 0, error = 0;
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    result = bll.Delete(Convert.ToInt32(id), manager);
                    if (result == "")
                    {
                        success++;
                    }
                    else
                    {
                        error++;
                        sb.Append(result + "<br/>");
                    }
                }
            }
            JscriptMsg("共选择" + (success + error) + "条记录,成功" + success + "条,失败" + error + "条<br/>" + sb.ToString(), "customer_edit.aspx?action=" + action + "&id=" + this.id);
        }