コード例 #1
0
ファイル: ReportsController.cs プロジェクト: sahvishal/matrix
        public ActionResult NoShowCustomer(NoShowCustomerModelFilter filter = null, int pageNumber = 1)
        {
            int totalRecords;
            var model = _eventCustomerReportingService.GetNoShowCustomers(pageNumber, _pageSize, filter, out totalRecords);

            if (model == null)
            {
                model = new NoShowCustomerListModel();
            }
            model.Filter = filter;

            var currentAction          = ControllerContext.RouteData.Values["action"].ToString();
            Func <int, string> urlFunc =
                pn => Url.Action(currentAction, new
            {
                pageNumber = pn,
                filter.FromDate,
                filter.ToDate,
                filter.IsRetailEvent,
                filter.IsCorporateEvent,
                filter.IsPublicEvent,
                filter.IsPrivateEvent
            });

            model.PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc);

            return(View(model));
        }
コード例 #2
0
        public void GetNoshowEventCustomerswithFilterTest()
        {
            int totalRecords = 0;
            var filter       = new NoShowCustomerModelFilter()
            {
                FromDate = DateTime.Now.AddDays(-30),
                ToDate   = DateTime.Now.AddDays(30)
            };
            var eventCustomers = _eventCustomerRepository.GetNoShowEventCustomers(1, 20, filter, out totalRecords);

            Assert.IsNotNull(eventCustomers);
            Assert.IsNotEmpty(eventCustomers.ToList());
        }