void rIterationList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { Label lblCurrentIteration = (Label)(e.Item.FindControl("lblCurrentIteration")); if (CurrentIteration.IterationID == 0) { if (CurrentUser.IterationsPartOf.Count > 0) { lblCurrentIteration.Text = CurrentUser.IterationsPartOf.First().IterationDescription; } } else { lblCurrentIteration.Text = CurrentIteration.IterationDescription; } } else if (e.Item.ItemType == ListItemType.Item) { Label lblIterationName = (Label)(e.Item.FindControl("lblIterationName")); HiddenField hfIterationID = (HiddenField)(e.Item.FindControl("hfIterationID")); Avenue.Workflow.Access.Iteration aIteration = (Avenue.Workflow.Access.Iteration)e.Item.DataItem; lblIterationName.Text = aIteration.IterationDescription; hfIterationID.Value = aIteration.IterationID.ToString(); } }
public Int32 CompareTo(Object obj) { System.ComponentModel.PropertyDescriptorCollection pdc = System.ComponentModel.TypeDescriptor.GetProperties(this); Avenue.Workflow.Access.Iteration xT = null; if (typeof(Iteration) == obj.GetType()) { xT = (Iteration)obj; return(this.CompareTo(xT, pdc["[DEFAULTPROPERTY]"])); } else { return(this.CompareTo((Iteration)obj, pdc["[DEFAULTPROPERTY]"])); } }
void rIterationsIn_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item) { System.Web.UI.HtmlControls.HtmlAnchor aIterationIn = (System.Web.UI.HtmlControls.HtmlAnchor)(e.Item.FindControl("aIterationIn")); Label lblIterationIn = (Label)(e.Item.FindControl("lblIterationIn")); Avenue.Workflow.Access.Iteration aIteration = (Avenue.Workflow.Access.Iteration)e.Item.DataItem; //System.Web.UI.HtmlControls.HtmlGenericControl li = (System.Web.UI.HtmlControls.HtmlGenericControl)aIterationIn.Parent; lblIterationIn.Text = aIteration.IterationDescription; aIterationIn.HRef = String.Format("../Admin/Iteration.aspx?IterationID={0}", aIteration.IterationID); // if (iterationID != 0) //if (iterationID == aIteration.IterationID) li.Attributes.Add("class", "active"); } }
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"; } }