protected void lbtnDelete_Click(object sender, EventArgs e) { List <object> fieldValues = ASPxGridView1_Congty.GetSelectedFieldValues(new string[] { "ID" }); foreach (var item in fieldValues) { _CompanyRepo.Remove(Utils.CIntDef(item)); } Response.Redirect("danh-sach-cong-ty.aspx"); }
private void LoadList() { try { var list = _CompanyRepo.GetListByContainsAll(txtKeyword.Value); HttpContext.Current.Session["listCompany"] = list; ASPxGridView1_Congty.DataSource = list; ASPxGridView1_Congty.DataBind(); } catch //(Exception) { //throw; } }
protected void Page_Load(object sender, EventArgs e) { bool isPermission = _UnitDataRepo.checkPermissionPage("danh-sach-cong-ty.aspx", Utils.CIntDef(Session["groupId"]), Utils.CIntDef(Session["groupType"])); if (!isPermission) { Response.Write("<script>alert('Bạn không có quyền truy cập vào trang này');location.href='trang-chu.aspx';</script>"); } if (!IsPostBack) { LoadList(); } else { ASPxGridView1_Congty.DataSource = HttpContext.Current.Session["listCompany"]; ASPxGridView1_Congty.DataBind(); } }