// GET: ACTIONAUDITArea/ActionAudit
        public ActionResult Index()
        {
            AssignUserInfo();
            var ActionAuditBusiness         = Get <ActionAuditBusiness>();
            var DM_NGUOIDUNGBusiness        = Get <DM_NGUOIDUNGBusiness>();
            ActionAuditSearchVM searchModel = new ActionAuditSearchVM();
            ActionAuditLogVM    model       = new ActionAuditLogVM();

            model.ListResult = ActionAuditBusiness.GetLog();
            model.ListUser   = DM_NGUOIDUNGBusiness.repository.All().AsNoTracking().Select(x => new SelectListItem()
            {
                Value = x.TENDANGNHAP,
                Text  = x.TENDANGNHAP
            }).ToList();
            SessionManager.SetValue("searchModel", searchModel);
            return(View(model));
        }
        public PageListResultBO <ACTION_AUDIT> GetLog(ActionAuditSearchVM searchmodel = null, int pageSize = 20, int pageIndex = 1)
        {
            var query = from audit in this.context.ACTION_AUDIT
                        select audit;

            if (searchmodel != null)
            {
                if (!string.IsNullOrEmpty(searchmodel.TENDANGNHAP))
                {
                    query = query.Where(x => x.USER_NAME == searchmodel.TENDANGNHAP);
                }
            }
            query = query.OrderByDescending(x => x.ACTION_AUDIT_ID);
            var resultmodel  = new PageListResultBO <ACTION_AUDIT>();
            var dataPageList = query.ToPagedList(pageIndex, pageSize);

            resultmodel.Count     = dataPageList.TotalItemCount;
            resultmodel.TotalPage = dataPageList.PageCount;
            resultmodel.ListItem  = dataPageList.ToList();
            return(resultmodel);
        }
        public JsonResult getData(int indexPage, string sortQuery, int pageSize)
        {
            var ActionAuditBusiness = Get <ActionAuditBusiness>();
            var searchModel         = SessionManager.GetValue("searchModel") as ActionAuditSearchVM;

            if (!string.IsNullOrEmpty(sortQuery))
            {
                if (searchModel == null)
                {
                    searchModel = new ActionAuditSearchVM();
                }
                searchModel.sortQuery = sortQuery;
                if (pageSize > 0)
                {
                    searchModel.pageSize = pageSize;
                }
                SessionManager.SetValue("VanBanDiSearch", searchModel);
            }
            var data = ActionAuditBusiness.GetLog(searchModel, pageSize, indexPage);

            return(Json(data));
        }