예제 #1
0
        private void ClickRequirementGridViewCell(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                switch (e.ColumnIndex)
                {
                    case 5:
                        RequirementManage requirementForm = new RequirementManage(_presentationModel, _projectComboBox.Text, _requirementGridView.Rows[e.RowIndex].Cells[2].Value.ToString(), _requirementGridView.Rows[e.RowIndex].Cells[3].Value.ToString());
                        if (requirementForm.ShowDialog() == DialogResult.OK)
                            InitializeRequirementGridView();
                        else
                            _requirementGridView.SelectedCells[0].Selected = false;
                        break;

                    case 6:
                        _presentationModel.DeleteRequirement(_projectComboBox.Text, _requirementGridView.Rows[e.RowIndex].Cells[2].Value.ToString());
                        InitializeRequirementGridView();
                        break;

                    default:
                        _requirementGridView.SelectedCells[0].Selected = false;
                        break;
                }
            }
        }
예제 #2
0
 private void ClickNewRequirementButton(object sender, EventArgs e)
 {
     if (_requirementGridView.Rows.Count > 0)
     {
         int RequirementStatus = Convert.ToInt32(_requirementGridView.Rows[0].Cells[4].Value);
         if (_requirementGridView.Rows[0].DefaultCellStyle.BackColor == Color.Yellow || _requirementGridView.Rows[0].DefaultCellStyle.BackColor == Color.GreenYellow)
             return;
     }
     if (_projectComboBox.Text != "")
     {
         RequirementManage requirementForm = new RequirementManage(_presentationModel, _projectComboBox.Text);
         if (requirementForm.ShowDialog() == DialogResult.OK)
             InitializeRequirementGridView();
     }
 }