예제 #1
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            BLL.finance   bll = new BLL.finance();
            string        result = "";
            int           success = 0, error = 0;
            StringBuilder sb = new StringBuilder();

            manager = GetAdminInfo();
            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(), Utils.CombUrlTxt("selfFinance_list.aspx", "page={0}&ddltype={1}&txtOrder={2}&txtCusName={3}&hCusId={4}&ddlcheck={5}&txtsDate={6}&txteDate={7}", "__id__", _type, _ordernum, _cusname, _cusid, _status, _smonth, _emonth));
        }
예제 #2
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            if (_type == "true")
            {
                ChkAdminLevel("sys_finance_list1", DTEnums.ActionEnum.View.ToString()); //检查权限
            }
            else
            {
                ChkAdminLevel("sys_finance_list0", DTEnums.ActionEnum.View.ToString()); //检查权限
            }
            BLL.finance   bll = new BLL.finance();
            string        result = "";
            int           success = 0, error = 0;
            StringBuilder sb = new StringBuilder();

            manager = GetAdminInfo();
            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(), backUrl());
        }