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); } }
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(); }
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(); } }
private void FormModifyIssue_Load(object sender, EventArgs e) { //FakeIssueStatusRepository myStatus = new FakeIssueStatusRepository(); P5.FakeAppUserRepository users = new P5.FakeAppUserRepository(); List <P5.AppUser> usrs = users.GetAll(); FakeIssueStatusRepository issues = new FakeIssueStatusRepository(); List <IssueStatus> myissues = new List <IssueStatus>(); myissues = issues.GetAll(); foreach (P5.AppUser usr in usrs) { string name = usr.LastName + ", " + usr.FirstName; this.disc.Items.Add(name); } foreach (IssueStatus isSt in myissues) { this.issStatus.Items.Add(isSt.Value); } this.issueID.Text = issToModify.id.ToString(); this.issueTitle.Text = issToModify.Title; this.discDate.Text = issToModify.DiscoveryDate.ToString(); this.disc.Text = issToModify.Discoverer; this.issComp.Text = issToModify.Component; this.issStatus.Text = issues.GetValueById(issToModify.IssueStatusid); this.initDesc.Text = issToModify.Component; }
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(); }
private void CreateIssueButton_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(TitleBox.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; } Issue newIssue = new Issue(); newIssue.ID = Int32.Parse(IssueIDBox.Text); newIssue.title = TitleBox.Text; newIssue.projectId = selectedProject; newIssue.discoveryDate = dateTimePicker.Value; newIssue.discoverer = DiscovererBox.Text; newIssue.initialDescription = DescriptionBox.Text; newIssue.component = ComponentBox.Text; FakeIssueStatusRepository formStatusRepo = new FakeIssueStatusRepository(); foreach (IssueStatus s in formStatusRepo.GetAll()) { if (s.Value == StatusBox.Text) { newIssue.status = s.Id; } } foreach (Issue i in formIssueRepo.GetAll(selectedProject)) { if (i.title == newIssue.title) { MessageBox.Show("Duplicate issue names not allowed", "Attention", MessageBoxButtons.OK); return; } } formIssueRepo.Add(newIssue); Dispose(); }
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(); } } }
private void SelectButton_Click(object sender, EventArgs e) { FakeIssueStatusRepository formStatusRepo = new FakeIssueStatusRepository(); Issue modifyIssue = new Issue(); foreach (DataGridViewRow row in dataGridView.SelectedRows) { modifyIssue.ID = Int32.Parse(row.Cells[0].Value.ToString()); modifyIssue.title = row.Cells[1].Value.ToString(); modifyIssue.discoveryDate = DateTime.Parse(row.Cells[2].Value.ToString()); modifyIssue.discoverer = row.Cells[3].Value.ToString(); modifyIssue.initialDescription = row.Cells[4].Value.ToString(); modifyIssue.component = row.Cells[5].Value.ToString(); foreach (IssueStatus s in formStatusRepo.GetAll()) { if (s.Value == row.Cells[6].Value.ToString()) { modifyIssue.status = s.Id; } } } if (operationType == 0) { DialogResult = DialogResult.OK; FormModifyIssue modifyForm = new FormModifyIssue(modifyIssue, selectedProject); modifyForm.ShowDialog(); modifyForm.Dispose(); } else if (operationType == 1) { DialogResult result = MessageBox.Show("Are you sure you want to remove: " + modifyIssue.title + "?", "Confirmation", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { formIssueRepo.Remove(modifyIssue); } else { MessageBox.Show("Remove canceled", "Attention", MessageBoxButtons.OK); Dispose(); } } Dispose(); }
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); } }
private void FormSelectIssue_Load(object sender, EventArgs e) { DataTable issues = new DataTable("Issues"); DataColumn c0 = new DataColumn("ID"); DataColumn c1 = new DataColumn("Title"); DataColumn c2 = new DataColumn("DiscoveryDate"); DataColumn c3 = new DataColumn("Discoverer"); DataColumn c4 = new DataColumn("InitialDescription"); DataColumn c5 = new DataColumn("Component"); DataColumn c6 = new DataColumn("Status"); issues.Columns.Add(c0); issues.Columns.Add(c1); issues.Columns.Add(c2); issues.Columns.Add(c3); issues.Columns.Add(c4); issues.Columns.Add(c5); issues.Columns.Add(c6); DataRow row; FakeIssueStatusRepository formStatusRepo = new FakeIssueStatusRepository(); foreach (Issue i in formIssueRepo.GetAll(selectedProject)) { row = issues.NewRow(); row["ID"] = i.ID; row["Title"] = i.title; row["DiscoveryDate"] = i.discoveryDate; row["Discoverer"] = i.discoverer; row["InitialDescription"] = i.initialDescription; row["Component"] = i.component; foreach (IssueStatus s in formStatusRepo.GetAll()) { if (s.Id == i.ID) { row["Status"] = s.Value; } } issues.Rows.Add(row); } dataGridView.DataSource = issues; }
private void FormCreateIssue_Load(object sender, EventArgs e) { dateTimePicker.MaxDate = DateTime.Today; IssueIDBox.Text = newIssueID + ""; FakeAppUserRepository userRepo = new FakeAppUserRepository(); FakeIssueStatusRepository statusRepo = new FakeIssueStatusRepository(); string fullName; foreach (AppUser user in userRepo.GetAll()) { fullName = user.LastName + ", " + user.FirstName; DiscovererBox.Items.Add(fullName); } foreach (IssueStatus status in statusRepo.GetAll()) { StatusBox.Items.Add(status.Value); } }
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(); } } }
private void SelIssue_Click(object sender, EventArgs e) { if (this.listOfIssues.SelectedRows.Count == 0) { MessageBox.Show("An Issue must be Selected", "Error!"); } else { int selectedIndex = this.listOfIssues.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = this.listOfIssues.Rows[selectedIndex]; string title = selectedRow.Cells["issTitle"].Value.ToString(); selectedIssueId = Convert.ToInt32(selectedRow.Cells["issueId"].Value); Issue issueToModify = new Issue(); FakeIssueStatusRepository isStat = new FakeIssueStatusRepository(); issueToModify.id = Convert.ToInt32(selectedRow.Cells["issueId"].Value); issueToModify.project_id = projectId; issueToModify.Discoverer = selectedRow.Cells["disc"].Value.ToString(); issueToModify.DiscoveryDate = Convert.ToDateTime(selectedRow.Cells["discDate"].Value); issueToModify.Title = selectedRow.Cells["issTitle"].Value.ToString(); issueToModify.IssueStatusid = isStat.GetIdByStatus(selectedRow.Cells["stat"].Value.ToString()); issueToModify.initialDescription = selectedRow.Cells["intiDesc"].Value.ToString(); issueToModify.Component = selectedRow.Cells["comp"].Value.ToString(); FormModifyIssue modify = new FormModifyIssue(issueToModify); modify.ShowDialog(); if (modify.DialogResult == DialogResult.Cancel) { MessageBox.Show("Modification Cancelled ! .", "Attention"); this.DialogResult = DialogResult.Cancel; } else { this.DialogResult = DialogResult.OK; this.Close(); } } }
private void FormModifyIssue_Load(object sender, EventArgs e) { IssueIdBox.Text = modifyIssue.ID + ""; IssueTitleBox.Text = modifyIssue.title; dateTimePicker.Value = modifyIssue.discoveryDate; discovererBox.Text = modifyIssue.discoverer; componentBox.Text = modifyIssue.component; FakeIssueStatusRepository formStatusRepo = new FakeIssueStatusRepository(); foreach (IssueStatus s in formStatusRepo.GetAll()) { if (s.Id == modifyIssue.ID) { statusBox.Text = s.Value; } } descriptionBox.Text = modifyIssue.initialDescription; dateTimePicker.MaxDate = DateTime.Today; FakeAppUserRepository userRepo = new FakeAppUserRepository(); FakeIssueStatusRepository statusRepo = new FakeIssueStatusRepository(); string fullName; foreach (AppUser user in userRepo.GetAll()) { fullName = user.LastName + ", " + user.FirstName; discovererBox.Items.Add(fullName); } foreach (IssueStatus status in statusRepo.GetAll()) { statusBox.Items.Add(status.Value); } }