Exemplo n.º 1
0
        public async Task <IActionResult> CheckOrder(CheckOrderViewModel viewModel)
        {
            var order = this.mapper.Map <DataOrderViewModel>(await this.orderService
                                                             .GetOrderAsync(viewModel.OrderNumber, viewModel.OrderPassword));

            if (order == null)
            {
                this.ViewBag.ErrorMessage = "Invalid order number or password";
                return(View(viewModel));
            }

            return(View(nameof(OrderData), order));
        }
Exemplo n.º 2
0
        public ActionResult Check_Order(CheckOrderViewModel model)
        {
            if (ModelState.IsValid)
            {
                IMapper map     = MappingConfig.MapperConfigOrder.CreateMapper();
                Orders  context = map.Map <Orders>(model);

                var result = _repository.CheckOrderAsync(context);

                if (result != null)
                {
                    return(PartialView(result));
                }
            }
            return(PartialView());
        }