Exemple #1
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);
            }
        }