コード例 #1
0
        private void backButton_Click(object sender, EventArgs e)
        {
            mainPanel.Controls.Clear();
            StudentMenu backStudentMenu = new StudentMenu(mainPanel);

            mainPanel.Controls.Add(backStudentMenu);
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            mainPanel.Controls.Clear();
            StudentMenu theStudentMenu = new StudentMenu(mainPanel);

            mainPanel.Controls.Add(theStudentMenu);
        }
コード例 #3
0
 public ConsultStudents(Panel mainPanel)
 {
     InitializeComponent();
     try
     {
         LoadStudents();
         this.mainPanel = mainPanel;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         UserControl backMenu = new StudentMenu(mainPanel);
         mainPanel.Controls.Add(backMenu);
     }
 }
コード例 #4
0
 public ModifyStudentSelectList(Panel mainPanel)
 {
     InitializeComponent();
     try
     {
         LoadStudents();
         this.mainPanel = mainPanel;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         UserControl theStudentMenu = new StudentMenu(mainPanel);
         mainPanel.Controls.Add(theStudentMenu);
     }
 }
コード例 #5
0
 private void confirmRemoveButton_Click(object sender, EventArgs e)
 {
     if (listStudentsSelected.Items.Count != 0)
     {
         foreach (Object item in listStudentsSelected.Items)
         {
             StudentModule module = new StudentModule();
             module.RemoveStudent(item);
         }
         MessageBox.Show("Alumno(s) Eliminado(s) con Exito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
         mainPanel.Controls.Clear();
         StudentMenu backMenu = new StudentMenu(mainPanel);
         mainPanel.Controls.Add(backMenu);
     }
     else
     {
         MessageBox.Show("No se han seleccionado Alumnos para borrar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #6
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            StudentModule module   = new StudentModule();
            List <Object> subjects = new List <Object>();

            foreach (Object item in listSubjectsSelected.Items)
            {
                subjects.Add(item);
            }
            try
            {
                module.ModifyStudent(selectedObject, textNameStudent.Text, textLastNameStudent.Text, (int)numericCi.Value, (int)numericX.Value, (int)numericY.Value, subjects);
                MessageBox.Show("Alumno modificado con exito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                mainPanel.Controls.Clear();
                StudentMenu backStudentMenu = new StudentMenu(mainPanel);
                mainPanel.Controls.Add(backStudentMenu);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }