protected void lbtnDelete_Click(object sender, EventArgs e) { List <object> fieldValues = ASPxGridView1_Customer.GetSelectedFieldValues(new string[] { "ID" }); foreach (var item in fieldValues) { _CustomerRepo.Remove(Utils.CIntDef(item)); } Response.Redirect("danh-sach-khach-hang.aspx"); }
private void LoadCustomer() { try { var list = _CustomerRepo.GetListByContainsAll(txtKeyword.Value); HttpContext.Current.Session["listCustomer"] = list; ASPxGridView1_Customer.DataSource = list; ASPxGridView1_Customer.DataBind(); } catch //(Exception) { //throw; } }
protected void Page_Load(object sender, EventArgs e) { bool isPermission = _UnitDataRepo.checkPermissionPage("danh-sach-khach-hang.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) { LoadCustomer(); } else { ASPxGridView1_Customer.DataSource = HttpContext.Current.Session["listCustomer"]; ASPxGridView1_Customer.DataBind(); } }