コード例 #1
0
        private void createButton_Click(object sender, EventArgs e)
        {
            FakeFeatureRepository feat = new FakeFeatureRepository();
            Feature f = new Feature();

            f.ID        = feat.GetNextFeatureID(_selectProj);
            f.ProjectID = _selectProj;

            if (feat.isDuplicate(featTextBox.Text.Trim()) == true)
            {
                MessageBox.Show("Title Must Be Unique", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (featTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Title Must Have a Value", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                f.Title = featTextBox.Text.Trim();
                feat.Add(f);
            }
            this.Close();
        }