Exemplo n.º 1
0
        public override ActionResult Index(RenderModel model)
        {
            int orderIndex = 1;
            if (CurrentPage.GetProperty("orderIndex") != null)
                Int32.TryParse(CurrentPage.GetProperty("orderIndex").Value.ToString(), out orderIndex);

            OrderOperationStatus operationStatus = _ecommerceService.GetOrder(orderIndex);
            if (operationStatus.Status)
            {
                var viewOrder = new OrderViewModel(model);
                viewOrder.InjectFrom(operationStatus.Order);
                viewOrder.Status = operationStatus.Status;
                viewOrder.Message = operationStatus.Message;
                return CurrentTemplate(viewOrder);
            }
            return ReturnErrorView(operationStatus, model);
        }