Esempio n. 1
0
        public ActionResult Create(Precio especie)
        {
            try
            {
                // TODO: Add insert logic here
                var result = process.Agregar(especie);
                TempData["MessageViewBagName"] = new GenericMessageViewModel
                {
                    Message     = "Registro agregado a la base de datos.", // orivle
                    MessageType = GenericMessages.success
                };

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                TempData["MessageViewBagName"] = new GenericMessageViewModel
                {
                    Message         = ex.Message,
                    MessageType     = GenericMessages.danger,
                    ConstantMessage = true
                };

                return(View(especie));
            }
        }
Esempio n. 2
0
 public ActionResult NuevoPrecio(Precio precio)
 {
     try
     {
         _precioService.Agregar(precio);
         return(RedirectToAction("ListaPrecios", new { id = precio.TipoServicioId }));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 3
0
        public Precio Agregar(Precio precio)
        {
            Precio         result = default(Precio);
            IPrecioService proxy  = _precioService;

            try
            {
                result = proxy.Agregar(precio);
            }
            catch (FaultException fex)
            {
                throw new ApplicationException(fex.Message);
            }

            return(result);
        }