예제 #1
0
        public ActionResult Index()
        {
            try
            {
                string searchBy     = "";
                string keyword      = "";
                var    orderBy      = Common.defaultOrderBy;
                var    order        = Common.defaultListOrder;
                var    _pageNo      = 1;
                var    _pageSize    = 10;
                var    _pageStatus  = 1;
                var    totalRecords = 0;
                var    diseases     = diseaseRepository.Search(searchBy, keyword, orderBy, order, _pageNo, _pageSize, out totalRecords);
                var    listResult   = Paging.GetResultInfo(totalRecords, _pageNo, _pageSize);
                var    paging       = Paging.GetPaging(totalRecords, _pageNo, _pageSize, _pageStatus, Common.defaultNoOfPageLinkList, "$common.pagingClick", orderBy, order);
                var    itemPerPage  = Paging.getItemPerPage(totalRecords, _pageSize, orderBy, order);

                PageUtilities pageUtilities = new PageUtilities()
                {
                    listHeader = listResult,
                    listFooter = paging + itemPerPage,
                    order      = order,
                    orderBy    = orderBy
                };

                diseaseModel = new DiseaseModels
                {
                    diseases      = diseases,
                    pageUtilities = pageUtilities,
                };
            }
            catch (Exception ex)
            {
                log.Error(ex);
                ModelState.AddModelError("error", Translator.UnexpectedError);
            }
            return(View(diseaseModel));
        }