protected void btnIngresarCorreo_Click(object sender, EventArgs e) { iftMonitoreoRequerimientoNotificacion objMonitoreoRequerimientoNotificacion = new iftMonitoreoRequerimientoNotificacion(); cMonitoreoAplicativo objCMonitoreoAplicativo = new cMonitoreoAplicativo(); objMonitoreoRequerimientoNotificacion.intIdCodAppR = int.Parse(Session["intIdCodAppR"].ToString()); objMonitoreoRequerimientoNotificacion.strNombreNotificacion = txtNombrePersonaNotificar.Text; objMonitoreoRequerimientoNotificacion.strCorreoNotificacion = txtCorreoNotificar.Text; objCMonitoreoAplicativo.insertarRequerimientoCorreoNotificar(objMonitoreoRequerimientoNotificacion); gvNotificaciones.DataBind(); txtNombrePersonaNotificar.Text = ""; txtCorreoNotificar.Text = ""; lblMensaje.Text = "Se registro Correo a Notificar"; }
public void insertarRequerimientoCorreoNotificar(iftMonitoreoRequerimientoNotificacion objMonitoreoRequerimientoNotificacion) { using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["dbHomologacionEntities2"].ConnectionString)) { #region using (SqlCommand command = new SqlCommand("spInsertarRequerimientoMonitoreoNotificacion", connection)) { command.CommandType = CommandType.StoredProcedure; if ((objMonitoreoRequerimientoNotificacion.intIdCodAppR < 0 || objMonitoreoRequerimientoNotificacion.intIdCodAppR == null)) { command.Parameters.Add(new SqlParameter("@intIdCodAppR", " ")); } else { command.Parameters.Add(new SqlParameter("@intIdCodAppR", objMonitoreoRequerimientoNotificacion.intIdCodAppR)); } if ((objMonitoreoRequerimientoNotificacion.strNombreNotificacion.Length == 0 || objMonitoreoRequerimientoNotificacion.strNombreNotificacion == null)) { command.Parameters.Add(new SqlParameter("@strNombreNotificacion", " ")); } else { command.Parameters.Add(new SqlParameter("@strNombreNotificacion", objMonitoreoRequerimientoNotificacion.strNombreNotificacion)); } if ((objMonitoreoRequerimientoNotificacion.strCorreoNotificacion.Length == 0 || objMonitoreoRequerimientoNotificacion.strCorreoNotificacion == null)) { command.Parameters.Add(new SqlParameter("@strCorreoNotificacion", " ")); } else { command.Parameters.Add(new SqlParameter("@strCorreoNotificacion", objMonitoreoRequerimientoNotificacion.strCorreoNotificacion)); } connection.Open(); command.ExecuteNonQuery(); } #endregion } }