Ejemplo n.º 1
0
        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
        }
Ejemplo n.º 2
0
        private void bind()
        {
            #region Bind Access Control Child Data

            DojoAccessControlGroupManager    accessControlGroupManager    = new DojoAccessControlGroupManager();
            DojoAccessControlGroupCollection accessControlGroupCollection = accessControlGroupManager.GetCollection(string.Empty, string.Empty, null);
            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

            #region Bind Next Class Child Data

            DojoMemberManager    instructorManager    = new DojoMemberManager();
            DojoMemberCollection instructorCollection =
                instructorManager.GetCollection("IsInstructor=true",
                                                "LastName, FirstName, MiddleName",
                                                DojoMemberFlags.PrivateContact);
            foreach (DojoMember instructor in instructorCollection)
            {
                ComponentArt.Web.UI.ComboBoxItem i = new ComponentArt.Web.UI.ComboBoxItem();
                i.Text  = instructor.PrivateContact.FullName;
                i.Value = instructor.ID.ToString();
                comboInstructor.Items.Add(i);
            }

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

            #endregion
        }
Ejemplo n.º 3
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)
        {
            DojoAccessControlGroupManager    m = new DojoAccessControlGroupManager();
            DojoAccessControlGroupCollection dojoAccessControlGroupCollection = m.GetCollection(string.Empty, string.Empty, null);

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

            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DojoAccessControlGroup dojoAccessControlGroup in dojoAccessControlGroupCollection)
            {
                if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", dojoAccessControlGroup.ID.ToString());
                output.WriteLine(HtmlTextWriter.TagRightChar);
                output.Indent++;

                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }
Ejemplo n.º 4
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();
            }
        }
Ejemplo n.º 5
0
        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
        }