예제 #1
0
        public ActionResult PaymentFailure(string orderID)
        {
            var pedidoController = new PedidoController();
            var order            = pedidoController.GetOrder(orderID);

            order.orderState = "Cancelado";
            pedidoController.UpdateOrder(order);
            return(View());
        }
예제 #2
0
        public ActionResult PaymentSucess(string orderID)
        {
            var pedidoController = new PedidoController();
            var order            = pedidoController.GetOrder(orderID);

            order.orderState = "Pago";
            pedidoController.UpdateOrder(order);
            return(RedirectToAction("VerPedido", "Pedido", new { area = "Pedido", id = order.OrderId.ToString() }));
        }
예제 #3
0
        public FileContentResult GetImage(string orderId, string pictureId)
        {
            PedidoController a  = new PedidoController();
            var order           = a.GetOrder(orderId);
            var pictureObjectId = ObjectId.Parse(pictureId);

            var returned = order.produtosRequisitados.Find(x => x.userImage.id == pictureObjectId);

            //transform the picture's data from string to an array of bytes
            var thePictureDataAsBytes = Convert.FromBase64String(returned.userImage.PictureDataAsString);

            var fileResult = new FileContentResult(thePictureDataAsBytes, "image/jpeg");

            //return array of bytes as the image's data to action's response.
            //We set the image's content mime type to image/jpeg
            return(fileResult);
        }