Esempio n. 1
0
        public ActionResult AjaxConsultarASMXBCCR(ViewModelParametro parametro)
        {
            ServiceBCCR oServiceBCCR = new ServiceBCCR();

            var lista = oServiceBCCR.GetDolar(parametro.FechaInicial,
                                              parametro.FechaFinal,
                                              parametro.CompraoVenta);

            return(PartialView("_DetalleDolar", lista));
        }
Esempio n. 2
0
        public ActionResult Create()
        {
            IServiceMarca      _ServiceMarca      = new ServiceMarca();
            IServiceTipoActivo _ServiceTipoActivo = new ServiceTipoActivo();

            ViewBag.ListaMarca      = _ServiceMarca.GetMarca();
            ViewBag.ListaTipoActivo = _ServiceTipoActivo.GetTipoActivo();

            ServiceBCCR oServiceBCCR = new ServiceBCCR();

            ViewBag.ListaPrecioDolar = oServiceBCCR.GetDolar("c");

            return(View());
        }
Esempio n. 3
0
        public ActionResult Dolar(DateTime?fechaDeCompra, decimal?costoColones)
        {
            //Of course you want to authorize the call
            ServiceBCCR oServiceBCCR = new ServiceBCCR();
            decimal     dolar        = Convert.ToDecimal(costoColones / oServiceBCCR.GetDolar(Convert.ToDateTime(fechaDeCompra)));

            if (fechaDeCompra != null)
            {
                return(Json(new { Status = "success", Dolar = Math.Round(dolar, 2) }));
            }
            else
            {
                return(Json(new { Status = "error Debe ingresar la fecha de compra" }));
            }
        }
 public IHttpActionResult GetVenta()
 {
     try
     {
         ServiceBCCR oServiceBCCR = new ServiceBCCR();
         // Debe validar que las fechas sean validas DAteTime.TryParse
         // Debe validar que compraoVenta sea c o v
         var lista = oServiceBCCR.GetDolar(DateTime.Now, DateTime.Now, "v");
         return(Ok(lista));
     }
     catch (Exception ex)
     {
         Exception exception = ex;
         // Redireccion a la captura del Error
         return(Ok("Error"));
     }
 }
        public IHttpActionResult GetDolarLongWay(string fechaInicial,
                                                 string fechaFinal,
                                                 string compraOVenta)
        {
            try
            {
                ServiceBCCR oServiceBCCR = new ServiceBCCR();

                // Debe validar que las fechas sean validas DAteTime.TryParse
                // Debe validar que compraoVenta sea “c” o “v” (compra o venta)

                var lista = oServiceBCCR.GetDolar(DateTime.Parse(fechaInicial),
                                                  DateTime.Parse(fechaFinal), compraOVenta);
                return(Ok(lista));
            }
            catch (Exception ex)
            {
                Exception exception = ex;
                // Redireccion a la captura del Error
                return(Ok("Error"));
            }
        }