Beispiel #1
0
        private void ApplicantListForm_Load(object sender, EventArgs e)
        {
            // ParentFrom is a MdiParent of the ApplicantListForm
            MdiParent = MyForms.GetForm<ParentForm>();

            LoadData();
        }
 public void CreateNewCourse()
 {
     Mode   = FormMode.CreateNew;
     Course = new Course();
     InitializeControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
        private void CourseListForm_Load(object sender, EventArgs e)
        {
            // ParentFrom is a MdiParent of the CourseListForm
            // to make sure our CourseListForm always stays inside the ParentForm
            MdiParent = MyForms.GetForm <ParentForm>();

            LoadData();
        }
Beispiel #4
0
 public void CreateNewApplicant()
 {
     Mode      = FormMode.CreateNew;
     Applicant = new DAL.Applicant();
     InitializeControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
 public void UpdateCourse(Course course)
 {
     Mode   = FormMode.Update;
     Course = course;
     InitializeControls();
     ShowCourseInControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
Beispiel #6
0
 public void UpdateApplicant(DAL.Applicant applicant)
 {
     Mode      = FormMode.Update;
     Applicant = applicant;
     InitializeControls();
     ShowApplicantInControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
Beispiel #7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                GrabUserInput();
                var manager = new ApplicantManager();
                if (Mode == FormMode.CreateNew)
                {
                    manager.Create(Applicant);
                }
                else
                {
                    manager.Update(Applicant);
                }

                MyForms.GetForm <ApplicantListForm>().LoadData();
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                GrabUserInput();
                var manager = new CourseManager();
                if (Mode == FormMode.CreateNew)
                {
                    manager.Create(Course);
                }
                else
                {
                    manager.Update(Course);
                }

                // to refresh database right away
                MyForms.GetForm <CourseListForm>().LoadData();
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #9
0
 private void allCoursesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MyForms.GetForm <CourseListForm>().Show();
 }
Beispiel #10
0
 private void allApplicantsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MyForms.GetForm <ApplicantListForm>().Show();
 }