Example #1
0
 private void bt8_Click(object sender, EventArgs e)
 {
     if (listAnulo.Count() > 0)
     {
         if (txt2.Text != "")
         {
             for (int i = 0; i < listAnulo.Count(); i++)
             {
                 anuloRes = listAnulo.Find(anulo => anulo.ra.ToString() == txt2.Text);
                 if (anuloRes.ra.ToString() != "")
                 {
                     labelAltera.Text = listAnulo.FindIndex(alunos => alunos.ra == long.Parse(txt2.Text)).ToString();
                     txt6.Enabled     = true;
                     txt5.Enabled     = true;
                     txt6.Text        = anuloRes.ra.ToString();
                     txt5.Text        = anuloRes.nome;
                     break;
                 }
             }
         }
         else
         {
             MessageBox.Show("Campo de RA vazio", "Ops", 0);
         }
     }
     else
     {
         MessageBox.Show("Lista vazia", "Ops", 0);
     }
 }
Example #2
0
        Alunoo altera()
        {
            Alunoo AlteraAluno = new Alunoo();

            AlteraAluno.nome = txt5.Text;
            AlteraAluno.ra   = long.Parse(txt6.Text);
            return(AlteraAluno);
        }
Example #3
0
        private void add_Click(object sender, EventArgs e)
        {
            Alunoo oo = new Alunoo();

            oo.nome = txt1.Text;
            oo.ra   = long.Parse(txt2.Text);
            listAluno.Add(oo);
            Zerar();
        }
Example #4
0
 private void bt9_Click(object sender, EventArgs e)
 {
     if (labelAltera.Text == "")
     {
         MessageBox.Show("Nenhuma Busca Realizada", "Ops", 0);
     }
     else
     {
         if (txt5.Text != "" && txt6.Text != "")
         {
             Alunoo AlteraAluno = altera();
             listAnulo[int.Parse(labelAltera.Text)] = AlteraAluno;
             atualiza();
             txt5.Text = "";
             txt6.Text = "";
         }
         else
         {
             MessageBox.Show("Campo de nome e/ou ra vazio", "Ops", 0);
         }
     }
 }