private void bindDropDownLists() { #region Bind General Child Data DojoSeminarManager parentSeminarManager = new DojoSeminarManager(); DojoSeminarCollection parentSeminarCollection = parentSeminarManager.GetCollection(string.Empty, "Name", null); foreach (DojoSeminar parentSeminar in parentSeminarCollection) { ListItem i = new ListItem(parentSeminar.Name, parentSeminar.ID.ToString()); msParentSeminar.Items.Add(i); } if (msStatus.Items.Count == 0) { msStatus.Items.Add(new ListItem("Unverified", "0")); msStatus.Items.Add(new ListItem("Verified", "10")); msStatus.Items.Add(new ListItem("Paid", "15")); } #endregion #region Bind Contact Child Data #endregion }
public DojoSeminarCollection Clone() { DojoSeminarCollection clonedDojoSeminar = new DojoSeminarCollection(count); lock (this) { foreach (DojoSeminar item in this) { clonedDojoSeminar.Add(item); } } return(clonedDojoSeminar); }
private void bindDropDownLists() { #region Bind Default Child Data msInstructor.Items.Add(new ListItem("Null", "Null")); DojoMemberManager instructorManager = new DojoMemberManager(); DojoMemberCollection instructorCollection = instructorManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMember instructor in instructorCollection) { ListItem i = new ListItem(instructor.ToString(), instructor.ID.ToString()); msInstructor.Items.Add(i); } msParentSeminar.Items.Add(new ListItem("Null", "Null")); DojoSeminarManager parentSeminarManager = new DojoSeminarManager(); DojoSeminarCollection parentSeminarCollection = parentSeminarManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoSeminar parentSeminar in parentSeminarCollection) { ListItem i = new ListItem(parentSeminar.ToString(), parentSeminar.ID.ToString()); msParentSeminar.Items.Add(i); } msParentDefinition.Items.Add(new ListItem("Null", "Null")); DojoClassDefinitionManager parentDefinitionManager = new DojoClassDefinitionManager(); DojoClassDefinitionCollection parentDefinitionCollection = parentDefinitionManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoClassDefinition parentDefinition in parentDefinitionCollection) { ListItem i = new ListItem(parentDefinition.ToString(), parentDefinition.ID.ToString()); msParentDefinition.Items.Add(i); } msLocation.Items.Add(new ListItem("Null", "Null")); GreyFoxContactManager locationManager = new GreyFoxContactManager("kitTessen_Locations"); GreyFoxContactCollection locationCollection = locationManager.GetCollection(string.Empty, string.Empty); foreach (GreyFoxContact location in locationCollection) { ListItem i = new ListItem(location.ToString(), location.ID.ToString()); msLocation.Items.Add(i); } msAccessControlGroup.Items.Add(new ListItem("Null", "Null")); DojoAccessControlGroupManager accessControlGroupManager = new DojoAccessControlGroupManager(); DojoAccessControlGroupCollection accessControlGroupCollection = accessControlGroupManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoAccessControlGroup accessControlGroup in accessControlGroupCollection) { ListItem i = new ListItem(accessControlGroup.ToString(), accessControlGroup.ID.ToString()); msAccessControlGroup.Items.Add(i); } #endregion }
private void bindDropDownLists() { ddParentSeminar.Items.Clear(); DojoSeminarManager m = new DojoSeminarManager(); DojoSeminarCollection seminars = m.GetCollection(string.Empty, "Name", DojoSeminarFlags.Location); foreach (DojoSeminar seminar in seminars) { ListItem i = new ListItem(seminar.Name, seminar.ID.ToString()); ddParentSeminar.Items.Add(i); } // Bind the seminar ID to the drop down box and clear the value if (defaultSeminarID != -1) { foreach (ListItem i in ddParentSeminar.Items) { i.Selected = i.Value == defaultSeminarID.ToString(); } defaultSeminarID = -1; } }
/// <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) { DojoSeminarManager m = new DojoSeminarManager(); DojoSeminarCollection dojoSeminarCollection = m.GetCollection(string.Empty, string.Empty, null); // Render Header Row this.headerLockEnabled = true; RenderRow(this.HeaderRowCssClass, ); bool rowflag = false; string rowCssClass; // // Render Records // foreach (DojoSeminar dojoSeminar in dojoSeminarCollection) { if (rowflag) { rowCssClass = defaultRowCssClass; } else { rowCssClass = alternateRowCssClass; } rowflag = !rowflag; output.WriteBeginTag("tr"); output.WriteAttribute("i", dojoSeminar.ID.ToString()); output.WriteLine(HtmlTextWriter.TagRightChar); output.Indent++; output.Indent--; output.WriteEndTag("tr"); output.WriteLine(); } }
protected void renderStackedGrid(HtmlTextWriter output, DojoSeminarCollection seminars) { bool rowflag = false; string rowCssClass; // // Render Records // foreach (DojoSeminar seminar in seminars) { if (seminar.iD == selectedID) { rowCssClass = this.selectedRowCssClass; } else if (rowflag) { rowCssClass = this.defaultRowCssClass; } else { rowCssClass = this.alternateRowCssClass; } rowflag = !rowflag; output.WriteFullBeginTag("tr"); output.WriteLine(); output.Indent++; // // Render Main Representation of Record // output.WriteBeginTag("td"); output.WriteAttribute("valign", "top"); if (rowCssClass != string.Empty) { output.WriteAttribute("class", rowCssClass); } output.Write(HtmlTextWriter.TagRightChar); if (selectEnabled) { output.WriteBeginTag("a"); if (overrideSelectUrl & seminar.DetailsOverrideUrl != "") { output.WriteAttribute("href", Page.ResolveUrl(seminar.DetailsOverrideUrl)); } else if (selectUrlFormat != string.Empty) { output.WriteAttribute("href", Page.ResolveUrl(string.Format(selectUrlFormat, seminar.ID))); } else { output.WriteAttribute("href", "javascript:" + GetSelectReference(seminar.ID)); } output.Write(HtmlTextWriter.TagRightChar); output.Write(seminar.Name); output.WriteEndTag("a"); } else { output.Write(seminar.Name); } output.Write("<br>"); // Intelligently Output Dates if (seminar.StartDate.Date == seminar.EndDate.Date) { output.Write(seminar.StartDate.ToLongDateString()); } else { output.Write(seminar.StartDate.ToLongDateString()); output.Write(" - "); output.Write(seminar.EndDate.ToLongDateString()); } output.Write("<br>"); output.Write(seminar.Description); if (registrationEnabled && seminar.registrationEnabled) { output.Write("<br>"); output.WriteBeginTag("a"); if (registerUrlFormat != string.Empty) { output.WriteAttribute("href", Page.ResolveUrl(string.Format(registerUrlFormat, seminar.ID))); } else { output.WriteAttribute("href", "javascript:" + Page.ClientScript.GetPostBackEventReference(this, "reg_" + seminar.ID)); } output.Write(HtmlTextWriter.TagRightChar); output.Write("register online"); output.WriteEndTag("a"); } output.WriteEndTag("td"); output.WriteLine(); // // Render PDF Link and Registration Link // output.WriteBeginTag("td"); if (rowCssClass != string.Empty) { output.WriteAttribute("class", rowCssClass); } output.WriteAttribute("valign", "top"); output.WriteAttribute("align", "right"); output.Write(HtmlTextWriter.TagRightChar); if (seminar.pdfUrl == string.Empty) { output.WriteBeginTag("img"); output.WriteAttribute("src", Page.ResolveUrl(pdfLinkDisabledIconUrl)); output.WriteAttribute("border", "0"); output.Write(HtmlTextWriter.SelfClosingTagEnd); } else { output.WriteBeginTag("a"); output.WriteAttribute("href", Page.ResolveUrl(seminar.pdfUrl)); output.Write(HtmlTextWriter.TagRightChar); output.WriteBeginTag("img"); output.WriteAttribute("src", Page.ResolveUrl(pdfLinkActiveIconUrl)); output.WriteAttribute("border", "0"); output.WriteAttribute("alt", "Download PDF"); output.Write(HtmlTextWriter.SelfClosingTagEnd); output.WriteEndTag("a"); } output.WriteEndTag("td"); output.WriteLine(); output.Indent--; output.WriteEndTag("tr"); output.WriteLine(); } }
protected void renderDefaultGrid(HtmlTextWriter output, DojoSeminarCollection seminars) { bool rowflag = false; string rowCssClass; DateTime currentMonth = DateTime.MinValue; DateTime lastMonth = DateTime.MinValue; // // Render Records // foreach (DojoSeminar seminar in seminars) { // if(seminar.StartDate <= DateTime.MinValue) // seminar.StartDate = DateTime.Parse("1/1/1980"); // // lastMonth = currentMonth; // currentMonth = DateManipulator.FirstOfMonth(seminar.StartDate).Date; // if(lastMonth != currentMonth) // { // output.WriteFullBeginTag("tr"); // output.WriteBeginTag("td"); // output.WriteAttribute("class", indexRowCssClass); //// output.WriteAttribute("colspan", "1"); // output.Write(HtmlTextWriter.TagRightChar); // output.Write(currentMonth.ToString("MMMM yyyy")); // output.WriteEndTag("td"); // output.WriteEndTag("tr"); // } if (rowflag) { rowCssClass = this.defaultRowCssClass; } else { rowCssClass = this.alternateRowCssClass; } rowflag = !rowflag; output.WriteBeginTag("tr"); output.WriteAttribute("i", seminar.ID.ToString()); // Tooltip Properties // output.WriteAttribute("onmouseover", // Amns.GreyFox.Web.UI.WebControls.ControlExtender.GetTooltipStartReference("Seminar ID: " + seminar.ID.ToString(),"#ffffe0", 0)); // output.WriteAttribute("onmouseout", Amns.GreyFox.Web.UI.WebControls.ControlExtender.GetTooltipEndReference()); output.WriteLine(HtmlTextWriter.TagRightChar); output.Indent++; // // Render Main Representation of Record // output.WriteBeginTag("td"); output.WriteAttribute("valign", "top"); output.WriteAttribute("class", rowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write("<strong>"); output.Write(seminar.Name); output.Write("</strong>"); output.Write("<br>"); output.Write(seminar.Location.BusinessName); output.WriteEndTag("td"); output.WriteLine(); // // Render Seminar Dates // output.WriteBeginTag("td"); output.WriteAttribute("class", rowCssClass); output.WriteAttribute("valign", "top"); output.Write(HtmlTextWriter.TagRightChar); output.Write(seminar.ConstructDateLongString()); output.WriteEndTag("td"); output.WriteLine(); output.Indent--; output.WriteEndTag("tr"); output.WriteLine(); } }
public void LoadDefaults() { DojoAccessControlGroupCollection accessControls; DojoAttendanceEntryCollection attendanceEntries; DojoBulkAttendanceEntryCollection bulkAttendances; DojoClassCollection classes; DojoClassDefinitionCollection classDefinitions; DojoMemberCollection members; DojoMembershipCollection memberships; DojoMembershipTemplateCollection membershipTemplates; DojoMemberTypeCollection memberTypes; DojoMemberTypeTemplateCollection memberTypeTemplates; DojoOrganizationCollection organizations; DojoPromotionCollection promotions; DojoPromotionFlagCollection promotionFlags; DojoPromotionStatusCollection promotionStatuses; DojoRankCollection ranks; DojoTestCollection tests; DojoTestListCollection testLists; DojoTestListJournalEntryCollection testListJournalEntries; DojoTestListJournalEntryTypeCollection testListJournalEntryTypes; DojoTestListStatusCollection testListStatuses; DojoSeminarCollection seminars; DojoSeminarOptionCollection seminarOptions; DojoSeminarRegistrationCollection seminarRegistrations; DojoSeminarRegistrationOptionCollection seminarRegistrationOptions; GreyFoxContactCollection locations; accessControls = new DojoAccessControlGroupCollection(); attendanceEntries = new DojoAttendanceEntryCollection(); bulkAttendances = new DojoBulkAttendanceEntryCollection(); classes = new DojoClassCollection(); classDefinitions = new DojoClassDefinitionCollection(); members = new DojoMemberCollection(); memberships = new DojoMembershipCollection(); membershipTemplates = new DojoMembershipTemplateCollection(); memberTypes = new DojoMemberTypeCollection(); memberTypeTemplates = new DojoMemberTypeTemplateCollection(); organizations = new DojoOrganizationCollection(); promotions = new DojoPromotionCollection(); promotionFlags = new DojoPromotionFlagCollection(); promotionStatuses = new DojoPromotionStatusCollection(); ranks = new DojoRankCollection(); tests = new DojoTestCollection(); testLists = new DojoTestListCollection(); testListJournalEntries = new DojoTestListJournalEntryCollection(); testListJournalEntryTypes = new DojoTestListJournalEntryTypeCollection(); testListStatuses = new DojoTestListStatusCollection(); seminars = new DojoSeminarCollection(); seminarOptions = new DojoSeminarOptionCollection(); seminarRegistrations = new DojoSeminarRegistrationCollection(); seminarRegistrationOptions = new DojoSeminarRegistrationOptionCollection(); locations = new GreyFoxContactCollection(); organizations = new DojoOrganizationManager().GetCollection(string.Empty, string.Empty, null); memberTypes = new DojoMemberTypeManager().GetCollection(string.Empty, string.Empty); memberTypeTemplates = new DojoMemberTypeTemplateManager().GetCollection(string.Empty, string.Empty, null); ranks = new DojoRankManager().GetCollection(string.Empty, string.Empty, null); membershipTemplates = new DojoMembershipTemplateManager().GetCollection(string.Empty, string.Empty, null); Dictionary <string, DojoMemberType> memberTypesDictionary = new Dictionary <string, DojoMemberType>(); foreach (DojoMemberType memberType in memberTypes) { memberTypesDictionary.Add(memberType.Name, memberType); } Dictionary <string, DojoMemberTypeTemplate> memberTypeTemplatesDictionary = new Dictionary <string, DojoMemberTypeTemplate>(); foreach (DojoMemberTypeTemplate typeTemplate in memberTypeTemplates) { memberTypeTemplatesDictionary.Add(typeTemplate.Name, typeTemplate); } Dictionary <string, DojoRank> ranksDictionary = new Dictionary <string, DojoRank>(); foreach (DojoRank rank in ranks) { ranksDictionary.Add(rank.Name, rank); } Dictionary <string, DojoMembershipTemplate> membershipTemplatesDictionary = new Dictionary <string, DojoMembershipTemplate>(); foreach (DojoMembershipTemplate template in membershipTemplates) { membershipTemplatesDictionary.Add(template.Name, template); } CsvParser.CsvStream csv = CsvParser.StreamParse(Localization.Defaults.Defaults_en_US, false); string rowType; string[] r = csv.GetNextRow(); while (r != null) { rowType = r[0]; if (rowType == Localization.Defaults.CSVMembershipTemplate) { DojoMembershipTemplate template = TessenFactory.MembershipTemplate( r[1], r[2], bool.Parse(r[3]), bool.Parse(r[4]), bool.Parse(r[5]), decimal.Parse(r[6]), decimal.Parse(r[7]), (DojoMembershipDayType)Enum.Parse(typeof(DojoMembershipDayType), r[8]), (DojoMembershipDayType)Enum.Parse(typeof(DojoMembershipDayType), r[9]), DojoOrganization.NewPlaceHolder(0), 1, int.Parse(r[11]), int.Parse(r[12]), decimal.Parse(r[13]), (DojoMembershipDayType)Enum.Parse(typeof(DojoMembershipDayType), r[14]), int.Parse(r[15]), int.Parse(r[16]), decimal.Parse(r[17]), (DojoMembershipDayType)Enum.Parse(typeof(DojoMembershipDayType), r[18]), int.Parse(r[19]), int.Parse(r[20]), decimal.Parse(r[21]), (DojoMembershipDayType)Enum.Parse(typeof(DojoMembershipDayType), r[22]), int.Parse(r[23]), int.Parse(r[24]), int.Parse(r[25]), int.Parse(r[26]), ranksDictionary.ContainsKey(r[27]) ? ranksDictionary[r[27]] : null, ranksDictionary.ContainsKey(r[28]) ? ranksDictionary[r[28]] : null); membershipTemplates.Add(template); membershipTemplatesDictionary.Add(template.Name, template); template.Save(); } else if (rowType == Localization.Defaults.CSVMemberTypeTemplate) { DojoMemberTypeTemplate template = TessenFactory.MemberTypeTemplate( r[1], r[2], memberTypeTemplatesDictionary.ContainsKey(r[3].ToString()) ? memberTypeTemplatesDictionary[r[3]] : null, memberTypesDictionary.ContainsKey(r[4]) ? memberTypesDictionary[r[4]] : null, bool.Parse(r[5]), bool.Parse(r[6]), bool.Parse(r[7]), bool.Parse(r[8]), int.Parse(r[9]), int.Parse(r[10]), int.Parse(r[11]), int.Parse(r[12]), ranksDictionary.ContainsKey(r[13]) ? ranksDictionary[r[13]] : null, ranksDictionary.ContainsKey(r[14]) ? ranksDictionary[r[14]] : null, membershipTemplatesDictionary.ContainsKey(r[15]) ? membershipTemplatesDictionary[r[15]] : null, membershipTemplatesDictionary.ContainsKey(r[16]) ? membershipTemplatesDictionary[r[16]] : null, membershipTemplatesDictionary.ContainsKey(r[17]) ? membershipTemplatesDictionary[r[17]] : null, membershipTemplatesDictionary.ContainsKey(r[18]) ? membershipTemplatesDictionary[r[18]] : null, membershipTemplatesDictionary.ContainsKey(r[19]) ? membershipTemplatesDictionary[r[19]] : null); memberTypeTemplates.Add(template); memberTypeTemplatesDictionary.Add(template.Name, template); template.Save(); } r = csv.GetNextRow(); } }
private void bind() { #region Bind Default Child Data DojoMemberManager instructorManager = new DojoMemberManager(); DojoMemberCollection instructorCollection = instructorManager.GetCollection(string.Empty, string.Empty, null); ComponentArt.Web.UI.ComboBoxItem InstructorNullItem = new ComponentArt.Web.UI.ComboBoxItem(); InstructorNullItem.Text = "Null"; InstructorNullItem.Value = "Null"; comboInstructor.Items.Add(InstructorNullItem); foreach (DojoMember instructor in instructorCollection) { ComponentArt.Web.UI.ComboBoxItem i = new ComponentArt.Web.UI.ComboBoxItem(); i.Text = instructor.ToString(); i.Value = instructor.ID.ToString(); comboInstructor.Items.Add(i); } DojoSeminarManager parentSeminarManager = new DojoSeminarManager(); DojoSeminarCollection parentSeminarCollection = parentSeminarManager.GetCollection(string.Empty, string.Empty, null); ComponentArt.Web.UI.ComboBoxItem ParentSeminarNullItem = new ComponentArt.Web.UI.ComboBoxItem(); ParentSeminarNullItem.Text = "Null"; ParentSeminarNullItem.Value = "Null"; comboParentSeminar.Items.Add(ParentSeminarNullItem); foreach (DojoSeminar parentSeminar in parentSeminarCollection) { ComponentArt.Web.UI.ComboBoxItem i = new ComponentArt.Web.UI.ComboBoxItem(); i.Text = parentSeminar.ToString(); i.Value = parentSeminar.ID.ToString(); comboParentSeminar.Items.Add(i); } DojoClassDefinitionManager parentDefinitionManager = new DojoClassDefinitionManager(); DojoClassDefinitionCollection parentDefinitionCollection = parentDefinitionManager.GetCollection(string.Empty, string.Empty, null); ComponentArt.Web.UI.ComboBoxItem ParentDefinitionNullItem = new ComponentArt.Web.UI.ComboBoxItem(); ParentDefinitionNullItem.Text = "Null"; ParentDefinitionNullItem.Value = "Null"; comboParentDefinition.Items.Add(ParentDefinitionNullItem); foreach (DojoClassDefinition parentDefinition in parentDefinitionCollection) { ComponentArt.Web.UI.ComboBoxItem i = new ComponentArt.Web.UI.ComboBoxItem(); i.Text = parentDefinition.ToString(); i.Value = parentDefinition.ID.ToString(); comboParentDefinition.Items.Add(i); } GreyFoxContactManager locationManager = new GreyFoxContactManager("kitTessen_Locations"); GreyFoxContactCollection locationCollection = locationManager.GetCollection(string.Empty, string.Empty); ComponentArt.Web.UI.ComboBoxItem LocationNullItem = new ComponentArt.Web.UI.ComboBoxItem(); LocationNullItem.Text = "Null"; LocationNullItem.Value = "Null"; comboLocation.Items.Add(LocationNullItem); foreach (GreyFoxContact location in locationCollection) { ComponentArt.Web.UI.ComboBoxItem i = new ComponentArt.Web.UI.ComboBoxItem(); i.Text = location.ToString(); i.Value = location.ID.ToString(); comboLocation.Items.Add(i); } DojoAccessControlGroupManager accessControlGroupManager = new DojoAccessControlGroupManager(); DojoAccessControlGroupCollection accessControlGroupCollection = accessControlGroupManager.GetCollection(string.Empty, string.Empty, null); ComponentArt.Web.UI.ComboBoxItem AccessControlGroupNullItem = new ComponentArt.Web.UI.ComboBoxItem(); AccessControlGroupNullItem.Text = "Null"; AccessControlGroupNullItem.Value = "Null"; comboAccessControlGroup.Items.Add(AccessControlGroupNullItem); foreach (DojoAccessControlGroup accessControlGroup in accessControlGroupCollection) { ComponentArt.Web.UI.ComboBoxItem i = new ComponentArt.Web.UI.ComboBoxItem(); i.Text = accessControlGroup.ToString(); i.Value = accessControlGroup.ID.ToString(); comboAccessControlGroup.Items.Add(i); } #endregion }