protected void DeleteAdmin(object sender, GridViewDeleteEventArgs e) { int x = e.RowIndex; DataTable data = Admins.Select(); int check = Admins.Delete(int.Parse(data.Rows[x]["User_Id"].ToString())); if (check == 1) { GridView3.DataSource = Admins.Select(); GridView3.DataBind(); } Response.Redirect("ShowUserNew.aspx"); }
protected void BlockUser(object sender, GridViewDeleteEventArgs e) { int x = e.RowIndex; DataTable table = Users.SelectByAccipt(true); if (table.Rows.Count != 0) { string s = table.Rows[x]["User_Id"].ToString(); Users.UpdateState(false, int.Parse(s)); Admins.Delete(int.Parse(table.Rows[x]["User_Id"].ToString())); } GridView1.DataSource = Users.SelectByAccipt(true); GridView1.DataBind(); GridView2.DataSource = Users.SelectByAccipt(false); GridView2.DataBind(); GridView3.DataSource = Admins.Select(); GridView3.DataBind(); Response.Redirect("ShowUserNew.aspx"); }