public ActionResult CrearTipoFlores(TIPOS_FLORES obj) { try { bool respuesta; string mensaje = "Tipo de flor creado correctamente"; if (obj.TPFCODIGOI == 0) { respuesta = objDAL.Crear_Tipos_flores(obj, true); } else { respuesta = objDAL.Crear_Tipos_flores(obj, false); mensaje = "Tipo de flor editada correctamente"; } if (respuesta) { Request.Flash("success", mensaje); } } catch (Exception exc) { Request.Flash("danger", "Ha ocurrido un error: " + exc.Message); } return(RedirectToAction("Index", "TipoFlores")); }
public ActionResult CrearTipoFlores(int id = 0) { TIPOS_FLORES obj = new TIPOS_FLORES(); if (id != 0) { obj = objDAL.Buscar_Tipo_flores(id); } return(View(obj)); }