public async Task <ActionResult> GetOrder(int id) { ApplicationUser user = await userManager.FindByIdAsync(HttpContext.User.Identity.GetUserId()); OrderForModel model = new OrderForModel(); var tempOrder = user.Orders.FirstOrDefault(o => o.Id == id); model.Number = tempOrder.Id; model.Cost = tempOrder.TotalCost; model.Description = InformationConverter.StringToDescription(tempOrder.Description); return(View(model)); }
public ActionResult GetOrder(int id) { Order order = repository.Orders.FirstOrDefault(o => o.Id == id); AdminOrder model = new AdminOrder(); if (order != null) { model.Number = order.Id; model.Cost = order.TotalCost; model.CustomerInformation = InformationConverter.StringToUserProfile(order.CustomerInfrom); model.Description = InformationConverter.StringToDescription(order.Description); } return(View(model)); }