private void SaveBtn_Click(object sender, EventArgs e)
        {
            //TODO: SAVE CHANGES


            currentProject.PROJECT_NAME         = ProjectNameTextBox.Text;
            currentProject.PROJECT_DESCRIPTION  = ProjectDescriptionTextBox.Text;
            currentProject.CLIENT_ID            = decimal.Parse(ProjectClientComboBox.SelectedValue.ToString());
            currentProject.PROJECT_BEGIN        = ProjectStartDateDatePicker.Value;
            currentProject.PROJECT_END          = ProjectEndDatePicker.Value;
            currentProject.PROJECT_PAY_PER_HOUR = decimal.Parse(PayPerHourTextBox.Text);
            context.SaveChanges();

            RegisterNewClientBtn.Visible       = false;
            ProjectIdTextBox.Enabled           = false;
            ProjectNameTextBox.Enabled         = false;
            ProjectDescriptionTextBox.Enabled  = false;
            ProjectClientComboBox.Enabled      = false;
            RegisterNewClientBtn.Enabled       = false;
            ProjectEndDatePicker.Enabled       = false;
            ProjectStartDateDatePicker.Enabled = false;
            PayPerHourTextBox.Enabled          = false;
            TaskCountTb.Enabled  = false;
            HoursCountTb.Enabled = false;
            CostSoFarTb.Enabled  = false;

            SaveBtn.Visible        = false;
            EditDetailsBtn.Visible = true;


            //if form is open from Create Tast Form:
            foreach (Form f in Application.OpenForms)
            {
                if (f.Name.Equals("SearchProjectForm"))
                {
                    SearchProjectForm form = Application.OpenForms.OfType <SearchProjectForm>().FirstOrDefault();
                    if (form != null)
                    {
                        form.SearchBtn_Click(sender, e);
                    }
                }
            }
        }
Beispiel #2
0
        private void testFormToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var form = new SearchProjectForm();

            form.ShowDialog();
        }