예제 #1
0
        public ActionResult Search([Bind(Include = "staffNr,absenceTypeId,durStart,durEnd")] AbsenceRecrodSearchModel q)
        {
            SetDropDownList(null);

            int pageIndex = 0;

            int.TryParse(Request.QueryString.Get("page"), out pageIndex);
            pageIndex = PagingHelper.GetPageIndex(pageIndex);

            IAbsenceRecordService ss = new AbsenceRecordService(Settings.Default.db);

            IPagedList <AbsenceRecrod> models = ss.Search(q).ToPagedList(pageIndex, Settings.Default.pageSize);

            ViewBag.Query = q;

            return(View("Index", models));
        }
예제 #2
0
        public ActionResult Index(int?page)
        {
            SetDropDownList(null);

            int pageIndex = PagingHelper.GetPageIndex(page);

            AbsenceRecrodSearchModel q = new AbsenceRecrodSearchModel();

            IAbsenceRecordService ss = new AbsenceRecordService(Settings.Default.db);

            IPagedList <AbsenceRecrod> models = ss.Search(q).ToPagedList(pageIndex, Settings.Default.pageSize);

            ViewBag.Query = q;

            AbsenceRecrodInfoModel info = ss.GetAbsenceRecrodInfo(q);

            ViewBag.Info = info;

            return(View(models));
        }