Exemplo n.º 1
0
        public ActionResult LoginGrid(GridParams gridParams)
        {
            var audit = _auditService.GetUserLogins(new GetAuditUserLoginsRequest
            {
                Skip              = gridParams.DisplayStart,
                Take              = gridParams.DisplayLength,
                Search            = gridParams.Search,
                SortingDictionary = gridParams.SortingDictionary,
                StartDate         = string.IsNullOrEmpty(Request["StartDate"]) ? new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0) : DateTime.ParseExact(Request["StartDate"], "MM/dd/yyyy", CultureInfo.InvariantCulture),
                EndDate           = string.IsNullOrEmpty(Request["EndDate"]) ? new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59) : DateTime.ParseExact(Request["EndDate"], "MM/dd/yyyy", CultureInfo.InvariantCulture)
            });
            IList <AuditUserLoginsResponse.UserLogin> datas = audit.UserLogins.ToList();
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = audit.TotalRecords,
                iTotalRecords        = audit.UserLogins.Count,
                aaData = datas
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }