Example #1
0
        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
        }
Example #2
0
        private void bind()
        {
            #region Bind Default Child Data

            string[] classUnitTypeNames;
            byte[]   classUnitTypeValues;

            msOptions.Items.Clear();
            DojoSeminarOptionManager optionsManager =
                new DojoSeminarOptionManager();
            DojoSeminarOptionCollection optionsCollection =
                optionsManager.GetCollection(string.Empty, string.Empty);
            foreach (DojoSeminarOption options in optionsCollection)
            {
                ListItem i = new ListItem(options.Name +
                                          " (" + options.Fee.ToString("c") + ")", options.ID.ToString());
                msOptions.Items.Add(i);
            }

            GreyFoxContactManager locationManager =
                new GreyFoxContactManager("kitTessen_Locations");
            GreyFoxContactCollection locationCollection =
                locationManager.GetCollection(string.Empty, string.Empty);
            foreach (GreyFoxContact location in locationCollection)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Text  = location.BusinessName;
                item.Value = location.ID.ToString();
                comboLocation.Items.Add(item);
            }

            RHItemManager    rhim    = new RHItemManager();
            RHItemCollection rhItems =
                rhim.GetCollection(string.Empty, string.Empty, null);
            foreach (RHItem rhItem in rhItems)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Text  = rhItem.Name;
                item.Value = rhItem.ID.ToString();
                comboRappahanockItem.Items.Add(item);
            }

            //
            // Bind Class Unit Types
            //
            ddClassUnitType.Items.Clear();
            classUnitTypeNames  = Enum.GetNames(typeof(DojoSeminarClassUnitType));
            classUnitTypeValues = (byte[])Enum.GetValues(typeof(DojoSeminarClassUnitType));
            for (int i = 0; i <= classUnitTypeNames.GetUpperBound(0); i++)
            {
                ddClassUnitType.Items.Add(new ListItem(
                                              classUnitTypeNames[i],
                                              classUnitTypeValues[i].ToString()));
            }

            #endregion
        }
        public DojoSeminarOptionCollection Clone()
        {
            DojoSeminarOptionCollection clonedDojoSeminarOption = new DojoSeminarOptionCollection(count);

            lock (this)
            {
                foreach (DojoSeminarOption item in this)
                {
                    clonedDojoSeminarOption.Add(item);
                }
            }
            return(clonedDojoSeminarOption);
        }
Example #4
0
		/// <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)
		{
			DojoSeminarOptionManager m = new DojoSeminarOptionManager();
			DojoSeminarOptionCollection dojoSeminarOptionCollection = m.GetCollection(string.Empty, string.Empty, null);
			// Render Header Row
			this.headerLockEnabled = true;
			RenderRow(this.HeaderRowCssClass, "Name", "Description", "Fee");

			bool rowflag = false;
			string rowCssClass;
			//
			// Render Records
			//
			foreach(DojoSeminarOption dojoSeminarOption in dojoSeminarOptionCollection)
			{
				if(rowflag) rowCssClass = defaultRowCssClass;
				else rowCssClass = alternateRowCssClass;
				rowflag = !rowflag;
				output.WriteBeginTag("tr");
				output.WriteAttribute("i", dojoSeminarOption.ID.ToString());
				output.WriteLine(HtmlTextWriter.TagRightChar);
				output.Indent++;
				output.WriteBeginTag("td");
				output.WriteAttribute("class", rowCssClass);
				output.WriteAttribute("valign", "top");
				output.WriteAttribute("style", "font-weight:bold;");
				output.Write(HtmlTextWriter.TagRightChar);
				output.Write(dojoSeminarOption.Name);
				output.WriteEndTag("td");
				output.WriteBeginTag("td");
				output.WriteAttribute("class", rowCssClass);
				output.WriteAttribute("valign", "top");
				output.Write(HtmlTextWriter.TagRightChar);
				output.Write(dojoSeminarOption.Description);
				output.WriteEndTag("td");
				output.WriteBeginTag("td");
				output.WriteAttribute("class", rowCssClass);
				output.Write(HtmlTextWriter.TagRightChar);
				output.Write(dojoSeminarOption.Fee.ToString("c"));
				output.WriteEndTag("td");
				output.Indent--;
				output.WriteEndTag("tr");
				output.WriteLine();
			}
		}
Example #5
0
        private void bindDropDownLists()
        {
            #region Bind General 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 Registration Child Data

            msOptions.Items.Add(new ListItem("Null", "Null"));
            DojoSeminarOptionManager    optionsManager    = new DojoSeminarOptionManager();
            DojoSeminarOptionCollection optionsCollection = optionsManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoSeminarOption options in optionsCollection)
            {
                ListItem i = new ListItem(options.ToString(), options.ID.ToString());
                msOptions.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
        }
Example #6
0
        /// <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)
        {
            DojoSeminarOptionManager    m = new DojoSeminarOptionManager();
            DojoSeminarOptionCollection dojoSeminarOptionCollection = m.GetCollection(string.Empty, string.Empty, null);

            // Render Header Row
            this.headerLockEnabled = true;
            RenderRow(this.HeaderRowCssClass, );

            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DojoSeminarOption dojoSeminarOption in dojoSeminarOptionCollection)
            {
                if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", dojoSeminarOption.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
        }
Example #8
0
        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();
            }
        }