Ejemplo n.º 1
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)
        {
            DojoMembershipTemplateManager    m = new DojoMembershipTemplateManager();
            DojoMembershipTemplateCollection dojoMembershipTemplateCollection = m.GetCollection(string.Empty, string.Empty, null);

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

            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DojoMembershipTemplate dojoMembershipTemplate in dojoMembershipTemplateCollection)
            {
                if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", dojoMembershipTemplate.ID.ToString());
                output.WriteLine(HtmlTextWriter.TagRightChar);
                output.Indent++;
                output.WriteBeginTag("td");
                output.WriteAttribute("class", rowCssClass);
                output.Write(HtmlTextWriter.TagRightChar);
                output.WriteLine(dojoMembershipTemplate.Name);
                output.WriteEndTag("td");
                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }
Ejemplo n.º 2
0
        getMembershipTemplates(DojoMember member,
                               DojoMemberTypeTemplate template)
        {
            DojoMembershipTemplateCollection templates
                = new DojoMembershipTemplateCollection();

            if (member != null && template != null)
            {
                if (filterCheck(member, template.MembershipTemplate1))
                {
                    templates.Add(template.MembershipTemplate1);
                }

                if (filterCheck(member, template.MembershipTemplate2))
                {
                    templates.Add(template.MembershipTemplate2);
                }

                if (filterCheck(member, template.MembershipTemplate3))
                {
                    templates.Add(template.MembershipTemplate3);
                }

                if (filterCheck(member, template.MembershipTemplate4))
                {
                    templates.Add(template.MembershipTemplate4);
                }

                if (filterCheck(member, template.MembershipTemplate5))
                {
                    templates.Add(template.MembershipTemplate5);
                }
            }

            return(templates);
        }
Ejemplo n.º 3
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();
            }
        }
        private void bindDropDownLists()
        {
            #region Bind General Child Data

            msParentTemplate.Items.Add(new ListItem("Null", "Null"));
            DojoMembershipTemplateManager    parentTemplateManager    = new DojoMembershipTemplateManager();
            DojoMembershipTemplateCollection parentTemplateCollection = parentTemplateManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMembershipTemplate parentTemplate in parentTemplateCollection)
            {
                ListItem i = new ListItem(parentTemplate.ToString(), parentTemplate.ID.ToString());
                msParentTemplate.Items.Add(i);
            }

            #endregion

            #region Bind Member Types Child Data

            msMemberType1.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberType1Manager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberType1Collection = memberType1Manager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType1 in memberType1Collection)
            {
                ListItem i = new ListItem(memberType1.ToString(), memberType1.ID.ToString());
                msMemberType1.Items.Add(i);
            }

            msMemberType2.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberType2Manager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberType2Collection = memberType2Manager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType2 in memberType2Collection)
            {
                ListItem i = new ListItem(memberType2.ToString(), memberType2.ID.ToString());
                msMemberType2.Items.Add(i);
            }

            msMemberType3.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberType3Manager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberType3Collection = memberType3Manager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType3 in memberType3Collection)
            {
                ListItem i = new ListItem(memberType3.ToString(), memberType3.ID.ToString());
                msMemberType3.Items.Add(i);
            }

            msMemberType4.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberType4Manager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberType4Collection = memberType4Manager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType4 in memberType4Collection)
            {
                ListItem i = new ListItem(memberType4.ToString(), memberType4.ID.ToString());
                msMemberType4.Items.Add(i);
            }

            msMemberType5.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberType5Manager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberType5Collection = memberType5Manager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType5 in memberType5Collection)
            {
                ListItem i = new ListItem(memberType5.ToString(), memberType5.ID.ToString());
                msMemberType5.Items.Add(i);
            }

            msMemberType6.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberType6Manager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberType6Collection = memberType6Manager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType6 in memberType6Collection)
            {
                ListItem i = new ListItem(memberType6.ToString(), memberType6.ID.ToString());
                msMemberType6.Items.Add(i);
            }

            msMemberType7.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberType7Manager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberType7Collection = memberType7Manager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType7 in memberType7Collection)
            {
                ListItem i = new ListItem(memberType7.ToString(), memberType7.ID.ToString());
                msMemberType7.Items.Add(i);
            }

            msMemberType8.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberType8Manager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberType8Collection = memberType8Manager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType8 in memberType8Collection)
            {
                ListItem i = new ListItem(memberType8.ToString(), memberType8.ID.ToString());
                msMemberType8.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
        }
Ejemplo n.º 5
0
        private void bind()
        {
            DojoMemberManager    dojoMemberManager    = new DojoMemberManager();
            DojoMemberCollection dojoMemberCollection = dojoMemberManager.GetCollection(string.Empty, string.Empty);

            foreach (DojoMember itemObject in dojoMemberCollection)
            {
                ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem();
                item.Text  = itemObject.ToString();
                item.Value = itemObject.ID.ToString();
                comboMember.Items.Add(item);
            }


            DojoOrganizationManager    dojoOrganizationManager    = new DojoOrganizationManager();
            DojoOrganizationCollection dojoOrganizationCollection = dojoOrganizationManager.GetCollection(string.Empty, string.Empty);

            foreach (DojoOrganization itemObject in dojoOrganizationCollection)
            {
                ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem();
                item.Text  = itemObject.ToString();
                item.Value = itemObject.ID.ToString();
                comboOrganization.Items.Add(item);
            }


            DojoMembershipManager    dojoMembershipManager    = new DojoMembershipManager();
            DojoMembershipCollection dojoMembershipCollection = dojoMembershipManager.GetCollection(string.Empty, string.Empty);

            ddParent.Items.Add(new ListItem("             ", "null"));
            foreach (DojoMembership itemObject in dojoMembershipCollection)
            {
                ddParent.Items.Add(new ListItem(itemObject.ToString(), itemObject.ID.ToString()));
            }


            DojoMemberTypeTemplateManager    dojoMemberTypeTemplateManager    = new DojoMemberTypeTemplateManager();
            DojoMemberTypeTemplateCollection dojoMemberTypeTemplateCollection = dojoMemberTypeTemplateManager.GetCollection(string.Empty, string.Empty);

            foreach (DojoMemberTypeTemplate itemObject in dojoMemberTypeTemplateCollection)
            {
                ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem();
                item.Text  = itemObject.ToString();
                item.Value = itemObject.ID.ToString();
                comboMemberTypeTemplate.Items.Add(item);
            }


            DojoMembershipTemplateManager    dojoMembershipTemplateManager    = new DojoMembershipTemplateManager();
            DojoMembershipTemplateCollection dojoMembershipTemplateCollection = dojoMembershipTemplateManager.GetCollection(string.Empty, string.Empty);

            foreach (DojoMembershipTemplate itemObject in dojoMembershipTemplateCollection)
            {
                ComponentArt.Web.UI.ComboBoxItem item = new ComponentArt.Web.UI.ComboBoxItem();
                item.Text  = itemObject.ToString();
                item.Value = itemObject.ID.ToString();
                comboMembershipTemplate.Items.Add(item);
            }



            RHInvoiceLineManager    rHInvoiceLineManager    = new RHInvoiceLineManager();
            RHInvoiceLineCollection rHInvoiceLineCollection = rHInvoiceLineManager.GetCollection(string.Empty, string.Empty);

            ddInvoiceLine.Items.Add(new ListItem("             ", "null"));
            foreach (RHInvoiceLine itemObject in rHInvoiceLineCollection)
            {
                ddInvoiceLine.Items.Add(new ListItem(itemObject.ToString(), itemObject.ID.ToString()));
            }
        }
Ejemplo n.º 6
0
        private void bindDropDownLists()
        {
            #region Bind Default Child Data

            msMember.Items.Add(new ListItem("Null", "Null"));
            DojoMemberManager    memberManager    = new DojoMemberManager();
            DojoMemberCollection memberCollection = memberManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMember member in memberCollection)
            {
                ListItem i = new ListItem(member.ToString(), member.ID.ToString());
                msMember.Items.Add(i);
            }

            msMemberType.Items.Add(new ListItem("Null", "Null"));
            DojoMemberTypeManager    memberTypeManager    = new DojoMemberTypeManager();
            DojoMemberTypeCollection memberTypeCollection = memberTypeManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMemberType memberType in memberTypeCollection)
            {
                ListItem i = new ListItem(memberType.ToString(), memberType.ID.ToString());
                msMemberType.Items.Add(i);
            }

            msOrganization.Items.Add(new ListItem("Null", "Null"));
            DojoOrganizationManager    organizationManager    = new DojoOrganizationManager();
            DojoOrganizationCollection organizationCollection = organizationManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoOrganization organization in organizationCollection)
            {
                ListItem i = new ListItem(organization.ToString(), organization.ID.ToString());
                msOrganization.Items.Add(i);
            }

            msParentMembership.Items.Add(new ListItem("Null", "Null"));
            DojoMembershipManager    parentMembershipManager    = new DojoMembershipManager();
            DojoMembershipCollection parentMembershipCollection = parentMembershipManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMembership parentMembership in parentMembershipCollection)
            {
                ListItem i = new ListItem(parentMembership.ToString(), parentMembership.ID.ToString());
                msParentMembership.Items.Add(i);
            }

            msSourceTemplate.Items.Add(new ListItem("Null", "Null"));
            DojoMembershipTemplateManager    sourceTemplateManager    = new DojoMembershipTemplateManager();
            DojoMembershipTemplateCollection sourceTemplateCollection = sourceTemplateManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMembershipTemplate sourceTemplate in sourceTemplateCollection)
            {
                ListItem i = new ListItem(sourceTemplate.ToString(), sourceTemplate.ID.ToString());
                msSourceTemplate.Items.Add(i);
            }

            #endregion

            #region Bind Rappahanock Child Data

            msInvoiceLine.Items.Add(new ListItem("Null", "Null"));
            RHInvoiceLineManager    invoiceLineManager    = new RHInvoiceLineManager();
            RHInvoiceLineCollection invoiceLineCollection = invoiceLineManager.GetCollection(string.Empty, string.Empty, null);
            foreach (RHInvoiceLine invoiceLine in invoiceLineCollection)
            {
                ListItem i = new ListItem(invoiceLine.ToString(), invoiceLine.ID.ToString());
                msInvoiceLine.Items.Add(i);
            }

            #endregion
        }