Esempio n. 1
0
        public SecurityLogListingModel GetSecurityLog(SecurityLogFilterModel filter)
        {
            if (filter == null) filter = new SecurityLogFilterModel();

            var query = Mapper.Map<SecurityLogFilterModel, Data.Query.LoginQuery>(filter);
            var log = SecurityRepository.GetSecurityLog(query).OrderByDescending(o => o.LoginAttemptId).ToList();
            var security = Mapper.Map<IList<Data.Graph.LoginAttemptLog>, IList<SecurityLogModel>>(log);

            SecurityLogListingModel model = new SecurityLogListingModel();
            model.Filter = filter;
            model.SecurityLog = security.ToPagedList(filter.Page, filter.Size);

            return model;
        }
        public ActionResult SecurityLog(SecurityLogFilterModel filter)
        {
            var listing = SecurityServices.GetSecurityLog(filter);

            ViewBag.Locations = LocationServices.GetLocationLookup(true, filter.LocationId);
            ViewBag.Result = LookupServices.GetLoginResultOptions(filter.ResultFlag, true);
            ViewBag.Size = LookupServices.GetSizeOptions(filter.Size);

            if (listing.SecurityLog.Count == 0)
                return View("SecurityLogNoData", listing);
            else
                return View("SecurityLog", listing);
        }