// GET: Orders/Details/5 public ActionResult Details(int id) { Order order = orderRepo.Get(id); if (order == null) { return(HttpNotFound()); } return(View(order)); }
public IActionResult Index() { _logger.LogInfo($"Zapytanie do metody Index()"); DisplayErrorFromRedirectIfNecessary(); var result = _orderRepo.Get(); if (result.IsSuccess) { var model = Map <IEnumerable <OrderViewModel> >(result.Value); return(View(model)); } else { AddLocalError(result.FailureMessage); return(View(Enumerable.Empty <OrderViewModel>())); } }
public IActionResult Ship(int id) { var order = orderRepository.Get(id); if (order == null) { return(NotFound()); } orderRepository.Ship(id); return(RedirectToAction(nameof(ViewAllOrder))); }
public OrderEditViewModel GetDetail(string id) { try { var order = orderRepo.Get(id); var ordertail = orderDetailRepo.GetListByOrderId(id).ToList(); var store = storeRepo.GetAll().FirstOrDefault(c => c.Id == order.StoreId); var listuser = userRepo.GetAll().ToList(); var result = new OrderEditViewModel(); result.orderTbl = order; result.store = store; result.listDetailTbl = ordertail; result.Sender = listuser.FirstOrDefault(c => c.Id == order.SenderId); result.Recipient = listuser.FirstOrDefault(c => c.Id == order.RecipientId); return(result); } catch (Exception e) { return(null); } }
public IEnumerable <Order> GetOrders(int?id) { return(orderRepo.Get(id)); }