Пример #1
0
 public void CreateNewApplicant()
 {
     Mode      = FormMode.CreateNew;
     Applicant = new Applicant();
     InitializeControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
Пример #2
0
 public void CreateNewTests()
 {
     Mode  = FormMode.CreateNew;
     Tests = new Tests();
     InitializeControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
Пример #3
0
 public void UpdateApplicant(Applicant applicant)
 {
     Mode      = FormMode.Update;
     Applicant = applicant;
     InitializeControls();
     ShowApplicantInControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
Пример #4
0
 public void UpdateTests(Tests tests)
 {
     Mode  = FormMode.Update;
     Tests = tests;
     InitializeControls();
     ShowTestsInControls();
     MdiParent = MyForms.GetForm <ParentForm>();
     Show();
 }
Пример #5
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);
            }
        }
Пример #6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                GrabUserInput();
                var manager = new TestsManager();
                if (Mode == FormMode.CreateNew)
                {
                    manager.Create(Tests);
                }
                else
                {
                    manager.Update(Tests);
                }

                MyForms.GetForm <TestListForm>().LoadData();//This code instantly refreshes data everytime users hit save button
                MessageBox.Show("Saved!");
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #7
0
 private void ApplicantListForm_Load(object sender, EventArgs e)
 {
     MdiParent = MyForms.GetForm <ParentForm>();
     LoadData();
 }
Пример #8
0
 private void allTestsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MyForms.GetForm <TestListForm>().Show();
 }