public void BindNavBar() { lblDisplayName.Text = CurrentUser.UserName; if (CurrentIteration.IterationID != 0) { if (CurrentIteration.IterationTimePeriods.Count != 0) { Avenue.Workflow.Access.IterationTimePeriod currentITP = CurrentIteration.IterationTimePeriods.getCurrentTimePeriod(); lIterationTimePeriod.Text = String.Format("{0:dddd d MMMM} - {1:dddd d MMMM}", currentITP.IterationTimePeriodStartDate, currentITP.IterationTimePeriodEndDate); } } }
public Int32 CompareTo(Object obj) { System.ComponentModel.PropertyDescriptorCollection pdc = System.ComponentModel.TypeDescriptor.GetProperties(this); Avenue.Workflow.Access.IterationTimePeriod xT = null; if (typeof(IterationTimePeriod) == obj.GetType()) { xT = (IterationTimePeriod)obj; return(this.CompareTo(xT, pdc["[DEFAULTPROPERTY]"])); } else { return(this.CompareTo((IterationTimePeriod)obj, pdc["[DEFAULTPROPERTY]"])); } }
void btnSave_Click(object sender, EventArgs e) { if (((Button)sender).Text == "Add Iteration") { Avenue.Workflow.Access.Iteration newIteration = new Avenue.Workflow.Access.Iteration(); newIteration.IterationDescription = txtIterationDescription.Text; newIteration.DefaultIterationTimePeriod = Int32.Parse(txtDefaultTimePeriod.Text); newIteration.IterationTypeID = new Avenue.Workflow.Access.IterationType(Int32.Parse(ddlIterationTypes.SelectedValue)); newIteration.IterationOwner = CurrentUser; newIteration.Insert(); DateTime tempTime = DateTime.Parse(txtIterationStartDate.Text); for (int i = 1; i <= 5; i++) { Avenue.Workflow.Access.IterationTimePeriod newITP = new Avenue.Workflow.Access.IterationTimePeriod(); newITP.IterationID = newIteration; newITP.IterationTimePeriodStartDate = tempTime; if (newIteration.DefaultIterationTimePeriod.HasValue) { tempTime = tempTime.AddDays(((double)newIteration.DefaultIterationTimePeriod.Value) * 7); newITP.IterationTimePeriodEndDate = tempTime.AddSeconds(-1); newITP.Insert(); } } Response.Redirect(String.Format("Iteration.aspx?IterationID={0}", newIteration.IterationID)); } else if (((Button)sender).Text == "Save") { aIteration.IterationDescription = txtIterationDescription.Text; aIteration.DefaultIterationTimePeriod = Int32.Parse(txtIterationDescription.Text); aIteration.Update(); lblMessage.Text = "Updated"; } }