Example #1
0
 private void LoadInitRecords()
 {
     Cursor.Current = Cursors.WaitCursor;
     schoolNameBindingSource.DataSource = SchoolNameManagement.GetAll();
     degreeBindingSource.DataSource     = DegreesManagement.GetAll();
     Cursor.Current = Cursors.Default;
 }
Example #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;
        }
Example #3
0
 private void schoolNameDataGridView_RowLeave(object sender, DataGridViewCellEventArgs e)
 {
     if (schoolNameBindingSource == null)
     {
         return;
     }
     if (schoolNameDataGridView.Rows.Count <= 1)
     {
         return;
     }
     if (!schoolNameDataGridView.IsCurrentRowDirty)
     {
         return;
     }
     Validate();
     schoolNameBindingSource.EndEdit();
     var iResult = SchoolNameManagement.Save((SchoolName)schoolNameBindingSource.Current);
     //toolStripStatusLabel1.Text = iResult > 0 ? @"Unit saved successfully." : @"Error occurred when saving Unit.";
 }
Example #4
0
 private void DeleteSchool()
 {
     if (schoolNameBindingSource != null)
     {
         var dResult = MessageBox.Show(@"Delete current record?", @"Delete", MessageBoxButtons.YesNo,
                                       MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
         if (dResult == DialogResult.Yes)
         {
             if (SchoolNameManagement.Delete(((SchoolName)schoolNameBindingSource.Current).SchoolNo))
             {
                 MessageBox.Show(@"Record was deleted successfully.", @"Delete", MessageBoxButtons.OK,
                                 MessageBoxIcon.Information);
                 schoolNameBindingSource.RemoveCurrent();
             }
             else
             {
                 MessageBox.Show(@"Error on delete operation.", @"Delete", MessageBoxButtons.OK,
                                 MessageBoxIcon.Error);
                 schoolNameDataGridView.Focus();
             }
         }
     }
 }