Ejemplo n.º 1
0
            private static SocialMediaTabItem[] GetSocialMediaTabInfo(
                UpdateIntroPage page)
            {
                var list = new List <SocialMediaTabItem>
                {
                    // Build dummy items for web site and email
                    new SocialMediaTabItem(page,
                                           new SocialMedium("WebSite", "Web Site", Empty, Empty, null, true),
                                           "PublicWebAddress"),
                    new SocialMediaTabItem(page,
                                           new SocialMedium("Email", "Email", Empty, Empty, null, true),
                                           "PublicEmail")
                    {
                        Validator = ValidateEmail
                    }
                };

                // Add the existing Social Media table
                list.AddRange(
                    SocialMedia.SocialMediaList.Select(
                        medium => new SocialMediaTabItem(page, medium)));

                var socialMediaTabInfo = list.ToArray();

                foreach (var item in socialMediaTabInfo)
                {
                    item.InitializeItem(page);
                }

                InitializeGroup(page, GroupName);

                return(socialMediaTabInfo);
            }
Ejemplo n.º 2
0
 // ReSharper disable UnusedMember.Local
 // Invoked via Reflection
 internal static void Initialize(UpdateIntroPage page)
 // ReSharper restore UnusedMember.Local
 {
     page.BuildBio2Tab();
     page.RegisterUpdateAll(page.UpdateAllBio2);
     new MainTabItem {
         TabName = GroupName
     }.Initialize(page);
     if (!page.IsPostBack)
     {
         page.LoadBio2TabData();
     }
 }
Ejemplo n.º 3
0
 // ReSharper disable UnusedMember.Local
 // Invoked via Reflection
 private static void Initialize(UpdateIntroPage page)
 // ReSharper restore UnusedMember.Local
 {
     page._SocialMediaTabInfo = GetSocialMediaTabInfo(page);
     page.RegisterUpdateAll(page.UpdateAllSocialMedia);
     new MainTabItem {
         TabName = GroupName
     }.Initialize(page);
     if (!page.IsPostBack)
     {
         page.LoadSocialMediaTabData();
         page.RefreshSocialMediaTab();
     }
 }
Ejemplo n.º 4
0
 private SocialMediaTabItem(UpdateIntroPage page, SocialMedium socialMedium,
                            string column) : base(page, GroupName)
 {
     _SocialMedium = socialMedium;
     Column        = column;
     Description   = socialMedium.DisplayName;
     if (socialMedium.Name == "YouTube")
     {
         Validator = ValidateYouTubeAddressOptional;
     }
     else
     {
         Validator = ValidateWebAddress;
     }
 }
Ejemplo n.º 5
0
 // Invoked via Reflection
 // ReSharper disable once UnusedMember.Local
 internal static void Initialize(UpdateIntroPage page)
 // ReSharper restore UnusedMember.Global
 {
     LoadPartiesDropdown(Politicians.GetStateCodeFromKey(page.PoliticianKey),
                         page.ControlContactPartyKey, Empty, PartyCategories.None,
                         PartyCategories.StateParties, PartyCategories.NationalParties,
                         PartyCategories.NonParties);
     page._ContactTabInfo = GetContactTabInfo(page);
     page.RegisterUpdateAll(page.UpdateAllContacts);
     new MainTabItem {
         TabName = GroupName
     }.Initialize(page);
     if (!page.IsPostBack)
     {
         page.LoadContactTabData();
         page.RefreshContactTab();
     }
 }
Ejemplo n.º 6
0
            private static ContactTabItem[] GetContactTabInfo(UpdateIntroPage page)
            {
                var contactTabInfo = new[]
                {
                    new ContactTabItem(page)
                    {
                        Column      = "FName",
                        Description = "First Name",
                        Validator   = ValidateFirstName
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "MName",
                        Description = "Middle Name",
                        Validator   = ValidateMiddleName
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "Nickname",
                        Description = "Nickname",
                        Validator   = ValidateNickname
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "LName",
                        Description = "Last Name",
                        Validator   = ValidateLastName
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "Suffix",
                        Description = "Suffix",
                        Validator   = ValidateSuffix
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "PublicAddress",
                        Description = "Street Address",
                        Validator   = ValidateStreet
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "PublicCityStateZip",
                        Description = "City, State Zip",
                        Validator   = ValidateCityStateZip
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "PublicPhone",
                        Description = "Phone",
                        Validator   = ValidateWhiteSpace
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "PublicEmail",
                        Description = "Email",
                        Validator   = ValidateEmail
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "DateOfBirth",
                        Description = "Date of Birth",
                        Validator   = i => UserSecurityClass == PoliticianSecurityClass
              ? ValidateDateOfBirth(i)
              : ValidateDateOfBirthOptional(i)
                    },
                    new ContactTabItem(page)
                    {
                        Column      = "PartyKey",
                        Description = "Political Party"
                    }
                };

                foreach (var item in contactTabInfo)
                {
                    item.InitializeItem(page);
                }

                InitializeGroup(page, GroupName);

                return(contactTabInfo);
            }
Ejemplo n.º 7
0
 private ContactTabItem(UpdateIntroPage page) : base(page, GroupName)
 {
 }
Ejemplo n.º 8
0
 private SocialMediaTabItem(UpdateIntroPage page, SocialMedium socialMedium)
     : this(page, socialMedium, socialMedium.DatabaseColumn)
 {
     _SocialMedium = socialMedium;
 }
Ejemplo n.º 9
0
 public Bio2TabItem(UpdateIntroPage page, string groupName)
     : base(page, groupName)
 {
 }
Ejemplo n.º 10
0
 protected PoliticianDataItem(UpdateIntroPage page, string groupName)
     : base(groupName)
 {
     Page = page;
 }
Ejemplo n.º 11
0
 public ReasonsTabItem(UpdateIntroPage page, string groupName)
     : base(page, groupName)
 {
 }