Exemplo n.º 1
0
        private void btnConfirmProject_Click(object sender, EventArgs e)
        {
            if (!InputValidation())
            {
                return;
            }
            ProjectEntity projectEntity = new ProjectEntity();

            projectEntity.ProjectCode  = txtProjectCode.Text;
            projectEntity.ProjectName  = txtProjectName.Text;
            projectEntity.ScopeMM      = Int32.Parse(txtScopeMM.Text);
            projectEntity.Status       = (ProjectStatusValue)cbxProjectStatus.SelectedItem;
            projectEntity.StartedDate  = dtmStartedDate.Value;
            projectEntity.EndDate      = dtmEndDate.Value;
            projectEntity.CustomerName = txtCustomerName.Text;

            if (detailedFormMode == DetailedFormMode.Add)
            {
                projectBLL.AddProject(projectEntity);
            }
            if (detailedFormMode == DetailedFormMode.Update)
            {
                projectBLL.EditProject(projectEntity, projectID);
            }

            if (CommonFunctions.ShowQuestionDialog("Do you want continue to work with this project?", "Question") == DialogResult.OK)
            {
                detailedFormMode = DetailedFormMode.Update;
                load();
            }
            else
            {
                this.Close();
            }
        }