protected void Delete_Click(object sender, EventArgs e) { for (int i = 0; i < HomeParkGridView.Rows.Count; i++) { CheckBox chkSelect = (CheckBox)HomeParkGridView.Rows[i].FindControl("chkSelect"); if (chkSelect.Checked) { bll.DeleteHomePark(Convert.ToInt32(HomeParkGridView.DataKeys[i].Value.ToString())); } } HomeParkGridView.DataSource = bll.GetAllHomePark(); HomeParkGridView.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) { Response.Redirect("../Login.aspx"); } else { if (!IsPostBack) { HomeParkGridView.DataSource = bll.GetAllHomePark(); HomeParkGridView.DataBind(); } } }
protected void HomeParkGridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { HomeParkGridView.PageIndex = e.NewPageIndex; HomeParkGridView.DataSource = bll.GetAllHomePark(); HomeParkGridView.DataBind(); }