public ActionResult Create(FormCollection collection) { try { CatPlantillaTipoNotificacionModels PlantillaTipoNotificacion = new CatPlantillaTipoNotificacionModels(); _CatPlantillaTipoNotificacion_Datos PlantillaTipoNotificacionDatos = new _CatPlantillaTipoNotificacion_Datos(); PlantillaTipoNotificacion.conexion = Conexion; PlantillaTipoNotificacion.user = User.Identity.Name; PlantillaTipoNotificacion.opcion = 1; PlantillaTipoNotificacion.id_plantilla = ""; PlantillaTipoNotificacion.id_tipoNotificacion = Convert.ToInt32(collection["listaTipoNotificacion"]); PlantillaTipoNotificacion.titulo = collection["titulo"]; PlantillaTipoNotificacion.texto = collection["texto"]; PlantillaTipoNotificacion.resumen = ""; PlantillaTipoNotificacion = PlantillaTipoNotificacionDatos.AbcPlatillaTipoNotificacion(PlantillaTipoNotificacion); if (string.IsNullOrEmpty(PlantillaTipoNotificacion.id_plantilla)) { TempData["typemessage"] = "2"; TempData["message"] = "El usuario ingresado ya existe."; return(RedirectToAction("Create")); } else { TempData["typemessage"] = "1"; TempData["message"] = "Los datos se guardaron correctamente."; return(RedirectToAction("Index")); } } catch { TempData["typemessage"] = "2"; TempData["message"] = "Ocurrió un error el intentar guardar. Contacte a soporte técnico"; return(View()); } }
public ActionResult Create() { CatPlantillaTipoNotificacionModels PlantillaTipoNotificacion = new CatPlantillaTipoNotificacionModels(); _CatPlantillaTipoNotificacion_Datos PlantillaTipoNotificacionDatos = new _CatPlantillaTipoNotificacion_Datos(); PlantillaTipoNotificacion.conexion = Conexion; PlantillaTipoNotificacion.listaTipoNotificacion = PlantillaTipoNotificacionDatos.obtenerListaTipoNotificacion(PlantillaTipoNotificacion); var list = new SelectList(PlantillaTipoNotificacion.listaTipoNotificacion, "id_tipoNotificacion", "descripcion"); ViewData["cmbTipoNotificacion"] = list; PlantillaTipoNotificacion.listaVariableNotificacion = PlantillaTipoNotificacionDatos.ObtenerCatVariablesNotificacion(PlantillaTipoNotificacion); var lista = new SelectList(PlantillaTipoNotificacion.listaVariableNotificacion, "clave", "descripcion"); ViewData["tablaVariables"] = lista; return(View()); }
public ActionResult Index() { try { CatPlantillaTipoNotificacionModels PlantillaTipoNotificacion = new CatPlantillaTipoNotificacionModels(); _CatPlantillaTipoNotificacion_Datos PlantillaTipoNotificacionDatos = new _CatPlantillaTipoNotificacion_Datos(); PlantillaTipoNotificacion.conexion = Conexion; PlantillaTipoNotificacion = PlantillaTipoNotificacionDatos.obtenerCatPlantillaTipoNotificacion(PlantillaTipoNotificacion); return(View(PlantillaTipoNotificacion)); } catch (Exception) { CatCatedraticoModels Catedratico = new CatCatedraticoModels(); Catedratico.TablaDatos = new DataTable(); TempData["typemessage"] = "2"; TempData["message"] = "No se puede cargar la vista"; return(View(Catedratico)); } }
//[Authorize(Roles = "3")] public ActionResult TablaPalabras(int idtiponotificacion) { try { CatPlantillaTipoNotificacionModels PlantillaTipoNotificacion = new CatPlantillaTipoNotificacionModels(); _CatPlantillaTipoNotificacion_Datos PlantillaTipoNotificacionDatos = new _CatPlantillaTipoNotificacion_Datos(); List <CatVariablesNotificacionModels> listaVariablesNotificaciones = new List <CatVariablesNotificacionModels>(); PlantillaTipoNotificacion.conexion = Conexion; PlantillaTipoNotificacion.id_tipoNotificacion = idtiponotificacion; listaVariablesNotificaciones = PlantillaTipoNotificacionDatos.ObtenerCatVariablesNotificacion(PlantillaTipoNotificacion); return(Json(listaVariablesNotificaciones, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { ex.Message.ToString(); return(Json("", JsonRequestBehavior.AllowGet)); } }
public ActionResult Edit(string id, int id2) { try { CatPlantillaTipoNotificacionModels PlantillaTipoNotificacion = new CatPlantillaTipoNotificacionModels(); _CatPlantillaTipoNotificacion_Datos PlantillaTipoNotificacionDatos = new _CatPlantillaTipoNotificacion_Datos(); PlantillaTipoNotificacion.conexion = Conexion; PlantillaTipoNotificacion.listaTipoNotificacion = PlantillaTipoNotificacionDatos.obtenerListaTipoNotificacion(PlantillaTipoNotificacion); var list = new SelectList(PlantillaTipoNotificacion.listaTipoNotificacion, "id_tipoNotificacion", "descripcion"); ViewData["cmbTipoNotificacion"] = list; PlantillaTipoNotificacion.listaVariableNotificacion = PlantillaTipoNotificacionDatos.ObtenerCatVariablesNotificacion(PlantillaTipoNotificacion); var lista = new SelectList(PlantillaTipoNotificacion.listaVariableNotificacion, "clave", "descripcion"); ViewData["tablaVariables"] = lista; PlantillaTipoNotificacion.id_plantilla = id; PlantillaTipoNotificacion.id_tipoNotificacion = id2; PlantillaTipoNotificacion = PlantillaTipoNotificacionDatos.ObtenerDetallePlantillaNotificacion(PlantillaTipoNotificacion); return(View(PlantillaTipoNotificacion)); } catch (Exception ex) { throw ex; } }