Exemplo n.º 1
0
        private void cmbMaestro_SelectedIndexChanged(object sender, EventArgs e)
        {
            int     llave = Convert.ToInt32(cmbMaestro.SelectedItem.ToString());
            Maestro usaM  = maes.dicMaestro[llave];

            lblNombreMaestro.Text = usaM.pNombre;
        }
Exemplo n.º 2
0
 public void AgregaMaestro(string nom, string apePat, string apeMat, string carrera, string domicilio)
 {
     //Validar que el nombre no exita
     if (BuscaNombre(nom) == false)
     {
         //Crear el objeto y agregarlo a la coleccion
         Maestro m = new Maestro(nom, apePat, apeMat, carrera, domicilio);
         dicMaestro.Add(ClaveMaestro, m);
         ClaveMaestro += 10;
         MessageBox.Show("Maestro(A) agregado exitosamente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         MessageBox.Show("Nombre ya existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }