public ActionResult Edit(int id, FormCollection collection) { try { Ytbl_CorreoNotificacionesModels UpdateNotificacion = new Ytbl_CorreoNotificacionesModels(); UpdateNotificacion.Id = id; UpdateNotificacion.Name = collection[2].ToString(); UpdateNotificacion.Correo = collection[3].ToString(); UpdateNotificacion.IsValid = collection[4].ToString(); if (UpdateNotificacion.UpdateCorreo(UpdateNotificacion)) { TempData["AlertMessage"] = "CORREO EDITADO CON EXITO"; return(RedirectToAction("Index")); } else { TempData["AlertMessage"] = "Error al editar el correo"; return(View("Error")); } } catch { return(View("Error")); } }
public ActionResult Create(FormCollection collection) { try { Ytbl_CorreoNotificacionesModels saveDestinatario = new Ytbl_CorreoNotificacionesModels(); saveDestinatario.Name = collection[1].ToString(); saveDestinatario.Correo = collection[2].ToString(); saveDestinatario.IsValid = collection[3].ToString(); saveDestinatario.System = "GestCor"; saveDestinatario.Fecha = DateTime.Now; if (saveDestinatario.SaveYtbl_CorreoNotificaciones(saveDestinatario)) { TempData["AlertMessage"] = "CORREO CREADO CON EXITO"; return(RedirectToAction("Index")); } else { TempData["AlertMessage"] = "Error al crear el correo"; return(View("Error")); } } catch { return(View("Error")); } }
public ActionResult Edit(int id) { Ytbl_CorreoNotificacionesModels correoNotificacion = new Ytbl_CorreoNotificacionesModels(); correoNotificacion = correoNotificacion.SelectCorreosById(id); return(View(correoNotificacion)); }
public ActionResult Index() { Ytbl_CorreoNotificacionesModels SelectCorreos = new Ytbl_CorreoNotificacionesModels(); return(View(SelectCorreos.SelectCorreos())); }