Exemplo n.º 1
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if ((txtNumero.Text != null) && (numerico(txtNumero.Text)))
     {
         if (controladorMaterias.agregarMateria(txtNumero.Text, txtNombre.Text))
         {
             MessageBox.Show("Materia Agregada Con Exito", "Materia Agregada", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.Close();
         }
         else
         {
             MessageBox.Show("Error al agregar materia", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     if ((txtNumero.Text != null) && (Formato.isNombreMateria(txtNombre.Text)))
     {
         if (controladorMaterias.agregarMateria(txtNumero.Text, txtNombre.Text))
         {
             lblMensaje.Text = "Materia Agregada Con Exito";
             Response.Redirect("~/frmMaterias.aspx");
         }
         else
         {
             lblMensaje.Text = "Error al agregar materia";
         }
     }
     else
     {
         lblMensaje.Text = "Complete los campos correctamente";
     }
 }