public PartialViewResult Filters(AdminFilterModel model) { List<AdminLogModel> logList = new List<AdminLogModel>(); foreach (Log l in new WCFFaultClient().GetLog()) { AdminLogModel logM = new AdminLogModel(); logM.FaultID = l.FaultID; logM.Date = l.Date; logM.FaultDetails = l.Details; logM.Status = new WCFFaultClient().GetStatusByID(l.Status).Status1; Fault f = new WCFFaultClient().GetFault(l.FaultID); if (model.Username!= null) { if (f.Username == model.Username) { logList.Add(logM); } } else if (model.FaultID != null) { if (logM.FaultID==model.FaultID) { logList.Add(logM); } } else if (model.DateFrom != null && model.DateTo != null) { if (logM.Date >= model.DateFrom && logM.Date <= model.DateTo) { logList.Add(logM); } } else { logList.Add(logM); } } return PartialView("_LogManagementFiltered", logList); }
public ActionResult LogManagement() { List<AdminLogModel> logList = new List<AdminLogModel>(); foreach (Log l in new WCFFaultClient().GetLog()) { AdminLogModel logM = new AdminLogModel(); logM.FaultID = l.FaultID; logM.Date = l.Date; logM.FaultDetails = l.Details; logM.Status = new WCFFaultClient().GetStatusByID(l.Status).Status1; logList.Add(logM); } return View("_LogManagement", logList); }