private void bind() { #region Bind Default Child Data DojoSeminarOptionManager parentOptionManager = new DojoSeminarOptionManager(); DojoSeminarOptionCollection parentOptionCollection = parentOptionManager.GetCollection(string.Empty, string.Empty, null); ComponentArt.Web.UI.ComboBoxItem ParentOptionNullItem = new ComponentArt.Web.UI.ComboBoxItem(); ParentOptionNullItem.Text = "Null"; ParentOptionNullItem.Value = "Null"; comboParentOption.Items.Add(ParentOptionNullItem); foreach (DojoSeminarOption parentOption in parentOptionCollection) { ComponentArt.Web.UI.ComboBoxItem i = new ComponentArt.Web.UI.ComboBoxItem(); i.Text = parentOption.ToString(); i.Value = parentOption.ID.ToString(); comboParentOption.Items.Add(i); } DojoSeminarRegistrationManager parentRegistrationManager = new DojoSeminarRegistrationManager(); DojoSeminarRegistrationCollection parentRegistrationCollection = parentRegistrationManager.GetCollection(string.Empty, string.Empty, null); ComponentArt.Web.UI.ComboBoxItem ParentRegistrationNullItem = new ComponentArt.Web.UI.ComboBoxItem(); ParentRegistrationNullItem.Text = "Null"; ParentRegistrationNullItem.Value = "Null"; comboParentRegistration.Items.Add(ParentRegistrationNullItem); foreach (DojoSeminarRegistration parentRegistration in parentRegistrationCollection) { ComponentArt.Web.UI.ComboBoxItem i = new ComponentArt.Web.UI.ComboBoxItem(); i.Text = parentRegistration.ToString(); i.Value = parentRegistration.ID.ToString(); comboParentRegistration.Items.Add(i); } #endregion }
private void Populate(string id) { DojoSeminar s; s = new DojoSeminar(int.Parse(id)); DojoSeminarRegistrationManager dsrm = new DojoSeminarRegistrationManager(); DojoSeminarRegistrationCollection registrations = dsrm.GetCollection("ParentSeminarID=" + id, "LastName, FirstName, MiddleName", DojoSeminarRegistrationFlags.Contact); name.Text = s.Name; description.Text = s.Description; location.Text = s.Location.BusinessName; Panel regPanel = new Panel(); regPanel.ID = "regPanel"; regPanel.Style.Add("overflow", "scroll"); regPanel.Style.Add("height", "200px"); addCells(table, new LiteralControl("Registrations"), regPanel); Table regTable = new Table(); regPanel.Controls.Add(regTable); foreach (DojoSeminarRegistration r in registrations) { addCell(regTable, string.Empty, r.Contact.FullName); } }
private void loadRegistrations() { if (registrationsLoaded) { return; } DojoSeminarRegistrationManager m = new DojoSeminarRegistrationManager(); if (cbIsPaid.Checked) { registrations = m.GetCollection("ParentSeminarID=" + ddParentSeminar.SelectedItem.Value + " AND " + "PaymentAmount > 0", "Contact.LastName, " + "Contact.FirstName", DojoSeminarRegistrationFlags.ParentSeminar, DojoSeminarRegistrationFlags.Contact); } else if (ddParentSeminar.SelectedItem.Value != "-1") { registrations = m.GetCollection("ParentSeminarID=" + ddParentSeminar.SelectedItem.Value, "Contact.LastName, " + "Contact.FirstName", DojoSeminarRegistrationFlags.ParentSeminar, DojoSeminarRegistrationFlags.Contact); } else { registrations = m.GetCollection(string.Empty, "Contact.LastName, " + "Contact.FirstName", DojoSeminarRegistrationFlags.ParentSeminar, DojoSeminarRegistrationFlags.Contact); } registrationsLoaded = true; }
/// <summary> /// Render this control to the output parameter specified. /// </summary> /// <param name="output"> The HTML writer to write out to </param> protected override void RenderContent(HtmlTextWriter output) { DojoSeminarRegistrationManager m = new DojoSeminarRegistrationManager(); DojoSeminarRegistrationCollection dojoSeminarRegistrationCollection = m.GetCollection(string.Empty, string.Empty, null); // Render Header Row this.headerLockEnabled = true; RenderRow(this.HeaderRowCssClass, ); bool rowflag = false; string rowCssClass; // // Render Records // foreach (DojoSeminarRegistration dojoSeminarRegistration in dojoSeminarRegistrationCollection) { if (rowflag) { rowCssClass = defaultRowCssClass; } else { rowCssClass = alternateRowCssClass; } rowflag = !rowflag; output.WriteBeginTag("tr"); output.WriteAttribute("i", dojoSeminarRegistration.ID.ToString()); output.WriteLine(HtmlTextWriter.TagRightChar); output.Indent++; output.Indent--; output.WriteEndTag("tr"); output.WriteLine(); } }
private void bindDropDownLists() { #region Bind Default Child Data msParentOption.Items.Add(new ListItem("Null", "Null")); DojoSeminarOptionManager parentOptionManager = new DojoSeminarOptionManager(); DojoSeminarOptionCollection parentOptionCollection = parentOptionManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoSeminarOption parentOption in parentOptionCollection) { ListItem i = new ListItem(parentOption.ToString(), parentOption.ID.ToString()); msParentOption.Items.Add(i); } msParentRegistration.Items.Add(new ListItem("Null", "Null")); DojoSeminarRegistrationManager parentRegistrationManager = new DojoSeminarRegistrationManager(); DojoSeminarRegistrationCollection parentRegistrationCollection = parentRegistrationManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoSeminarRegistration parentRegistration in parentRegistrationCollection) { ListItem i = new ListItem(parentRegistration.ToString(), parentRegistration.ID.ToString()); msParentRegistration.Items.Add(i); } #endregion }
protected override void RenderViewPane(HtmlTextWriter output) { this.InitializeRenderHelpers(output); DojoSeminar seminar = new DojoSeminar(int.Parse(HttpContext.Current.Request.QueryString[0])); RenderTableBeginTag("_viewPanel", this.CellPadding, this.CellSpacing, Unit.Percentage(100), Unit.Empty, this.CssClass); output.WriteFullBeginTag("tr"); output.WriteBeginTag("th"); output.WriteAttribute("colspan", "2"); output.WriteAttribute("class", this.HeaderCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write(seminar.Name); output.Write(" (" + seminar.ID.ToString() + ")"); output.WriteEndTag("th"); output.WriteEndTag("tr"); #region General Information output.WriteFullBeginTag("tr"); output.WriteBeginTag("td"); output.WriteAttribute("colspan", "2"); output.WriteAttribute("class", this.SubHeaderCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write("General"); output.WriteEndTag("td"); output.WriteEndTag("tr"); output.WriteFullBeginTag("tr"); output.WriteBeginTag("td"); output.WriteAttribute("colspan", "2"); output.WriteAttribute("class", this.DefaultRowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write("<strong>Location</strong> : "); output.Write(seminar.Location.BusinessName); output.WriteEndTag("td"); output.WriteEndTag("tr"); output.WriteFullBeginTag("tr"); output.WriteBeginTag("td"); output.WriteAttribute("colspan", "2"); output.WriteAttribute("class", this.DefaultRowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write("<strong>Partial Registration Fees</strong> : "); switch (seminar.ClassUnitType) { case DojoSeminarClassUnitType.Day: output.Write(seminar.ClassUnitFee.ToString("c")); output.Write(" Per Day"); break; case DojoSeminarClassUnitType.Class: output.Write(seminar.ClassUnitFee.ToString("c")); output.Write(" Per Class"); break; case DojoSeminarClassUnitType.None: output.Write(" None "); break; } output.WriteEndTag("td"); output.WriteEndTag("tr"); output.WriteFullBeginTag("tr"); output.WriteBeginTag("td"); output.WriteAttribute("colspan", "2"); output.WriteAttribute("class", this.DefaultRowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write("<strong>Full Registration Fee</strong> : "); output.Write(seminar.FullRegistrationFee.ToString("c")); output.WriteEndTag("td"); output.WriteEndTag("tr"); #endregion #region Students Attended output.WriteFullBeginTag("tr"); output.WriteBeginTag("td"); output.WriteAttribute("colspan", "2"); output.WriteAttribute("class", this.SubHeaderCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write("Students"); output.WriteEndTag("td"); output.WriteEndTag("tr"); DojoSeminarRegistrationManager dsrm = new DojoSeminarRegistrationManager(); DojoSeminarRegistrationCollection registrations = dsrm.GetCollection("ParentSeminarID=" + seminar.ID.ToString(), "LastName, FirstName, MiddleName", DojoSeminarRegistrationFlags.Contact); foreach (DojoSeminarRegistration registration in registrations) { output.WriteFullBeginTag("tr"); output.WriteBeginTag("td"); output.WriteAttribute("class", this.defaultRowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write(registration.Contact.ConstructName("LS,FMi.")); output.WriteEndTag("td"); output.WriteBeginTag("td"); output.WriteAttribute("class", this.defaultRowCssClass); output.Write(HtmlTextWriter.TagRightChar); if (registration.IsPaid) { output.Write("Paid"); } else { output.Write("Preregistration"); } output.WriteEndTag("td"); output.WriteEndTag("tr"); } #endregion output.WriteEndTag("table"); }
private void bindDropDownLists() { #region Bind General Child Data msRegistration.Items.Add(new ListItem("Null", "Null")); DojoSeminarRegistrationManager registrationManager = new DojoSeminarRegistrationManager(); DojoSeminarRegistrationCollection registrationCollection = registrationManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoSeminarRegistration registration in registrationCollection) { ListItem i = new ListItem(registration.ToString(), registration.ID.ToString()); msRegistration.Items.Add(i); } msParentReservation.Items.Add(new ListItem("Null", "Null")); DojoSeminarReservationManager parentReservationManager = new DojoSeminarReservationManager(); DojoSeminarReservationCollection parentReservationCollection = parentReservationManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoSeminarReservation parentReservation in parentReservationCollection) { ListItem i = new ListItem(parentReservation.ToString(), parentReservation.ID.ToString()); msParentReservation.Items.Add(i); } #endregion #region Bind Classes Child Data msClass1.Items.Add(new ListItem("Null", "Null")); DojoClassManager class1Manager = new DojoClassManager(); DojoClassCollection class1Collection = class1Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class1 in class1Collection) { ListItem i = new ListItem(class1.ToString(), class1.ID.ToString()); msClass1.Items.Add(i); } msClass2.Items.Add(new ListItem("Null", "Null")); DojoClassManager class2Manager = new DojoClassManager(); DojoClassCollection class2Collection = class2Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class2 in class2Collection) { ListItem i = new ListItem(class2.ToString(), class2.ID.ToString()); msClass2.Items.Add(i); } msClass3.Items.Add(new ListItem("Null", "Null")); DojoClassManager class3Manager = new DojoClassManager(); DojoClassCollection class3Collection = class3Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class3 in class3Collection) { ListItem i = new ListItem(class3.ToString(), class3.ID.ToString()); msClass3.Items.Add(i); } msClass4.Items.Add(new ListItem("Null", "Null")); DojoClassManager class4Manager = new DojoClassManager(); DojoClassCollection class4Collection = class4Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class4 in class4Collection) { ListItem i = new ListItem(class4.ToString(), class4.ID.ToString()); msClass4.Items.Add(i); } msClass5.Items.Add(new ListItem("Null", "Null")); DojoClassManager class5Manager = new DojoClassManager(); DojoClassCollection class5Collection = class5Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class5 in class5Collection) { ListItem i = new ListItem(class5.ToString(), class5.ID.ToString()); msClass5.Items.Add(i); } msClass6.Items.Add(new ListItem("Null", "Null")); DojoClassManager class6Manager = new DojoClassManager(); DojoClassCollection class6Collection = class6Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class6 in class6Collection) { ListItem i = new ListItem(class6.ToString(), class6.ID.ToString()); msClass6.Items.Add(i); } msClass7.Items.Add(new ListItem("Null", "Null")); DojoClassManager class7Manager = new DojoClassManager(); DojoClassCollection class7Collection = class7Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class7 in class7Collection) { ListItem i = new ListItem(class7.ToString(), class7.ID.ToString()); msClass7.Items.Add(i); } msClass8.Items.Add(new ListItem("Null", "Null")); DojoClassManager class8Manager = new DojoClassManager(); DojoClassCollection class8Collection = class8Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class8 in class8Collection) { ListItem i = new ListItem(class8.ToString(), class8.ID.ToString()); msClass8.Items.Add(i); } msClass9.Items.Add(new ListItem("Null", "Null")); DojoClassManager class9Manager = new DojoClassManager(); DojoClassCollection class9Collection = class9Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class9 in class9Collection) { ListItem i = new ListItem(class9.ToString(), class9.ID.ToString()); msClass9.Items.Add(i); } msClass10.Items.Add(new ListItem("Null", "Null")); DojoClassManager class10Manager = new DojoClassManager(); DojoClassCollection class10Collection = class10Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClass class10 in class10Collection) { ListItem i = new ListItem(class10.ToString(), class10.ID.ToString()); msClass10.Items.Add(i); } #endregion #region Bind Definitions Child Data msDefinition1.Items.Add(new ListItem("Null", "Null")); DojoClassDefinitionManager definition1Manager = new DojoClassDefinitionManager(); DojoClassDefinitionCollection definition1Collection = definition1Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClassDefinition definition1 in definition1Collection) { ListItem i = new ListItem(definition1.ToString(), definition1.ID.ToString()); msDefinition1.Items.Add(i); } msDefinition2.Items.Add(new ListItem("Null", "Null")); DojoClassDefinitionManager definition2Manager = new DojoClassDefinitionManager(); DojoClassDefinitionCollection definition2Collection = definition2Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClassDefinition definition2 in definition2Collection) { ListItem i = new ListItem(definition2.ToString(), definition2.ID.ToString()); msDefinition2.Items.Add(i); } msDefinition3.Items.Add(new ListItem("Null", "Null")); DojoClassDefinitionManager definition3Manager = new DojoClassDefinitionManager(); DojoClassDefinitionCollection definition3Collection = definition3Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClassDefinition definition3 in definition3Collection) { ListItem i = new ListItem(definition3.ToString(), definition3.ID.ToString()); msDefinition3.Items.Add(i); } #endregion }