コード例 #1
0
        private void FormRecordIssue_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeAppUserRepository users = new FakeAppUserRepository();
            List <AppUser>        usrs  = users.GetAll();

            FakeIssueStatusRepository issues   = new FakeIssueStatusRepository();
            List <IssueStatus>        myissues = new List <IssueStatus>();

            myissues = issues.GetAll();

            foreach (AppUser usr in usrs)
            {
                string name = usr.LastName + ", " + usr.FirstName;
                discoverers.Items.Add(name);
            }

            foreach (IssueStatus isSt in myissues)
            {
                statuses.Items.Add(isSt.Value);
            }

            FakeIssueRepository isss = new FakeIssueRepository();

            this.Iss_Id.Text = isss.getNextIssueId().ToString();
        }
コード例 #2
0
        private void buttonSelect_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            if (dataIssue.SelectedCells.Count < 0)
            {
                MessageBox.Show("A Issue must be selected.", "Attention");
            }
            else
            {
                _selectedID = dataIssue.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow = dataIssue.Rows[_selectedID];
                int             sID         = Convert.ToInt32(selectedRow.Cells["ID"].Value);

                _selectedID = sID;

                FakeIssueRepository iss2 = new FakeIssueRepository();
                Issue        i2          = iss2.GetIssueByID(sID);
                DialogResult result      = MessageBox.Show("Are you sure you want to Remove:" + i2.Title, "Confirmation", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    bool res = iss2.Remove(i2);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Remove Canceled", "Attention", MessageBoxButtons.OK);
                }
            }
        }
コード例 #3
0
        private void mdfyIssue_Click(object sender, EventArgs e)
        {
            FakeIssueStatusRepository iss    = new FakeIssueStatusRepository();
            FakeIssueRepository       modify = new FakeIssueRepository();

            Issue modifiedIssue = new Issue();

            modifiedIssue.id                 = Int32.Parse(this.issueID.Text);
            modifiedIssue.project_id         = issToModify.project_id;
            modifiedIssue.Discoverer         = this.disc.Text;
            modifiedIssue.Component          = this.issComp.Text;
            modifiedIssue.initialDescription = this.initDesc.Text;
            modifiedIssue.IssueStatusid      = iss.GetIdByStatus(this.issStatus.Text);
            modifiedIssue.DiscoveryDate      = DateTime.ParseExact(this.discDate.Text, "hh:mm:ss tt d MMM yyyy", null);
            modifiedIssue.Title              = this.issueTitle.Text.Trim();

            string modifyResult = modify.Modify(modifiedIssue);

            if (string.IsNullOrEmpty(modifyResult))
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show(modifyResult, "Error!");
                //this.DialogResult = DialogResult.Cancel;
                //this.Close();
            }
        }
コード例 #4
0
 public FormSelectIssue(FakeIssueRepository issueRepo, int projectId, int type)
 {
     InitializeComponent();
     formIssueRepo   = issueRepo;
     selectedProject = projectId;
     operationType   = type;
 }
コード例 #5
0
        public IssueSelect(AppUser _CurrentAppUser, int selected_id)
        {
            InitializeComponent();
            this.CenterToParent();
            btnSelect.Enabled = false;
            p_id       = selected_id;
            _IssueRepo = new FakeIssueRepository(selected_id);
            dataGridViewIssues.ColumnCount     = 7;
            dataGridViewIssues.Columns[0].Name = "ID";
            dataGridViewIssues.Columns[1].Name = "Title";
            dataGridViewIssues.Columns[2].Name = "DiscoveryDate";
            dataGridViewIssues.Columns[3].Name = "Discoverer";
            dataGridViewIssues.Columns[4].Name = "InitialDescription";
            dataGridViewIssues.Columns[5].Name = "Component";
            dataGridViewIssues.Columns[6].Name = "Status";
            List <Issue> tmp_list = _IssueRepo.GetAll(p_id);

            foreach (Issue i in tmp_list)
            {
                int             rowid = dataGridViewIssues.Rows.Add();
                DataGridViewRow row   = dataGridViewIssues.Rows[rowid];
                row.Cells["ID"].Value                 = i.Id.ToString();
                row.Cells["Title"].Value              = i.Title;
                row.Cells["DiscoveryDate"].Value      = i.DiscoveryDate;
                row.Cells["Discoverer"].Value         = i.Discoverer;
                row.Cells["InitialDescription"].Value = i.InitialDesscription;
                row.Cells["Component"].Value          = i.Component;
                row.Cells["Status"].Value             = fake.GetValueById(i.IssueStatusId);
            }
        }
コード例 #6
0
        private void FormModifySelectIssue_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeIssueRepository       iss    = new FakeIssueRepository();
            FakeIssueStatusRepository IsStat = new FakeIssueStatusRepository();
            List <Issue> yourList            = iss.GetAll(_selectedProj);

            dataIssue.ColumnCount      = 7;
            dataIssue.Columns[0].Name  = "Id";
            dataIssue.Columns[0].Width = 30;
            dataIssue.Columns[1].Name  = "Title";
            dataIssue.Columns[1].Width = 200;
            dataIssue.Columns[2].Name  = "Discovery Date";
            dataIssue.Columns[2].Width = 150;
            dataIssue.Columns[3].Name  = "Discoverer";
            dataIssue.Columns[3].Width = 100;
            dataIssue.Columns[4].Name  = "IntialDes.";
            dataIssue.Columns[4].Width = 100;
            dataIssue.Columns[5].Name  = "Components";
            dataIssue.Columns[5].Width = 100;
            dataIssue.Columns[6].Name  = "Status";
            dataIssue.Columns[6].Width = 80;

            string IsStatVal;

            foreach (Issue i2 in yourList)
            {
                IsStatVal = IsStat.GetValueByID(i2.IssueStatusID);
                string[] row = { i2.ID.ToString(), i2.Title,              i2.DiscoveryDate.ToString("MM/dd/yyyy HH:mm:ss tt"),
                                 i2.Discoverer,    i2.InitialDescription, i2.Component, IsStatVal };
                dataIssue.Rows.Add(row);
            }
        }
コード例 #7
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(IssueTitleBox.Text))
            {
                MessageBox.Show("No issue title provided", "Attention", MessageBoxButtons.OK);
                return;
            }

            if (string.IsNullOrWhiteSpace(discovererBox.Text))
            {
                MessageBox.Show("No issue discoverer provided", "Attention", MessageBoxButtons.OK);
                return;
            }

            if (string.IsNullOrWhiteSpace(componentBox.Text))
            {
                MessageBox.Show("No issue component provided", "Attention", MessageBoxButtons.OK);
                return;
            }

            if (string.IsNullOrWhiteSpace(statusBox.Text))
            {
                MessageBox.Show("No issue status provided", "Attention", MessageBoxButtons.OK);
                return;
            }


            modifyIssue.ID                 = Int32.Parse(IssueIdBox.Text);
            modifyIssue.title              = IssueTitleBox.Text;
            modifyIssue.projectId          = selectedProject;
            modifyIssue.discoveryDate      = dateTimePicker.Value;
            modifyIssue.discoverer         = discovererBox.Text;
            modifyIssue.initialDescription = descriptionBox.Text;
            modifyIssue.component          = componentBox.Text;

            FakeIssueStatusRepository formStatusRepo = new FakeIssueStatusRepository();

            foreach (IssueStatus s in formStatusRepo.GetAll())
            {
                if (s.Value == statusBox.Text)
                {
                    modifyIssue.status = s.Id;
                }
            }

            FakeIssueRepository issueRepo = new FakeIssueRepository();

            foreach (Issue i in issueRepo.GetAll(selectedProject))
            {
                if (i.title == modifyIssue.title)
                {
                    MessageBox.Show("Duplicate issue names not allowed", "Attention", MessageBoxButtons.OK);
                    return;
                }
            }

            issueRepo.Modify(modifyIssue);
            Dispose();
        }
コード例 #8
0
        public FormCreateIssue(int issueID, FakeIssueRepository issueRepo, int project)
        {
            InitializeComponent();

            newIssueID      = issueID;
            formIssueRepo   = issueRepo;
            selectedProject = project;
        }
コード例 #9
0
 public FormModifyIssue(int selected_issue, int selected_project)
 {
     InitializeComponent();
     dateTimePicker1.MaxDate = DateTime.Now;
     selected = selected_issue;
     project  = selected_project;
     fake     = new FakeIssueRepository(project);
 }
コード例 #10
0
        public FormIssueDashboard(int numOfIssues, FakeIssueRepository issueRepo, int project)
        {
            InitializeComponent();

            totalIssues     = numOfIssues;
            formIssueRepo   = issueRepo;
            selectedProject = project;
        }
コード例 #11
0
        public FormIssueModify(FakeIssueRepository faker, int selectedID)
        {
            IssueRepository = faker;
            IssueToModifyID = selectedID;


            InitializeComponent();
        }
コード例 #12
0
        public FormSelectIssue(AppUser appUser, int selectedProjectID, FakeIssueRepository faker)
        {
            _CurrentAppUser   = appUser;
            SelectedProjectID = selectedProjectID;
            IssueRepository   = faker;

            chosenID = 0;

            InitializeComponent();
        }
コード例 #13
0
        private void FormModifyIssue_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeIssueRepository iss = new FakeIssueRepository();
            Issue i2 = iss.GetIssueByID(_selectID);

            modID.Text       = Convert.ToString(i2.ID);
            modTitle.Text    = i2.Title;
            modDateTime.Text = Convert.ToString(i2.DiscoveryDate);
            modDis.Text      = i2.Discoverer;
            modComp.Text     = i2.Component;
            modStatus.Text   = Convert.ToString(i2.IssueStatusID);
            modDes.Text      = i2.InitialDescription;
        }
コード例 #14
0
        private void selIss_Click(object sender, EventArgs e)
        {
            if (this.issuesList.SelectedRows.Count == 0)
            {
                MessageBox.Show("An Issue must be Selected", "Error!");
            }
            else
            {
                int             selectedIndex = this.issuesList.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow   = this.issuesList.Rows[selectedIndex];
                string          title         = selectedRow.Cells["issTitle"].Value.ToString();
                selectedIssueId = Convert.ToInt32(selectedRow.Cells["isId"].Value);
                DialogResult confirmation        = MessageBox.Show(String.Format("Are you sure you want to remove \"{0}\"?", title), "Confirmation", MessageBoxButtons.YesNo);
                FakeIssueStatusRepository isStat = new FakeIssueStatusRepository();
                if (confirmation == DialogResult.Yes)
                {
                    Issue issToRemove = new Issue();
                    issToRemove.id                 = Convert.ToInt32(selectedRow.Cells["isId"].Value);
                    issToRemove.project_id         = currentProject;
                    issToRemove.Discoverer         = selectedRow.Cells["disc"].Value.ToString();
                    issToRemove.DiscoveryDate      = Convert.ToDateTime(selectedRow.Cells["discDate"].Value);
                    issToRemove.Title              = selectedRow.Cells["issTitle"].Value.ToString();
                    issToRemove.IssueStatusid      = isStat.GetIdByStatus(selectedRow.Cells["stat"].Value.ToString());
                    issToRemove.initialDescription = selectedRow.Cells["intiDesc"].Value.ToString();
                    issToRemove.Component          = selectedRow.Cells["comp"].Value.ToString();
                    FakeIssueRepository rmvIssue = new FakeIssueRepository();
                    bool rmvSuccess = rmvIssue.Remove(issToRemove);

                    if (rmvSuccess == true)
                    {
                        this.issuesList.Rows.RemoveAt(selectedIndex);
                        //this.DialogResult = DialogResult.OK;
                        //this.Close();
                    }
                    else
                    {
                        MessageBox.Show("This Issue could not be removed", "Error!");
                        this.DialogResult = DialogResult.Cancel;
                        this.Close();
                    }
                }
                else
                {
                    //MessageBox.Show("Remove Cancelled!","Attention");
                    this.DialogResult = DialogResult.Cancel;
                    this.Close();
                }
            }
        }
コード例 #15
0
        private void FormDashboard_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeIssueRepository fakeIssues = new FakeIssueRepository();

            this.numIssue.Text = fakeIssues.GetTotalNumberOfIssues(currentPrjId).ToString();

            List <string> monthlyIssue = new List <string>();
            List <string> issByDisc    = new List <string>(0);

            monthlyIssue = fakeIssues.GetIssuesByMonth(currentPrjId);
            issByDisc    = fakeIssues.GetIssuesByDiscoverer(currentPrjId);
            this.issueByMonth_List.Lines = monthlyIssue.ToArray();
            this.IssueByDisc_list.Lines  = issByDisc.ToArray();
        }
コード例 #16
0
        private void FormSelectIssueToModidy_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeIssueRepository i        = new FakeIssueRepository();
            List <Issue>        myIssues = i.GetAll(projectId);

            FakeIssueStatusRepository isStatus = new FakeIssueStatusRepository();
            string issue;

            foreach (Issue a in myIssues)
            {
                issue = isStatus.GetValueById(a.IssueStatusid);
                //List<string> newRow = new List<string>() { a.id.ToString(), a.Title, a.DiscoveryDate.ToString(), a.Discoverer, a.initialDescription, a.Component, issue };
                this.listOfIssues.Rows.Add(a.id.ToString(), a.Title, a.DiscoveryDate.ToString(), a.Discoverer, a.initialDescription, a.Component, issue);
            }
        }
コード例 #17
0
        private void ButtonModify_Click(object sender, EventArgs e)
        {
            FakeIssueRepository iss2 = new FakeIssueRepository();
            Issue i3 = new Issue
            {
                ID                 = Convert.ToInt32(modID.Text),
                Title              = modTitle.Text,
                DiscoveryDate      = Convert.ToDateTime(modDateTime.Text),
                Discoverer         = modDis.Text,
                Component          = modComp.Text,
                IssueStatusID      = Convert.ToInt32(modStatus.Text),
                InitialDescription = modDes.Text
            };

            _ = iss2.Modify(i3);
            this.Close();
        }
コード例 #18
0
        private void FormDashIssue_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeIssueRepository iss = new FakeIssueRepository();

            issueN   = iss.GetTotalNumberOfIssues(_currentProj);
            Month    = iss.GetIssuesByMonth(_currentProj);
            Discover = iss.GetIssuesByDiscoverer(_currentProj);

            issueNumber.Text = Convert.ToString(issueN);
            foreach (string M in Month)
            {
                listMonth.Items.Add(M);
            }
            foreach (string D in Discover)
            {
                listDis.Items.Add(D);
            }
        }
コード例 #19
0
        private void crtIssue_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.discoverers.Text))
            {
                MessageBox.Show("A Discoverer must be selected.", "Error!");
            }
            else if (string.IsNullOrEmpty(this.statuses.Text))
            {
                MessageBox.Show("A Status has to  be assigned.", "Error!");
            }
            else
            {
                Issue newIssue = new Issue();
                FakeIssueStatusRepository iss     = new FakeIssueStatusRepository();
                FakeIssueRepository       new_Iss = new FakeIssueRepository();

                newIssue.id                 = Int32.Parse(this.Iss_Id.Text);
                newIssue.project_id         = currentProjectId;
                newIssue.Discoverer         = this.discoverers.Text;
                newIssue.Component          = this.comp.Text;
                newIssue.initialDescription = this.initDesc.Text;
                newIssue.IssueStatusid      = iss.GetIdByStatus(this.statuses.Text);
                newIssue.DiscoveryDate      = DateTime.ParseExact(this.disc_dateTime.Text, "hh:mm:ss tt d MMM yyyy", null);
                newIssue.Title              = this.titleBox.Text.Trim();

                string res = new_Iss.Add(newIssue);

                if (string.IsNullOrEmpty(res) == true)
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    MessageBox.Show(res, "Error !");

                    //this.DialogResult = DialogResult.Cancel;
                    //this.DialogResult = DialogResult.Abort;
                    //this.Close();
                }
            }
        }