/// <summary>Maneja el evento Click del control de btnCancelar.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void btnCancelar_Click(object sender, EventArgs e) { Notificacion notificacion = new Notificacion(); this.Hide(); notificacion.Show(); }
/// <summary>Maneja el evento Click del control de btnCancelar.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void btnCancelar_Click(object sender, EventArgs e) { Notificacion frmNotificacion = new Notificacion(); this.Close(); frmNotificacion.Show(); }
/// <summary>Maneja el evento Click del control de BtnEnviar.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void BtnEnviar_Click(object sender, EventArgs e) { c.enviarCorreo(txtEmisor.Text, txtPassword.Text, rtbMensaje.Text, txtAsunto.Text, txtReceptor.Text, txtRutaArchivo.Text); Notificacion notificacion = new Notificacion(); this.Hide(); notificacion.Show(); }
/// <summary>Maneja el evento Click del control de btnRegistrar.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void btnRegistrar_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(conString); con.Open(); if (con.State == System.Data.ConnectionState.Open) { string q = "insert into tblUsuario(DNI,usrNombre,usrApPaterno,usrApMaterno,usrCorreo,usrUsername,usrPassword) values('" + txtDNI.Text.ToString() + "','" + txtNombre.Text.ToString() + "','" + txtApPaterno.Text.ToString() + "','" + txtApMaterno.Text.ToString() + "','" + txtCorreo.Text.ToString() + "','" + txtUsername.Text.ToString() + "','" + txtContra.Text.ToString() + "')"; SqlCommand cmd = new SqlCommand(q, con); cmd.ExecuteNonQuery(); MessageBox.Show("Usuario registrado"); } Notificacion notificacion = new Notificacion(); this.Hide(); notificacion.Show(); notificacion.textBox1.Text = txtUsername.Text; notificacion.txtCorreo.Text = txtCorreo.Text; //string consultar = bd.selectstring("select * from datos1 where id ='" + txtDNI.Text + "'"); //string agregar = "insert into datos1 values ('" + txtDNI.Text + "','" + txtNombre.Text + "','" // + txtApPaterno.Text + "','" + txtApMaterno.Text + "','" + txtCorreo.Text + "','" + txtUsername.Text + "')"; //if (string.IsNullOrWhiteSpace(txtDNI.Text)) //{ // MessageBox.Show("Error"); //} //else //{ // if (consultar == txtDNI.Text) // { // MessageBox.Show("Esta DNI ya existe"); // } // else // { // if (bd.executecommand(agregar)) // { // MessageBox.Show("Registro agregado correctamente"); // dataGridView1.DataSource = bd.SelectDataTable("select * from datos1"); // } // else // { // MessageBox.Show("Error al agregar"); // } // } //} }
private static void MostrarNotificacionPrivado(String titulo, String mensaje, Bitmap imagen, int SegundosAMostrar, Delegate delegadoMasInformacion, Delegate delegadoCerrar, Boolean cerrarDespuesDeMasInformacion, Boolean EjecutarDelegadoCerradoDespuesDeSegundosTranscurridos) { try { int alto = Principal.GetPantallaSistema().Bounds.Height; int ancho = Principal.GetPantallaSistema().Bounds.Width; int posicion = -1; for (int i = 0; i < activos.Length; i++) { if (!activos[i]) { posicion = i; break; } } if (posicion >= 0) { activos[posicion] = true; if (imagen == null) { imagen = new Bitmap(@"Imagenes\Iconos\Sistema\Dialogos\informacion.png"); } Notificacion n = new Notificacion(titulo, mensaje, imagen, SegundosAMostrar, posicion, delegadoMasInformacion, delegadoCerrar, cerrarDespuesDeMasInformacion, EjecutarDelegadoCerradoDespuesDeSegundosTranscurridos); notificaciones[posicion] = n; n.WindowStartupLocation = WindowStartupLocation.Manual; n.Top = alto - 50 - (Principal.GetPantallaSistema().Bounds.Y * -1) - 133 * (posicion + 1); n.Left = Principal.GetPantallaSistema().Bounds.X + ancho - 359; n.Topmost = true; n.Show(); n.seCerroNotificacion += n_seCerroNotificacion; } } catch (InvalidOperationException ioe) { Log.EscribirLog(ioe.Message + ": " + ioe.StackTrace); } }
/// <summary>Maneja el evento Click del control de btnGuardar.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void btnGuardar_Click(object sender, EventArgs e) { conexion.Open(); //falta validad el codigo(automatico) string idTrabajo = txtID.Text; string salario = numSalario.Value.ToString(); string region = txtRegion.Text; string ciudad = txtCiudad.Text; string oficio = txtOficio.Text; string descripcion = txtDescripción.Text; SqlCommand comando = new SqlCommand("modificarTrabajo", conexion);//+ codigo; comando.CommandType = CommandType.StoredProcedure; comando.Parameters.AddWithValue("@salario", salario); comando.Parameters.AddWithValue("@region", region); comando.Parameters.AddWithValue("@ciudad", ciudad); comando.Parameters.AddWithValue("@oficio", oficio); comando.Parameters.AddWithValue("@descripcion", descripcion); comando.Parameters.AddWithValue("@IDtrabajo", idTrabajo); comando.ExecuteNonQuery(); MessageBox.Show("Se modificaron los datos de la publicacion"); numSalario.Value = 0; txtRegion.Text = ""; txtCiudad.Text = ""; txtOficio.Text = ""; txtDescripción.Text = ""; txtID.Text = ""; conexion.Close(); Notificacion notificacion = new Notificacion(); this.Close(); notificacion.Show(); }
/// <summary>Maneja el evento Click del control de btnPubliTrabajo.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void btnPubliTrabajo_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(conString); con.Open(); if (con.State == System.Data.ConnectionState.Open) { string q = "insert into tblTrabajos(ID,Correo,Salario,Region,Ciudad,Oficio,Descripcion,Calificacion) values('" + txtID.Text.ToString() + "','" + txtCorreo.Text.ToString() + "'," + numSalario.Value + ",'" + txtRegion.Text.ToString() + "','" + txtCiudad.Text.ToString() + "','" + txtOficio.Text.ToString() + "','" + txtDescripcion.Text.ToString() + "','')"; SqlCommand cmd = new SqlCommand(q, con); cmd.ExecuteNonQuery(); MessageBox.Show("Trabajo publicado."); } Notificacion notificacion = new Notificacion(); this.Hide(); notificacion.Show(); con.Close(); }