コード例 #1
0
        private void ProjectEditClick(object sender, EventArgs e)
        {
            var selectedProject = SelectedProject as Project;

            if (selectedProject == null)
            {
                return;
            }
            Close();

            var employeeEditForm = new ProjectEditForm(EmployeeRepository, ProjectRepository)
            {
                SelectedProject = selectedProject
            };

            employeeEditForm.SetText();
            employeeEditForm.RefreshList();
            employeeEditForm.ShowDialog();
        }
コード例 #2
0
        private void ProjectEditButtonClick(object sender, EventArgs e)
        {
            var selectedProject = projectsListBox.SelectedItem as Project;

            if (selectedProject == null)
            {
                var errorForm = new ErrorForm("You must select project to edit");
                errorForm.ShowDialog();
                return;
            }

            var projectEditForm = new ProjectEditForm(EmployeeRepository, ProjectRepository)
            {
                SelectedProject = selectedProject
            };

            projectEditForm.SetText();
            projectEditForm.RefreshList();
            projectEditForm.ShowDialog();
            AddRefreshList();
        }