Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Loadgroup();
     }
     else
     {
         if (HttpContext.Current.Session["ktoan.listgroup"] != null)
         {
             ASPxGridView1_group.DataSource = HttpContext.Current.Session["ktoan.listgroup"];
             ASPxGridView1_group.DataBind();
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            bool isPermission = _UnitDataRepo.checkPermissionPage("danh-sach-nhom-quan-tri.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)
            {
                Loadgroup();
            }
            else
            {
                if (HttpContext.Current.Session["ktoan.listgroup"] != null)
                {
                    ASPxGridView1_group.DataSource = HttpContext.Current.Session["ktoan.listgroup"];
                    ASPxGridView1_group.DataBind();
                }
            }
        }
 public void Loadgroup()
 {
     try
     {
         var list = db.GROUPs.Where(n => (n.GROUP_NAME.Contains(txtKeyword.Value) || txtKeyword.Value == "")).ToList();
         if (list.Count > 0)
         {
             HttpContext.Current.Session["ktoan.listgroup"] = list;
             ASPxGridView1_group.DataSource = list;
             ASPxGridView1_group.DataBind();
         }
         else
         {
             HttpContext.Current.Session["ktoan.listgroup"] = null;
             ASPxGridView1_group.DataSource = list;
             ASPxGridView1_group.DataBind();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }