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); }
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); }
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); }
public IActionResult print(OrderViewIndexViewModel vm1) { vm1 = getViewPrintFromMenu(vm1); return(View(vm1)); }
public IActionResult report(OrderViewIndexViewModel vm) { vm = setReportViewModel(vm); return(View(vm)); }