示例#1
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (Convert.ToInt32(Request.Cookies["login"].Values["_type"]) == 1)
     {
         if (e.CommandName == "Delete")
         {
             admin admin1 = new admin();
             admin1.id = Convert.ToInt32(e.CommandArgument);
             BLLadmin blladmin1 = new BLLadmin();
             int      result    = blladmin1.deleteAdmin(admin1);
             if (result > 0)
             {
                 Common.MessageAlert.AlertLocation(Page, "alert('删除成功');location.href='adminList.aspx'");
             }
             else
             {
                 Common.MessageAlert.Alert(Page, "删除失败");
             }
         }
     }
     else
     {
         Response.Write("<script>alert('对不起您没有这个权限');</script>");
     }
 }