コード例 #1
0
 public void testClearButton()
 {
     LogFilterModel lfm = new LogFilterModel();
     lfm.RequestID = 1;
     ViewResult result = (ViewResult)logsAdminController.Index("Clear", lfm);
     LogFilterModel resultModel = (LogFilterModel)result.Model;
     Assert.AreNotEqual(resultModel, lfm);
 }
コード例 #2
0
ファイル: LogsAdminController.cs プロジェクト: jneufeld/cs319
 public ActionResult Index(int? request = null, String act = null, String user = null, DateTime? before = null, DateTime? after = null, int page = 1)
 {
     LogFilterModel lfm = new LogFilterModel(request, user, act, before, after, page);
     ViewBag.ActionList = BuildActionDropdownList();
     ViewBag.UsersList = BuildUserDropdownList();
     lfm.filter();
     ViewBag.LogAdminActive = true;
     return View(lfm);
 }
コード例 #3
0
 public void testFilterButton()
 {
     LogFilterModel lfm = new LogFilterModel();
     lfm.RequestID = 1;
     ViewResult result = (ViewResult)logsAdminController.Index("Filter", lfm);
     LogFilterModel resultModel = (LogFilterModel)result.Model;
     resultModel.PagedLogs = lfm.PagedLogs;
     Assert.AreEqual(resultModel, lfm);
 }
コード例 #4
0
ファイル: LogsAdminController.cs プロジェクト: jneufeld/cs319
        public ActionResult Index(String button, LogFilterModel lfm)
        {
            ViewBag.ActionList = BuildActionDropdownList();
            ViewBag.UsersList = BuildUserDropdownList();
            ViewBag.LogAdminActive = true;

            if (button.Equals("Filter"))
            {
                LogFilterModel filter = lfm;
                filter.page = 1;
                filter.filter();
                return View(filter);
            }

            else if (button.Equals("Clear"))
            {
                ModelState.Clear();
                LogFilterModel filter = new LogFilterModel();
                filter.PagedLogs = filter.Logs.OrderByDescending(m => m.ID).ToPagedList(1, 10);
                return View(filter);
            }
            else
                return View(lfm);
        }