Exemple #1
0
 public static DialogResult AddNewStudent()
 {
     using (var frm = new FormStudent())
     {
         return(frm.ShowDialog());
     }
 }
Exemple #2
0
 public static DialogResult UpdateStudent(long studentId)
 {
     using (var frm = new FormStudent())
     {
         frm.SelectedStudent = Common.GetStudent(studentId);
         return(frm.ShowDialog());
     }
 }
Exemple #3
0
        private void btnDodajStudenta_Click(object sender, EventArgs e)
        {
            DialogResult dlg = FormStudent.AddNewStudent();

            if (dlg == DialogResult.Yes)
            {
                LoadStudenti();
                MessageBox.Show("Student je uspesno dodat.", "Obavestenje",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #4
0
        private void btnIzmeniStudenta_Click(object sender, EventArgs e)
        {
            if (cmbStudenti.SelectedValue == null)
            {
                return;
            }

            long studentId = (long)cmbStudenti.SelectedValue;

            DialogResult dlg = FormStudent.UpdateStudent(studentId);

            if (dlg == DialogResult.Yes)
            {
                LoadStudenti();
                MessageBox.Show("Student je uspesno azuriran.", "Obavestenje",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                cmbStudenti.SelectedValue = studentId;
            }
        }