Exemple #1
0
 private void LoadInitRecords()
 {
     Cursor.Current = Cursors.WaitCursor;
     schoolNameBindingSource.DataSource = SchoolNameManagement.GetAll();
     degreeBindingSource.DataSource     = DegreesManagement.GetAll();
     Cursor.Current = Cursors.Default;
 }
Exemple #2
0
        private void LoadInitRecord()
        {
            Cursor.Current = Cursors.WaitCursor;
            schoolNameBindingSource.DataSource = SchoolNameManagement.GetAll();
            degreeBindingSource.DataSource     = DegreesManagement.GetAll();

            if (Education == null)
            {
                return;
            }
            educationBindingSource.DataSource = Education;
            Cursor.Current = Cursors.Default;
        }
Exemple #3
0
 private void degreeDataGridView_RowLeave(object sender, DataGridViewCellEventArgs e)
 {
     if (degreeBindingSource == null)
     {
         return;
     }
     if (degreeDataGridView.Rows.Count <= 1)
     {
         return;
     }
     if (!degreeDataGridView.IsCurrentRowDirty)
     {
         return;
     }
     Validate();
     degreeBindingSource.EndEdit();
     var iResult = DegreesManagement.Save((Degree)degreeBindingSource.Current);
 }
Exemple #4
0
 private void DeleteDegree()
 {
     if (degreeBindingSource != null)
     {
         var dResult = MessageBox.Show(@"Delete current record?", @"Delete", MessageBoxButtons.YesNo,
                                       MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
         if (dResult == DialogResult.Yes)
         {
             if (DegreesManagement.Delete(((Degree)degreeBindingSource.Current).DegreeNo))
             {
                 MessageBox.Show(@"Record was deleted successfully.", @"Delete", MessageBoxButtons.OK,
                                 MessageBoxIcon.Information);
                 degreeBindingSource.RemoveCurrent();
             }
             else
             {
                 MessageBox.Show(@"Error on delete operation.", @"Delete", MessageBoxButtons.OK,
                                 MessageBoxIcon.Error);
                 degreeDataGridView.Focus();
             }
         }
     }
 }