コード例 #1
0
        private void FormModifyIssue_Load(object sender, EventArgs e)
        {
            dateTimediscovery.MaxDate = DateTime.Now;
            //populates the options for the drop downs
            foreach (AppUser appUser in userRepository.GetAll())
            {
                comboBoxdiscoverer.Items.Add(appUser.LastName + ", " + appUser.FirstName);
            }

            foreach (IssueStatus issueStatus in issueStatusRepository.GetAll())
            {
                comboBoxstatus.Items.Add(issueStatus.Value);
            }

            //set initial values from selected issue
            Issue issue = issueRepository.GetIssueById(_SelectedIssueId);

            textBoxid.Text                  = Convert.ToString(issue.Id);
            textBoxtitle.Text               = Convert.ToString(issue.Title);
            dateTimediscovery.Value         = issue.DiscoveryDate;
            dateTimediscovery.CustomFormat  = "hh:mm:ss tt dd MMM yyyy";
            comboBoxdiscoverer.SelectedItem = issue.Discoverer;
            textBoxcomponent.Text           = issue.Component;
            comboBoxstatus.Text             = issueStatusRepository.GetValueById(issue.IssueStatusId);
            textBoxdescription.Text         = issue.InitialDescription;

            this.CenterToScreen();
        }
コード例 #2
0
        private void FormRecordIssue_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            int    nextID;
            string disc;
            string IsStat;
            FakeIssueRepository       IssueRepo     = new FakeIssueRepository();
            FakeAppUserRepository     AppRepo       = new FakeAppUserRepository();
            FakeIssueStatusRepository IssueStatRepo = new FakeIssueStatusRepository();
            List <AppUser>            userList      = new List <AppUser>();
            List <IssueStatus>        issueStatList = new List <IssueStatus>();

            nextID = IssueRepo.GetNextIssueID(ID);
            textBoxIssueID.Text = nextID.ToString();
            userList            = AppRepo.GetAll();
            foreach (AppUser user in userList)
            {
                disc = (user.LastName + ", " + user.FirstName);
                comboBoxDiscoverer.Items.Add(disc);
            }
            issueStatList = IssueStatRepo.GetAll();
            foreach (IssueStatus stat in issueStatList)
            {
                IsStat = stat.Value;
                comboBoxIssueStatus.Items.Add(IsStat);
            }
        }
コード例 #3
0
        private void FormRecordIssue_Load(object sender, EventArgs e)
        {
            dateTimediscovery.MaxDate      = DateTime.Now;
            dateTimediscovery.Value        = DateTime.Today;
            dateTimediscovery.Format       = DateTimePickerFormat.Custom;
            dateTimediscovery.CustomFormat = "hh:mm:ss tt dd MMM yyyy";

            int newId = 1;

            foreach (AppUser appUser in userRepository.GetAll())
            {
                comboBoxdiscoverer.Items.Add(appUser.LastName + ", " + appUser.FirstName);
            }

            foreach (IssueStatus issueStatus in issueStatusRepository.GetAll())
            {
                comboBoxstatus.Items.Add(issueStatus.Value);
            }

            foreach (Issue issue in issueRepository.GetAll(_SelectedProjectId))
            {
                newId++;
            }
            this.CenterToScreen();

            textBoxid.Text = newId.ToString();
        }
コード例 #4
0
        private void FormRecord_Load(object sender, EventArgs e)
        {
            this.CenterToParent();


            //create and add a new issue
            Issue tmp = new Issue();

            IssueRepository.Add(tmp);

            //get the index from newly implemented issue then remove it
            _i = tmp.Id;
            IssueRepository.Remove(tmp);


            IdBox.Text = (_i.ToString());

            foreach (AppUser user in _userRepository.GetAll())
            {
                comboBox1.Items.Add(user.LastName + ", " + user.FirstName);
            }
            comboBox1.SelectedIndex   = 0;
            ComponentBox.SelectedText = "";
            foreach (IssueStatus issueStatus in IssueStatusRepository.GetAll())
            {
                comboBox2.Items.Add(issueStatus.Value);
            }
            comboBox2.SelectedIndex = 0;
        }
コード例 #5
0
        private void RecordIssue_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            textBox1.Text = issueRepository.GetNextID().ToString();
            List <IssueStatus> issueStatuses = fakeIssueStatusRepository.GetAll();

            foreach (IssueStatus issue in issueStatuses)
            {
                comboBoxStatus.Items.Add(issue.value);
            }
            comboBoxStatus.SelectedIndex = 0;
            FakeAppUserRepository fakeAppUserRepository = new FakeAppUserRepository();
            List <AppUser>        appUsers = fakeAppUserRepository.GetAll();

            foreach (AppUser user in appUsers)
            {
                comboBoxDiscoverer.Items.Add(user.UserName);
            }
        }