public void RetrieveMilestone(Milestone milestone) { if (milestone == null) { throw new ArgumentNullException("milestone"); } milestone.Name = nameTextBox.Text; milestone.State = (MilestoneState)stateComboBox.SelectedIndex; milestone.DisplayOrder = (int)displayOrderNumericUpDown.Value; milestone.Description = descriptionTextBox.Text; return; }
public void ShowMilestones(Milestone[] milestones) { if (milestones == null) { throw new ArgumentNullException("milestones"); } milestonesListView.BeginUpdate(); milestonesListView.Items.Clear(); foreach (var milestone in milestones) { string milestoneState; switch (milestone.State) { case MilestoneState.Active: milestoneState = Resources.String_Active; break; case MilestoneState.Completed: milestoneState = Resources.String_Completed; break; case MilestoneState.Cancelled: milestoneState = Resources.String_Cancelled; break; default: milestoneState = string.Empty; break; } ListViewItem lvi = new ListViewItem(); lvi.Text = milestone.Name; lvi.SubItems.Add(milestoneState); lvi.Tag = milestone; milestonesListView.Items.Add(lvi); } milestonesListView.EndUpdate(); milestonesListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); return; }
public void ShowMilestones(Milestone[] milestones) { if (milestones == null) { throw new ArgumentNullException("milestones"); } milestoneComboBox.BeginUpdate(); milestoneComboBox.Items.Clear(); milestoneComboBox.Items.AddRange(milestones); milestoneComboBox.EndUpdate(); reportedByComboBox.Items.Clear(); reportedByComboBox.Items.AddRange(Ticket.GetReporters()); assignedToComboBox.Items.Clear(); assignedToComboBox.Items.AddRange(Ticket.GetAssignees()); return; }
public Milestone GetMilestone(IDatabaseProvider db) { return(Milestone.GetMilestone(db, milestoneID)); }
public static Milestone[] GetMilestones(int projectID) { MilestonesTableAdapter tableAdapter = Database.MilestonesTableAdapter; PeygirDatabaseDataSet.MilestonesDataTable rows = tableAdapter.GetDataByProjectID(projectID); // Create list. List<Milestone> milestones = new List<Milestone>(); foreach (var row in rows) { // Add. Milestone milestone = new Milestone(row); milestones.Add(milestone); } return milestones.ToArray(); }
public static Milestone GetMilestone(int id) { MilestonesTableAdapter tableAdapter = Database.MilestonesTableAdapter; PeygirDatabaseDataSet.MilestonesDataTable rows = tableAdapter.GetDataByID(id); if (rows.Count == 1) { // Found. Milestone milestone = new Milestone(rows[0]); return milestone; } // Not found. return null; }
public void ShowMilestone(Milestone milestone) { if (milestone == null) { throw new ArgumentNullException("milestone"); } nameTextBox.Text = milestone.Name; stateComboBox.SelectedIndex = (int)milestone.State; displayOrderNumericUpDown.Value = Math.Min(milestone.DisplayOrder, displayOrderNumericUpDown.Maximum); descriptionTextBox.Text = milestone.Description; return; }