Beispiel #1
0
        public DojoMember RequestMember(DojoOrganization organization, string organizationID)
        {
            DojoMembershipManager m =
                new DojoMembershipManager();

            DojoMembershipCollection c =
                m.GetCollection("OrganizationID=" + organization.ID.ToString() + " AND " +
                                "OrganizationMembershipID='" + organizationID + "'",
                                string.Empty,
                                DojoMembershipFlags.Member,
                                DojoMembershipFlags.MemberMemberType,
                                DojoMembershipFlags.MemberPrivateContact,
                                DojoMembershipFlags.MemberEmergencyContact);

            if (c.Count < 1)
            {
                throw(new Exception("Cannot find member with the id requested."));
            }

            if (c.Count > 1)
            {
                throw(new Exception("More than one member exists with the id requested."));
            }

            return(c[0].Member);
        }
Beispiel #2
0
 public MembershipScan()
 {
     _testMode            = true;
     _gracePeriod         = TimeSpan.FromDays(14);
     _primaryOrganization =
         DojoOrganization.NewPlaceHolder(1);
 }
        protected void btOk_Click(object sender, EventArgs e)
        {
            DojoOrganization dojoOrganization = new DojoOrganization(dojoOrganizationID);

            dojoOrganization.Delete();

            dojoOrganizationID = 0;

            OnDeleted(EventArgs.Empty);
        }
        public void Remove(DojoOrganization value)
        {
            OnCollectionChanged(EventArgs.Empty);
            int index = IndexOf(value);

            if (index == -1)
            {
                throw(new Exception("DojoOrganization not found in collection."));
            }
            RemoveAt(index);
        }
 public int Add(DojoOrganization value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         ensureArrays();
         addIndexKey(value.ID);
         DojoOrganizationArray[count - 1] = value;
         return(count - 1);
     }
 }
Beispiel #6
0
        private static DojoOrganization Organization(
            string name,
            string description,
            GreyFoxContact location)
        {
            DojoOrganization organization = new DojoOrganization();

            organization.Name        = name;
            organization.Description = description;
            organization.Location    = location;
            return(organization);
        }
 protected override void OnPreRender(EventArgs e)
 {
     if (dojoOrganizationID != 0)
     {
         dojoOrganization = new DojoOrganization(dojoOrganizationID);
         text             = "Delete - " + dojoOrganization.ToString();
     }
     else
     {
         text = "Delete ";
     }
 }
 public void Add(DojoOrganization dojoOrganization, TimeSpan slidingExpiration)
 {
     lock (this)
     {
         count++;
         ensureArrays();
         dojoOrganizationArray[count - 1] = dojoOrganization;
         timeStamps[count - 1]            = DateTime.Now;
         absoluteExpirations[count - 1]   = DateTime.Now.Add(slidingExpiration); // Never Expires
         slidingExpirations[count - 1]    = slidingExpiration;                   // Never slides
         quickSort(0, count - 1);
     }
 }
 public int IndexOf(DojoOrganization value)
 {
     lock (this)
     {
         for (int x = 0; x < count; x++)
         {
             if (DojoOrganizationArray[x].Equals(value))
             {
                 return(x);
             }
         }
     }
     return(-1);
 }
 public void Insert(int index, DojoOrganization value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         ensureArrays();
         addIndexKey(value.ID);
         for (int x = index + 1; x == count - 2; x++)
         {
             DojoOrganizationArray[x] = DojoOrganizationArray[x - 1];
         }
         DojoOrganizationArray[index] = value;
     }
 }
 /// <summary>
 /// Ensures that the index and object array are sized correctly
 /// for additions. This method should be protected by locks
 /// issued by calling methods.
 /// </summary>
 private void ensureArrays()
 {
     if (count > DojoOrganizationArray.GetUpperBound(0) + 1)
     {
         int[,] tempIndex = new int[count * 2, 2];
         DojoOrganization[] tempDojoOrganizationArray = new DojoOrganization[count * 2];
         for (int x = 0; x <= DojoOrganizationArray.GetUpperBound(0); x++)
         {
             tempIndex[x, 0] = index[x, 0];                           // Copy ID
             tempIndex[x, 1] = index[x, 1];                           // Copy Location
             tempDojoOrganizationArray[x] = DojoOrganizationArray[x]; // Copy Object
         }
         index = tempIndex;
         DojoOrganizationArray = tempDojoOrganizationArray;
     }
 }
Beispiel #12
0
        public static DojoMembershipTemplate MembershipTemplate(
            string name,
            string description,
            bool purchaseRequired, bool testRequired, bool attendanceRequired,
            decimal fee, decimal startupFee,
            DojoMembershipDayType membershipStart,
            DojoMembershipDayType membershipEnd,
            DojoOrganization organization,
            int orderNum,
            int proRateMonthA, int proRateDayA, decimal proRateFeeA, DojoMembershipDayType proRateEndA,
            int proRateMonthB, int proRateDayB, decimal proRateFeeB, DojoMembershipDayType proRateEndB,
            int proRateMonthC, int proRateDayC, decimal proRateFeeC, DojoMembershipDayType proRateEndC,
            int ageYearsMin, int ageYearsMax,
            int memberForMin, int memberForMax,
            DojoRank rankMin, DojoRank rankMax)
        {
            DojoMembershipTemplate template = new DojoMembershipTemplate();

            template.Name               = name;
            template.Description        = description;
            template.PurchaseRequired   = purchaseRequired;
            template.TestRequired       = testRequired;
            template.AttendanceRequired = attendanceRequired;
            template.MembershipStart    = membershipStart;
            template.MembershipEnd      = membershipEnd;
            template.Organization       = organization;
            template.OrderNum           = orderNum;
            template.ProRateMonthA      = proRateMonthA;
            template.ProRateDayA        = proRateDayA;
            template.ProRateFeeA        = proRateFeeA;
            template.ProRateEndA        = proRateEndA;
            template.ProRateMonthB      = proRateMonthB;
            template.ProRateDayB        = proRateDayB;
            template.ProRateFeeB        = proRateFeeB;
            template.ProRateEndB        = proRateEndB;
            template.ProRateMonthC      = proRateMonthC;
            template.ProRateDayC        = proRateDayC;
            template.ProRateFeeC        = proRateFeeC;
            template.ProRateEndC        = proRateEndC;
            template.AgeYearsMin        = ageYearsMin;
            template.AgeYearsMax        = ageYearsMax;
            template.MemberForMin       = memberForMin;
            template.MemberForMax       = memberForMax;
            template.RankMin            = rankMin;
            template.RankMax            = rankMax;
            return(template);
        }
Beispiel #13
0
        public static DojoOrganization PrimaryOrganization()
        {
            string value;

            value = ConfigurationManager.AppSettings["Tessen_PrimaryOrganizatonID"];

            if (value != null)
            {
                try { return(DojoOrganization.NewPlaceHolder(int.Parse(value))); }
                catch { }
            }
            else
            {
                return(DojoOrganization.NewPlaceHolder(1));
            }

            return(null);
        }
 /// <summary>
 /// Ensures that the index and object array are sized correctly
 /// for additions. This method should be protected by locks
 /// issued by calling methods.
 /// </summary>
 private void ensureArrays()
 {
     if (count > dojoOrganizationArray.GetUpperBound(0) + 1)
     {
         DojoOrganization[] tempDojoOrganizationArray = new DojoOrganization[count * 2];
         DateTime[]         tempTimeStamps            = new DateTime[count * 2];
         DateTime[]         tempAbsoluteExpirations   = new DateTime[count * 2];
         TimeSpan[]         tempSlidingExpirations    = new TimeSpan[count * 2];
         Array.Copy(dojoOrganizationArray, tempDojoOrganizationArray, count - 1);
         Array.Copy(timeStamps, tempTimeStamps, count - 1);
         Array.Copy(absoluteExpirations, tempAbsoluteExpirations, count - 1);
         Array.Copy(slidingExpirations, tempSlidingExpirations, count - 1);
         dojoOrganizationArray = tempDojoOrganizationArray;
         timeStamps            = tempTimeStamps;
         absoluteExpirations   = tempAbsoluteExpirations;
         slidingExpirations    = tempSlidingExpirations;
     }
 }
 public void CheckedAdd(DojoOrganization dojoOrganization, TimeSpan slidingExpiration)
 {
     lock (this)
     {
         int i = binarySearch(dojoOrganization.iD);
         if (i != -1)
         {
             dojoOrganizationArray[i] = dojoOrganization;
             absoluteExpirations[i]   = DateTime.Now.Add(slidingExpiration); // Expires
             slidingExpirations[i]    = slidingExpiration;                   // Never slides
             return;
         }
         count++;
         ensureArrays();
         dojoOrganizationArray[count - 1] = dojoOrganization;
         timeStamps[count - 1]            = DateTime.Now;
         absoluteExpirations[count - 1]   = DateTime.Now.Add(slidingExpiration); // Expires
         slidingExpirations[count - 1]    = slidingExpiration;                   // Never slides
         quickSort(0, count - 1);
     }
 }
Beispiel #16
0
        protected override void OnPreRender(EventArgs e)
        {
            if (loadFlag)
            {
                if (dojoOrganizationID > 0)
                {
                    obj  = new DojoOrganization(dojoOrganizationID);
                    text = "Edit  - " + obj.ToString();
                }
                else if (dojoOrganizationID <= 0)
                {
                    obj  = new DojoOrganization();
                    text = "Add ";
                }

                //
                // Set Field Entries
                //
                tbName.Text                    = obj.Name;
                tbDescription.Text             = obj.Description;
                tbWebServiceUrl.Text           = obj.WebServiceUrl;
                tbRefreshTime.Text             = obj.RefreshTime.ToString();
                cbIsPrimary.Checked            = obj.IsPrimary;
                cbPromotionFlagEnabled.Checked = obj.PromotionFlagEnabled;

                //
                // Set Children Selections
                //
                if (obj.Location != null)
                {
                    foreach (ListItem item in msLocation.Items)
                    {
                        item.Selected = obj.Location.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msLocation.SelectedIndex = 0;
                }

                foreach (ListItem i in msClassLocations.Items)
                {
                    foreach (GreyFoxContact greyFoxContact in obj.ClassLocations)
                    {
                        if (i.Value == greyFoxContact.ID.ToString())
                        {
                            i.Selected = true;
                            break;
                        }
                    }
                }
                if (obj.AdministrativeContact != null)
                {
                    foreach (ListItem item in msAdministrativeContact.Items)
                    {
                        item.Selected = obj.AdministrativeContact.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msAdministrativeContact.SelectedIndex = 0;
                }

                if (obj.DefaultMemberType != null)
                {
                    foreach (ListItem item in msDefaultMemberType.Items)
                    {
                        item.Selected = obj.DefaultMemberType.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msDefaultMemberType.SelectedIndex = 0;
                }
            }
        }
Beispiel #17
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoMembershipID == 0)
            {
                obj = new DojoMembership();
            }
            else
            {
                obj = new DojoMembership(dojoMembershipID);
            }

            if (comboMember.SelectedItem != null)
            {
                obj.Member = DojoMember.NewPlaceHolder(int.Parse(comboMember.SelectedValue));
            }
            else
            {
                obj.Member = null;
            }
            obj.StartDate = deStartDate.Date;
            obj.EndDate   = deEndDate.Date;
            if (comboOrganization.SelectedItem != null)
            {
                obj.Organization = DojoOrganization.NewPlaceHolder(int.Parse(comboOrganization.SelectedValue));
            }
            else
            {
                obj.Organization = null;
            }
            obj.OrganizationMemberID = tbOrganizationMemberID.Text;
            if (ddParent.SelectedItem != null && ddParent.SelectedValue != "null")
            {
                obj.Parent = DojoMembership.NewPlaceHolder(int.Parse(ddParent.SelectedValue));
            }
            else
            {
                obj.Parent = null;
            }
            if (comboMemberTypeTemplate.SelectedItem != null)
            {
                obj.MemberTypeTemplate = DojoMemberTypeTemplate.NewPlaceHolder(int.Parse(comboMemberTypeTemplate.SelectedValue));
            }
            else
            {
                obj.MemberTypeTemplate = null;
            }
            if (comboMembershipTemplate.SelectedItem != null)
            {
                obj.MembershipTemplate = DojoMembershipTemplate.NewPlaceHolder(int.Parse(comboMembershipTemplate.SelectedValue));
            }
            else
            {
                obj.MembershipTemplate = null;
            }
            obj.Fee           = decimal.Parse(tbFee.Text);
            obj.PaymentAmount = decimal.Parse(tbPaymentAmount.Text);
            obj.IsProRated    = cbIsProRated.Checked;
            if (ddInvoiceLine.SelectedItem != null && ddInvoiceLine.SelectedValue != "null")
            {
                obj.InvoiceLine = RHInvoiceLine.NewPlaceHolder(int.Parse(ddInvoiceLine.SelectedValue));
            }
            else
            {
                obj.InvoiceLine = null;
            }
            if (editOnAdd)
            {
                dojoMembershipID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                DojoMembership newObj = new DojoMembership();
                if (newObj.Member != null)
                {
                    comboMember.Text = newObj.Member.ToString();
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboMember.Items)
                    {
                        if (item.Value == newObj.Member.ID.ToString())
                        {
                            comboMember.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboMember.Text         = string.Empty;
                    comboMember.SelectedItem = null;
                }
                deStartDate.Date = newObj.StartDate;
                deEndDate.Date   = newObj.EndDate;
                if (newObj.Organization != null)
                {
                    comboOrganization.Text = newObj.Organization.ToString();
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboOrganization.Items)
                    {
                        if (item.Value == newObj.Organization.ID.ToString())
                        {
                            comboOrganization.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboOrganization.Text         = string.Empty;
                    comboOrganization.SelectedItem = null;
                }
                tbOrganizationMemberID.Text = newObj.OrganizationMemberID;
                if (newObj.Parent != null)
                {
                    foreach (ListItem item in ddParent.Items)
                    {
                        item.Selected = newObj.Parent.ID.ToString() == item.Value;
                    }
                }
                else if (ddParent.Items.Count > 0)
                {
                    ddParent.SelectedIndex = 0;
                }

                if (newObj.MemberTypeTemplate != null)
                {
                    comboMemberTypeTemplate.Text = newObj.MemberTypeTemplate.ToString();
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboMemberTypeTemplate.Items)
                    {
                        if (item.Value == newObj.MemberTypeTemplate.ID.ToString())
                        {
                            comboMemberTypeTemplate.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboMemberTypeTemplate.Text         = string.Empty;
                    comboMemberTypeTemplate.SelectedItem = null;
                }
                if (newObj.MembershipTemplate != null)
                {
                    comboMembershipTemplate.Text = newObj.MembershipTemplate.ToString();
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboMembershipTemplate.Items)
                    {
                        if (item.Value == newObj.MembershipTemplate.ID.ToString())
                        {
                            comboMembershipTemplate.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboMembershipTemplate.Text         = string.Empty;
                    comboMembershipTemplate.SelectedItem = null;
                }
                ltSessionID.Text       = newObj.SessionID.ToString();
                tbFee.Text             = newObj.Fee.ToString();
                ltPriorMembership.Text = newObj.PriorMembership != null?
                                         newObj.PriorMembership.ToString() : Localization.Strings.StartupMembership;

                tbPaymentAmount.Text = newObj.PaymentAmount.ToString();
                cbIsProRated.Checked = newObj.IsProRated;
                if (newObj.InvoiceLine != null)
                {
                    foreach (ListItem item in ddInvoiceLine.Items)
                    {
                        item.Selected = newObj.InvoiceLine.ID.ToString() == item.Value;
                    }
                }
                else if (ddInvoiceLine.Items.Count > 0)
                {
                    ddInvoiceLine.SelectedIndex = 0;
                }
            }

            OnUpdated(EventArgs.Empty);
        }
Beispiel #18
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoOrganizationID == 0)
            {
                obj = new DojoOrganization();
            }
            else
            {
                obj = new DojoOrganization(dojoOrganizationID);
            }

            obj.Name                 = tbName.Text;
            obj.Description          = tbDescription.Text;
            obj.WebServiceUrl        = tbWebServiceUrl.Text;
            obj.RefreshTime          = TimeSpan.Parse(tbRefreshTime.Text);
            obj.IsPrimary            = cbIsPrimary.Checked;
            obj.PromotionFlagEnabled = cbPromotionFlagEnabled.Checked;

            if (msLocation.SelectedItem != null && msLocation.SelectedItem.Value != "Null")
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations",
                                                             int.Parse(msLocation.SelectedItem.Value));
            }
            else
            {
                obj.Location = null;
            }

            if (msClassLocations.IsChanged)
            {
                obj.ClassLocations = new GreyFoxContactCollection();
                foreach (ListItem i in msClassLocations.Items)
                {
                    if (i.Selected)
                    {
                        obj.ClassLocations.Add(GreyFoxContact.NewPlaceHolder("kitTessen_Locations", int.Parse(i.Value)));
                    }
                }
            }

            if (msAdministrativeContact.SelectedItem != null && msAdministrativeContact.SelectedItem.Value != "Null")
            {
                obj.AdministrativeContact = GreyFoxContact.NewPlaceHolder("sysGlobal_Contacts",
                                                                          int.Parse(msAdministrativeContact.SelectedItem.Value));
            }
            else
            {
                obj.AdministrativeContact = null;
            }

            if (msDefaultMemberType.SelectedItem != null && msDefaultMemberType.SelectedItem.Value != "Null")
            {
                obj.DefaultMemberType = DojoMemberType.NewPlaceHolder(
                    int.Parse(msDefaultMemberType.SelectedItem.Value));
            }
            else
            {
                obj.DefaultMemberType = null;
            }

            if (editOnAdd)
            {
                dojoOrganizationID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text                           = string.Empty;
                tbDescription.Text                    = string.Empty;
                tbWebServiceUrl.Text                  = string.Empty;
                tbRefreshTime.Text                    = string.Empty;
                cbIsPrimary.Checked                   = false;
                cbPromotionFlagEnabled.Checked        = false;
                msLocation.SelectedIndex              = 0;
                msAdministrativeContact.SelectedIndex = 0;
                msDefaultMemberType.SelectedIndex     = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Beispiel #19
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();
            }
        }
 public bool Contains(DojoOrganization value)
 {
     return(IndexOf(value) != -1);
 }
Beispiel #21
0
        protected override void OnPreRender(EventArgs e)
        {
            if (dojoOrganizationID != 0)
            {
                dojoOrganization = new DojoOrganization(dojoOrganizationID);

                #region Bind Default Folder

                //
                // Set Field Entries
                //

                ltName.Text        = dojoOrganization.Name.ToString();
                ltDescription.Text = dojoOrganization.Description.ToString();

                //
                // Set Children Selections
                //

                // Location

                if (dojoOrganization.Location != null)
                {
                    ltLocation.Text = dojoOrganization.Location.ToString();
                }
                else
                {
                    ltLocation.Text = string.Empty;
                }

                // ClassLocations

                if (dojoOrganization.ClassLocations != null)
                {
                    ltClassLocations.Text = dojoOrganization.ClassLocations.ToString();
                }
                else
                {
                    ltClassLocations.Text = string.Empty;
                }

                // AdministrativeContact

                if (dojoOrganization.AdministrativeContact != null)
                {
                    ltAdministrativeContact.Text = dojoOrganization.AdministrativeContact.ToString();
                }
                else
                {
                    ltAdministrativeContact.Text = string.Empty;
                }


                #endregion

                #region Bind _system Folder

                //
                // Set Field Entries
                //


                //
                // Set Children Selections
                //


                #endregion

                #region Bind Web Services Folder

                //
                // Set Field Entries
                //

                ltWebServiceUrl.Text = dojoOrganization.WebServiceUrl.ToString();
                ltRefreshTime.Text   = dojoOrganization.RefreshTime.ToString();

                //
                // Set Children Selections
                //


                #endregion

                #region Bind System Folder

                //
                // Set Field Entries
                //

                ltIsPrimary.Text = dojoOrganization.IsPrimary.ToString();

                //
                // Set Children Selections
                //


                #endregion

                #region Bind Membership Folder

                //
                // Set Field Entries
                //

                ltPromotionFlagEnabled.Text = dojoOrganization.PromotionFlagEnabled.ToString();

                //
                // Set Children Selections
                //

                // DefaultMemberType

                if (dojoOrganization.DefaultMemberType != null)
                {
                    ltDefaultMemberType.Text = dojoOrganization.DefaultMemberType.ToString();
                }
                else
                {
                    ltDefaultMemberType.Text = string.Empty;
                }


                #endregion

                text = "View  - " + dojoOrganization.ToString();
            }
        }
Beispiel #22
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoMembershipID == 0)
            {
                obj = new DojoMembership();
            }
            else
            {
                obj = new DojoMembership(dojoMembershipID);
            }

            obj.StartDate            = deStartDate.Date;
            obj.EndDate              = deEndDate.Date;
            obj.OrganizationMemberID = tbOrganizationMemberID.Text;

            if (msMember.SelectedItem != null && msMember.SelectedItem.Value != "Null")
            {
                obj.Member = DojoMember.NewPlaceHolder(
                    int.Parse(msMember.SelectedItem.Value));
            }
            else
            {
                obj.Member = null;
            }

            if (msMemberType.SelectedItem != null && msMemberType.SelectedItem.Value != "Null")
            {
                obj.MemberType = DojoMemberType.NewPlaceHolder(
                    int.Parse(msMemberType.SelectedItem.Value));
            }
            else
            {
                obj.MemberType = null;
            }

            if (msOrganization.SelectedItem != null && msOrganization.SelectedItem.Value != "Null")
            {
                obj.Organization = DojoOrganization.NewPlaceHolder(
                    int.Parse(msOrganization.SelectedItem.Value));
            }
            else
            {
                obj.Organization = null;
            }

            if (msParentMembership.SelectedItem != null && msParentMembership.SelectedItem.Value != "Null")
            {
                obj.ParentMembership = DojoMembership.NewPlaceHolder(
                    int.Parse(msParentMembership.SelectedItem.Value));
            }
            else
            {
                obj.ParentMembership = null;
            }

            if (msSourceTemplate.SelectedItem != null && msSourceTemplate.SelectedItem.Value != "Null")
            {
                obj.SourceTemplate = DojoMembershipTemplate.NewPlaceHolder(
                    int.Parse(msSourceTemplate.SelectedItem.Value));
            }
            else
            {
                obj.SourceTemplate = null;
            }

            if (msInvoiceLine.SelectedItem != null && msInvoiceLine.SelectedItem.Value != "Null")
            {
                obj.InvoiceLine = RHInvoiceLine.NewPlaceHolder(
                    int.Parse(msInvoiceLine.SelectedItem.Value));
            }
            else
            {
                obj.InvoiceLine = null;
            }

            if (editOnAdd)
            {
                dojoMembershipID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                deStartDate.Date                 = DateTime.Now;
                deEndDate.Date                   = DateTime.Now;
                tbOrganizationMemberID.Text      = string.Empty;
                msMember.SelectedIndex           = 0;
                msMemberType.SelectedIndex       = 0;
                msOrganization.SelectedIndex     = 0;
                msParentMembership.SelectedIndex = 0;
                msSourceTemplate.SelectedIndex   = 0;
                msInvoiceLine.SelectedIndex      = 0;
            }

            OnUpdated(EventArgs.Empty);
        }