示例#1
0
        private object getViewModelFromOrder(List <Order> menuDetails)
        {
            OrderViewIndexViewModel vm = new OrderViewIndexViewModel();

            vm.order_details = new List <OrderDetailModel>();
            foreach (var order in menuDetails)
            {
                var orderDetail = _mapper.Map <OrderDetailModel>(order);
                vm.order_details.Add(orderDetail);
            }

            return(vm);
        }
示例#2
0
        private OrderViewIndexViewModel setReportViewModel(OrderViewIndexViewModel vm)
        {
            var startDate = vm.start_date.Date;
            var endDate   = vm.end_date.Date;
            var details   = _orderRepository.getQueryable().Where(a => a.order_date.Date >= startDate && a.order_date.Date <= endDate).ToList();

            if (!string.IsNullOrWhiteSpace(vm.title))
            {
                details = _orderRepository.getQueryable().Where(a => a.order_date.Date >= startDate && a.order_date.Date <= endDate && vm.title == a.customer_name).ToList();
            }
            var list = getViewModelFromOrder(details);

            return((OrderViewIndexViewModel)list);
        }
示例#3
0
        private OrderViewIndexViewModel getViewPrintFromMenu(OrderViewIndexViewModel vm1)
        {
            var startDate = vm1.start_date.Date;
            var endDate   = vm1.end_date.Date;
            var details   = _orderRepository.getQueryable().Where(a => a.order_date.Date >= startDate && a.order_date.Date <= endDate).ToList();

            if (!string.IsNullOrWhiteSpace(vm1.title))
            {
                details = _orderRepository.getQueryable().Where(a => a.order_date.Date >= startDate && a.order_date.Date <= endDate && vm1.title == a.customer_name).ToList();
            }
            details = _orderRepository.getQueryable().ToList();
            var setupValues = _setupRepo.getQueryable().ToList();

            ViewBag.setup = setupValues;
            var list = getViewModelFromOrder(details);

            return((OrderViewIndexViewModel)list);
        }
示例#4
0
 public IActionResult print(OrderViewIndexViewModel vm1)
 {
     vm1 = getViewPrintFromMenu(vm1);
     return(View(vm1));
 }
示例#5
0
 public IActionResult report(OrderViewIndexViewModel vm)
 {
     vm = setReportViewModel(vm);
     return(View(vm));
 }