Exemplo n.º 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();
        }
Exemplo n.º 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();
 }
Exemplo n.º 6
0
 public void UpdateApplicant(DAL.Applicant applicant)
 {
     Mode      = FormMode.Update;
     Applicant = applicant;
     InitializeControls();
     ShowApplicantInControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 9
0
 private void allCoursesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MyForms.GetForm <CourseListForm>().Show();
 }
Exemplo n.º 10
0
 private void allApplicantsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MyForms.GetForm <ApplicantListForm>().Show();
 }