Ejemplo n.º 1
0
        public void Add(int ID, string val)
        {
            IssueStatus issueStatus = new IssueStatus();

            issueStatus.Id    = ID;
            issueStatus.value = val;
            issueStatuses.Add(issueStatus);
        }
Ejemplo n.º 2
0
        public void Add(int Id, string value)
        {
            IssueStatus NewIssueStatus = new IssueStatus();

            NewIssueStatus.Id    = Id;
            NewIssueStatus.Value = value;
            IssueStatuses.Add(NewIssueStatus);
        }
        public void Add(int StatID, string Value)
        {
            IssueStatus IsStat = new IssueStatus();

            IsStat.ID    = StatID;
            IsStat.Value = Value;
            IssueStatuses.Add(IsStat);
        }
Ejemplo n.º 4
0
        private void buttonCreate_Click(object sender, EventArgs e)
        {
            bool   isValid = false;
            string ValidIssue;
            string IssueStat;
            FakeIssueRepository       IssueRepository = new FakeIssueRepository();
            FakeIssueStatusRepository StatRepo        = new FakeIssueStatusRepository();
            IssueStatus IsStat = new IssueStatus();
            Issue       issue  = new Issue();

            issue.ProjectID     = ID;
            issue.ID            = IssueRepository.GetNextIssueID(ID);
            issue.DiscoveryDate = dateTimeDiscoveryDate.Value;
            if (!IssueRepository.isDuplicate(textBoxIssueTitle.ToString()))
            {
                issue.Title = textBoxIssueTitle.Text.ToString();
            }
            if (comboBoxDiscoverer.SelectedIndex > 0)
            {
                issue.Discoverer = comboBoxDiscoverer.SelectedItem.ToString();
            }
            issue.InitialDescription = textBoxInitialDescription.Text.ToString();
            issue.Component          = textBoxComponent.Text.ToString();
            IssueStat           = comboBoxIssueStatus.SelectedItem.ToString();
            issue.IssueStatusID = StatRepo.GetIdByStatus(IssueStat);

            ValidIssue = IssueRepository.ValidateIssue(issue);
            if (ValidIssue == "")
            {
                IssueRepository.Add(issue);
                isValid = true;
                MessageBox.Show("Issue was successfully created!", "Attention");
                this.Close();
            }
            else
            {
                MessageBox.Show(ValidIssue, "Attention");
                isValid = false;
            }
        }