Esempio n. 1
0
 protected void btnDeleteSelect_Click(object sender, EventArgs e)
 {
     if (Session["ZT_ADMIN"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         if (!Communal.CheckQx("MenuDelete.aspx"))
         {
             Response.Redirect("RightsWarn.aspx");
         }
         else
         {
             string DeleteTitle = "";
             foreach (GridViewRow gr in this.GridView1.Rows)
             {
                 CheckBox cb = (CheckBox)gr.Cells[1].FindControl("Select");
                 if (cb.Checked)
                 {
                     //删除数据库信息
                     Label ll = (Label)gr.Cells[1].FindControl("lblElementID");
                     int ElementID = Convert.ToInt32(ll.Text);
                     WebProject.BLL.SysManage.ZT_SYS_ElementInfo bll_ElementInfo = new WebProject.BLL.SysManage.ZT_SYS_ElementInfo();
                     DeleteTitle += bll_ElementInfo.GetModel(ElementID).ElementName + ",";
                     bll_ElementInfo.Delete(ElementID);
                 }
             }
             LogManage.WriteLog(Request.UserHostAddress, "菜单管理", "删除菜单", "成功", "菜单名称:" + DeleteTitle.TrimEnd(',') + ", 删除人:" + SessionUtil.GetAdminSession().AdminNo);
             ShowData();
         }
     }
 }
Esempio n. 2
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        if (!Communal.CheckQx("MenuDelete.aspx"))
        {
            Response.Redirect("RightsWarn.aspx");
        }
        else
        {
            //删除数据库的信息
            Label ll = (Label)this.GridView1.Rows[e.RowIndex].Cells[1].FindControl("lblElementID");
            int ElementID = Convert.ToInt32(ll.Text);
            WebProject.BLL.SysManage.ZT_SYS_ElementInfo bll_ElementInfo = new WebProject.BLL.SysManage.ZT_SYS_ElementInfo();
            LogManage.WriteLog(Request.UserHostAddress, "菜单管理", "删除菜单", "成功", "菜单名称:" + bll_ElementInfo.GetModel(ElementID).ElementName + ", 删除人:" + SessionUtil.GetAdminSession().AdminNo);

            bll_ElementInfo.Delete(ElementID);

            //重新加载信息
            ShowData();
        }
    }