private void bindDropDownLists() { #region Bind General Child Data msTest.Items.Add(new ListItem("Null", "Null")); DojoTestManager testManager = new DojoTestManager(); DojoTestCollection testCollection = testManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoTest test in testCollection) { ListItem i = new ListItem(test.ToString(), test.ID.ToString()); msTest.Items.Add(i); } msStatus.Items.Add(new ListItem("Null", "Null")); DojoTestListStatusManager statusManager = new DojoTestListStatusManager(); DojoTestListStatusCollection statusCollection = statusManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoTestListStatus status in statusCollection) { ListItem i = new ListItem(status.ToString(), status.ID.ToString()); msStatus.Items.Add(i); } msEditor.Items.Add(new ListItem("Null", "Null")); DojoMemberManager editorManager = new DojoMemberManager(); DojoMemberCollection editorCollection = editorManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMember editor in editorCollection) { ListItem i = new ListItem(editor.ToString(), editor.ID.ToString()); msEditor.Items.Add(i); } #endregion }
/// <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) { DojoTestListStatusManager m = new DojoTestListStatusManager(); DojoTestListStatusCollection dojoTestListStatusCollection = m.GetCollection(string.Empty, string.Empty, null); // Render Header Row this.headerLockEnabled = true; RenderRow(this.HeaderRowCssClass, "Status", "Description", "Teacher Editing"); bool rowflag = false; string rowCssClass; // // Render Records // foreach (DojoTestListStatus dojoTestListStatus in dojoTestListStatusCollection) { if (rowflag) { rowCssClass = defaultRowCssClass; } else { rowCssClass = alternateRowCssClass; } rowflag = !rowflag; output.WriteBeginTag("tr"); output.WriteAttribute("i", dojoTestListStatus.ID.ToString()); output.WriteLine(HtmlTextWriter.TagRightChar); output.Indent++; output.WriteBeginTag("td"); output.WriteAttribute("class", rowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write(dojoTestListStatus.Name); output.WriteEndTag("td"); output.WriteLine(); output.WriteBeginTag("td"); output.WriteAttribute("class", rowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write(dojoTestListStatus.Description); output.WriteEndTag("td"); output.WriteLine(); output.WriteBeginTag("td"); output.WriteAttribute("class", rowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write(dojoTestListStatus.TeacherEditingEnabled.ToString()); output.WriteEndTag("td"); output.WriteLine(); output.Indent--; output.WriteEndTag("tr"); output.WriteLine(); } }
private void bindDropDownLists() { #region Bind Status Changes Child Data msOnFinalized.Items.Add(new ListItem("Null", "Null")); DojoTestListStatusManager onFinalizedManager = new DojoTestListStatusManager(); DojoTestListStatusCollection onFinalizedCollection = onFinalizedManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoTestListStatus onFinalized in onFinalizedCollection) { ListItem i = new ListItem(onFinalized.ToString(), onFinalized.ID.ToString()); msOnFinalized.Items.Add(i); } msOnCompleted.Items.Add(new ListItem("Null", "Null")); DojoTestListStatusManager onCompletedManager = new DojoTestListStatusManager(); DojoTestListStatusCollection onCompletedCollection = onCompletedManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoTestListStatus onCompleted in onCompletedCollection) { ListItem i = new ListItem(onCompleted.ToString(), onCompleted.ID.ToString()); msOnCompleted.Items.Add(i); } #endregion }
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() { GreyFoxContactManager locationManager = new GreyFoxContactManager("kitTessen_Locations"); GreyFoxContactCollection locationCollection = locationManager.GetCollection(string.Empty, string.Empty); foreach (GreyFoxContact itemObject in locationCollection) { ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem(); item.Text = itemObject.BusinessName; item.Value = itemObject.ID.ToString(); comboLocation.Items.Add(item); } DojoMemberTypeManager dojoMemberTypeManager = new DojoMemberTypeManager(); DojoMemberTypeCollection dojoMemberTypeCollection = dojoMemberTypeManager.GetCollection(string.Empty, string.Empty); foreach (DojoMemberType itemObject in dojoMemberTypeCollection) { ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem(); item.Text = itemObject.Name; item.Value = itemObject.ID.ToString(); comboListMemberType1.Items.Add(item); } foreach (DojoMemberType itemObject in dojoMemberTypeCollection) { ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem(); item.Text = itemObject.Name; item.Value = itemObject.ID.ToString(); comboListMemberType2.Items.Add(item); } foreach (DojoMemberType itemObject in dojoMemberTypeCollection) { ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem(); item.Text = itemObject.Name; item.Value = itemObject.ID.ToString(); comboListMemberType3.Items.Add(item); } DojoMemberManager dojoMemberManager = new DojoMemberManager(); DojoMemberCollection dojoMemberCollection = dojoMemberManager.GetCollection( "UserAccountID IS NOT NULL", string.Empty); ddPanelChief.Items.Add(new ListItem(" ", "null")); foreach (DojoMember itemObject in dojoMemberCollection) { ddPanelChief.Items.Add(new ListItem(itemObject.ToString(), itemObject.ID.ToString())); } foreach (DojoMember itemObject in dojoMemberCollection) { ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem(); item.Text = itemObject.UserAccount.UserName; item.Value = itemObject.ID.ToString(); comboPanelMembers.Items.Add(item); } DojoTestListStatusManager dojoTestListStatusManager = new DojoTestListStatusManager(); DojoTestListStatusCollection dojoTestListStatusCollection = dojoTestListStatusManager.GetCollection(string.Empty, string.Empty); foreach (DojoTestListStatus itemObject in dojoTestListStatusCollection) { ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem(); item.Text = itemObject.ToString(); item.Value = itemObject.ID.ToString(); comboStatus.Items.Add(item); } DojoTestListManager dojoTestListManager = new DojoTestListManager(); DojoTestListCollection dojoTestListCollection = dojoTestListManager.GetCollection(string.Empty, string.Empty); ddActiveTestList.Items.Add(new ListItem(" ", "null")); foreach (DojoTestList itemObject in dojoTestListCollection) { ddActiveTestList.Items.Add(new ListItem(itemObject.ToString(), itemObject.ID.ToString())); } RHItemManager rHItemManager = new RHItemManager(); RHItemCollection rHItemCollection = rHItemManager.GetCollection(string.Empty, string.Empty); foreach (RHItem itemObject in rHItemCollection) { ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem(); item.Text = itemObject.ToString(); item.Value = itemObject.ID.ToString(); comboItem.Items.Add(item); } }
private void bindDropDownLists() { #region Bind Default Child Data 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); } #endregion #region Bind List Generator Child Data msListMemberType1.Items.Add(new ListItem("Null", "Null")); DojoMemberTypeManager listMemberType1Manager = new DojoMemberTypeManager(); DojoMemberTypeCollection listMemberType1Collection = listMemberType1Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMemberType listMemberType1 in listMemberType1Collection) { ListItem i = new ListItem(listMemberType1.ToString(), listMemberType1.ID.ToString()); msListMemberType1.Items.Add(i); } msListMemberType2.Items.Add(new ListItem("Null", "Null")); DojoMemberTypeManager listMemberType2Manager = new DojoMemberTypeManager(); DojoMemberTypeCollection listMemberType2Collection = listMemberType2Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMemberType listMemberType2 in listMemberType2Collection) { ListItem i = new ListItem(listMemberType2.ToString(), listMemberType2.ID.ToString()); msListMemberType2.Items.Add(i); } msListMemberType3.Items.Add(new ListItem("Null", "Null")); DojoMemberTypeManager listMemberType3Manager = new DojoMemberTypeManager(); DojoMemberTypeCollection listMemberType3Collection = listMemberType3Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMemberType listMemberType3 in listMemberType3Collection) { ListItem i = new ListItem(listMemberType3.ToString(), listMemberType3.ID.ToString()); msListMemberType3.Items.Add(i); } #endregion #region Bind Administration Child Data msPanelChief.Items.Add(new ListItem("Null", "Null")); DojoMemberManager panelChiefManager = new DojoMemberManager(); DojoMemberCollection panelChiefCollection = panelChiefManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMember panelChief in panelChiefCollection) { ListItem i = new ListItem(panelChief.ToString(), panelChief.ID.ToString()); msPanelChief.Items.Add(i); } msPanelMember1.Items.Add(new ListItem("Null", "Null")); DojoMemberManager panelMember1Manager = new DojoMemberManager(); DojoMemberCollection panelMember1Collection = panelMember1Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMember panelMember1 in panelMember1Collection) { ListItem i = new ListItem(panelMember1.ToString(), panelMember1.ID.ToString()); msPanelMember1.Items.Add(i); } msPanelMember2.Items.Add(new ListItem("Null", "Null")); DojoMemberManager panelMember2Manager = new DojoMemberManager(); DojoMemberCollection panelMember2Collection = panelMember2Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMember panelMember2 in panelMember2Collection) { ListItem i = new ListItem(panelMember2.ToString(), panelMember2.ID.ToString()); msPanelMember2.Items.Add(i); } msPanelMember3.Items.Add(new ListItem("Null", "Null")); DojoMemberManager panelMember3Manager = new DojoMemberManager(); DojoMemberCollection panelMember3Collection = panelMember3Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMember panelMember3 in panelMember3Collection) { ListItem i = new ListItem(panelMember3.ToString(), panelMember3.ID.ToString()); msPanelMember3.Items.Add(i); } msPanelMember4.Items.Add(new ListItem("Null", "Null")); DojoMemberManager panelMember4Manager = new DojoMemberManager(); DojoMemberCollection panelMember4Collection = panelMember4Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMember panelMember4 in panelMember4Collection) { ListItem i = new ListItem(panelMember4.ToString(), panelMember4.ID.ToString()); msPanelMember4.Items.Add(i); } msPanelMember5.Items.Add(new ListItem("Null", "Null")); DojoMemberManager panelMember5Manager = new DojoMemberManager(); DojoMemberCollection panelMember5Collection = panelMember5Manager.GetCollection(string.Empty, string.Empty, null); foreach (DojoMember panelMember5 in panelMember5Collection) { ListItem i = new ListItem(panelMember5.ToString(), panelMember5.ID.ToString()); msPanelMember5.Items.Add(i); } #endregion #region Bind System Child Data msStatus.Items.Add(new ListItem("Null", "Null")); DojoTestListStatusManager statusManager = new DojoTestListStatusManager(); DojoTestListStatusCollection statusCollection = statusManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoTestListStatus status in statusCollection) { ListItem i = new ListItem(status.ToString(), status.ID.ToString()); msStatus.Items.Add(i); } msActiveTestList.Items.Add(new ListItem("Null", "Null")); DojoTestListManager activeTestListManager = new DojoTestListManager(); DojoTestListCollection activeTestListCollection = activeTestListManager.GetCollection(string.Empty, string.Empty, null); foreach (DojoTestList activeTestList in activeTestListCollection) { ListItem i = new ListItem(activeTestList.ToString(), activeTestList.ID.ToString()); msActiveTestList.Items.Add(i); } #endregion #region Bind Rappahanock Child Data msItem.Items.Add(new ListItem("Null", "Null")); RHItemManager itemManager = new RHItemManager(); RHItemCollection itemCollection = itemManager.GetCollection(string.Empty, string.Empty, null); foreach (RHItem item in itemCollection) { ListItem i = new ListItem(item.ToString(), item.ID.ToString()); msItem.Items.Add(i); } #endregion }