public ActionResult PaymentFailure(string orderID) { var pedidoController = new PedidoController(); var order = pedidoController.GetOrder(orderID); order.orderState = "Cancelado"; pedidoController.UpdateOrder(order); return(View()); }
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() })); }
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); }