private HtmlControl ReportCandidate(DataRow candidate)
        {
            var info = new HtmlDiv().AddCssClasses("info");

            var name          = new HtmlP().AddTo(info, "name");
            var isPrimary     = Elections.IsPrimaryElection(candidate.ElectionKey());
            var isNonPartisan =
                Elections.GetNationalPartyCode(candidate.ElectionKey()) == "X";

            FormatCandidate(candidate, true, (!isPrimary || isNonPartisan) &&
                            !candidate.IsRunningMate())
            .AddTo(name);

            if (candidate.IsWinner() && !candidate.IsRunningMate())
            {
                info.AddCssClasses("winner");
                new HtmlDiv()
                .Attribute("title", "Winner")
                .AddTo(info, "winner-icon");
            }

            new HtmlImage
            {
                Src = VotePage.GetPoliticianImageUrl(candidate.PoliticianKey(), 75)
            }.AddTo(
                info, "rounded-border headshot");

            var rightSide = new HtmlDiv().AddTo(info, "right-side");

            FormatCandidatePhone(candidate)
            .AddTo(rightSide);

            FormatCandidateWebsite(candidate)
            .AddTo(rightSide);

            SocialMedia.GetAnchors(candidate)
            .AddCssClasses("social")
            .AddTo(rightSide);

            var address      = candidate.PublicAddress();
            var cityStateZip = candidate.PublicCityStateZip();

            if (!string.IsNullOrWhiteSpace(address) &&
                !string.IsNullOrWhiteSpace(cityStateZip))
            {
                var addressTag = new HtmlDiv().AddTo(rightSide, "address");
                new HtmlP {
                    InnerText = address
                }.AddTo(addressTag);
                new HtmlP {
                    InnerText = cityStateZip
                }.AddTo(addressTag);
            }

            var age = candidate.Age();

            if (!string.IsNullOrWhiteSpace(age))
            {
                var ageTag = new HtmlDiv().AddTo(rightSide, "age");
                new HtmlSpan {
                    InnerText = "Age: "
                }.AddTo(ageTag);
                new LiteralControl(age).AddTo(ageTag);
            }

            ClearBoth()
            .AddTo(info);

            return(info);
        }
示例#2
0
        public void Adding_a_new_invalid_socialMedia_will_not_succeed()
        {
            var poco = new SocialMedia();

            AddPoco(PostOrPutAction.SocialMedia, poco, true);
        }
示例#3
0
 public ProfileAddEventArgs(SocialMedia socialMedia) => SocialMedia = socialMedia;
示例#4
0
        public async Task TestUpdate_SocialMedia_SevisNotLocked()
        {
            var personId      = 1;
            var participantId = 1;
            var creator       = 1;
            var updatorId     = 2;
            var updator       = new User(updatorId);
            var facebookType  = new SocialMediaType
            {
                SocialMediaTypeId   = SocialMediaType.Facebook.Id,
                SocialMediaTypeName = SocialMediaType.Facebook.Value
            };
            var twitter = new SocialMediaType
            {
                SocialMediaTypeId   = SocialMediaType.Twitter.Id,
                SocialMediaTypeName = SocialMediaType.Twitter.Value
            };

            var    oldSocialMediaTypeId = facebookType.SocialMediaTypeId;
            var    oldValue             = "oldValue";
            var    yesterday            = DateTimeOffset.Now.AddDays(-1.0);
            Person person = new Person
            {
                PersonId = personId
            };
            var socialMedia = new SocialMedia
            {
                SocialMediaId = 1,
                Person        = person,
                PersonId      = person.PersonId
            };
            var participant = new Participant
            {
                ParticipantId       = participantId,
                PersonId            = person.PersonId,
                ParticipantStatusId = ParticipantStatus.Active.Id
            };
            List <Participant> participants = new List <Participant>();

            participants.Add(participant);
            person.Participations = participants;
            var participantPerson = new ParticipantPerson
            {
                Participant   = participant,
                ParticipantId = participant.ParticipantId,
            };

            participant.ParticipantPerson = participantPerson;

            var queuedToSubmitStatus = new SevisCommStatus
            {
                SevisCommStatusId   = SevisCommStatus.InformationRequired.Id,
                SevisCommStatusName = SevisCommStatus.InformationRequired.Value
            };
            var commStatus = new ParticipantPersonSevisCommStatus
            {
                AddedOn           = DateTimeOffset.UtcNow,
                BatchId           = "batch id",
                Id                = 501,
                ParticipantId     = participant.ParticipantId,
                ParticipantPerson = participantPerson,
                SevisCommStatus   = queuedToSubmitStatus,
                SevisCommStatusId = queuedToSubmitStatus.SevisCommStatusId,
            };

            participantPerson.ParticipantPersonSevisCommStatuses.Add(commStatus);
            person.SocialMedias.Add(socialMedia);

            context.SetupActions.Add(() =>
            {
                context.SocialMedias.Add(socialMedia);
                context.SocialMediaTypes.Add(facebookType);
                context.SocialMediaTypes.Add(twitter);
                context.Participants.Add(participant);
                context.ParticipantPersons.Add(participantPerson);
                context.ParticipantPersonSevisCommStatuses.Add(commStatus);
                socialMedia.History.CreatedBy = creator;
                socialMedia.History.CreatedOn = yesterday;
                socialMedia.History.RevisedBy = creator;
                socialMedia.History.RevisedOn = yesterday;
                socialMedia.SocialMediaTypeId = facebookType.SocialMediaTypeId;
                socialMedia.SocialMediaType   = facebookType;
                socialMedia.SocialMediaValue  = oldValue;
            });
            context.Revert();

            var updatedSocialMedia = new UpdatedSocialMediaPresence(updator, socialMedia.SocialMediaId, "newValue", twitter.SocialMediaTypeId);

            var message = String.Format("An update was attempted on participant with id [{0}] but should have failed validation.",
                                        participant.ParticipantId);

            Action      a = () => service.Update(updatedSocialMedia);
            Func <Task> f = () => service.UpdateAsync(updatedSocialMedia);

            a.ShouldNotThrow <EcaBusinessException>();
            f.ShouldNotThrow <EcaBusinessException>();
        }
示例#5
0
        private HtmlTable CreateBioTable()
        {
            var htmlTable =
                new HtmlTable {
                CellSpacing = 0, CellPadding = 0, Border = 0
            }.AddCssClasses(
                "bioTable");

            // Age
            //
            var tr = new HtmlTableRow().AddTo(htmlTable,
                                              "trPoliticianInfoContact trPoliticianInfoContactAge");
            var td = new HtmlTableCell().AddTo(tr, "tdPoliticianInfoContactHeading");

            new HtmlSpan {
                InnerHtml = "Age:"
            }.AddTo(td);
            new HtmlTableCell {
                InnerHtml = _PoliticianInfo.Age()
            }.AddTo(tr,
                    "tdPoliticianInfoContactDetail");

            // Party
            //
            tr = new HtmlTableRow().AddTo(htmlTable, "trPoliticianInfoContact");
            td = new HtmlTableCell().AddTo(tr, "tdPoliticianInfoContactHeading");
            new HtmlSpan {
                InnerHtml = "Party:"
            }.AddTo(td);
            td = new HtmlTableCell().AddTo(tr, "tdPoliticianInfoContactDetail");
            CreatePartyAnchor()
            .AddTo(td);

            // Phone
            //
            tr = new HtmlTableRow().AddTo(htmlTable, "trPoliticianInfoContact");
            td = new HtmlTableCell().AddTo(tr, "tdPoliticianInfoContactHeading");
            new HtmlSpan {
                InnerHtml = "Phone:"
            }.AddTo(td);
            var phone = _PoliticianInfo.PublicPhone();

            new HtmlTableCell
            {
                InnerHtml = string.IsNullOrWhiteSpace(phone) ? "n/a" : phone
            }.AddTo(tr,
                    "tdPoliticianInfoContactDetail");

            // Address
            //
            tr = new HtmlTableRow().AddTo(htmlTable, "trPoliticianInfoContact");
            td = new HtmlTableCell().AddTo(tr, "tdPoliticianInfoContactHeading");
            new HtmlSpan {
                InnerHtml = "Address:"
            }.AddTo(td);
            var address = _PoliticianInfo.PublicAddress();

            if (!string.IsNullOrWhiteSpace(address))
            {
                address += "<br />";
            }
            address += _PoliticianInfo.PublicCityStateZip();
            new HtmlTableCell
            {
                InnerHtml = string.IsNullOrWhiteSpace(address) ? "n/a" : address
            }.AddTo(
                tr, "tdPoliticianInfoContactDetail");

            // Social media
            //
            tr = new HtmlTableRow().AddTo(htmlTable, "trPoliticianInfoContact");
            td = new HtmlTableCell().AddTo(tr, "tdPoliticianInfoContactHeading");
            new HtmlSpan {
                InnerHtml = "&nbsp;"
            }.AddTo(td);
            var webUrl = _PoliticianInfo.PublicWebAddress();

            td = new HtmlTableCell().AddTo(tr,
                                           "tdPoliticianInfoContactDetail socialMedia");
            new HtmlBreak(2).AddTo(td);
            if (!string.IsNullOrWhiteSpace(webUrl))
            {
                var span  = new HtmlSpan().AddTo(td, "TWebsite");
                var title = Politicians.FormatName(_PoliticianInfo) + "'s Website";
                new HtmlAnchor
                {
                    HRef      = VotePage.NormalizeUrl(webUrl),
                    Title     = title,
                    Target    = "view",
                    InnerHtml = "Website"
                }.AddTo(span);
                new HtmlBreak(2).AddTo(td);
            }
            SocialMedia.GetAnchors(_PoliticianInfo)
            .AddTo(td);

            return(htmlTable);
        }
 public IResult Delete(SocialMedia socialMedia)
 {
     _socialDal.Delete(socialMedia);
     return(new SuccessResult(Messages.SocialMediaDeleted));
 }
示例#7
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            //Other fields Validation
            if (!String.IsNullOrEmpty(SocialMedia))
            {
                SocialMedia = SocialMedia.Trim();
            }
            if (!String.IsNullOrEmpty(BusinessDescription))
            {
                BusinessDescription = BusinessDescription.Trim();
            }
            if (!String.IsNullOrEmpty(WebAddress))
            {
                WebAddress = WebAddress.Trim();
            }
            if (!String.IsNullOrEmpty(DomainLoginUrl))
            {
                DomainLoginUrl = DomainLoginUrl.Trim();
            }
            if (!String.IsNullOrEmpty(DomainUsername))
            {
                DomainUsername = DomainUsername.Trim();
            }
            if (!String.IsNullOrEmpty(DomainPassword))
            {
                DomainPassword = DomainPassword.Trim();
            }
            if (!String.IsNullOrEmpty(HostingLoginUrl))
            {
                HostingLoginUrl = HostingLoginUrl.Trim();
            }
            if (!String.IsNullOrEmpty(HostingUserName))
            {
                HostingUserName = HostingUserName.Trim();
            }
            if (!String.IsNullOrEmpty(HostingPassword))
            {
                HostingPassword = HostingPassword.Trim();
            }
            if (!String.IsNullOrEmpty(WpLoginUrl))
            {
                WpLoginUrl = WpLoginUrl.Trim();
            }
            if (!String.IsNullOrEmpty(WpUserName))
            {
                WpUserName = WpUserName.Trim();
            }
            if (!String.IsNullOrEmpty(WpPassword))
            {
                WpPassword = WpPassword.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleAnalyticsUrl))
            {
                GoogleAnalyticsUrl = GoogleAnalyticsUrl.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleAnalyticsUsername))
            {
                GoogleAnalyticsUsername = GoogleAnalyticsUsername.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleAnalyticsPassword))
            {
                GoogleAnalyticsPassword = GoogleAnalyticsPassword.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleSearchConsoleUrl))
            {
                GoogleSearchConsoleUrl = GoogleSearchConsoleUrl.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleSearchConsoleUsername))
            {
                GoogleSearchConsoleUsername = GoogleSearchConsoleUsername.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleSearchConsolePassword))
            {
                GoogleSearchConsolePassword = GoogleSearchConsolePassword.Trim();
            }
            if (!String.IsNullOrEmpty(BingWemasterToolsUrl))
            {
                BingWemasterToolsUrl = BingWemasterToolsUrl.Trim();
            }
            if (!String.IsNullOrEmpty(BingWemasterToolsUsername))
            {
                BingWemasterToolsUsername = BingWemasterToolsUsername.Trim();
            }
            if (!String.IsNullOrEmpty(BingWemasterToolsPassword))
            {
                BingWemasterToolsPassword = BingWemasterToolsPassword.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleMyBusinessUrl))
            {
                GoogleMyBusinessUrl = GoogleMyBusinessUrl.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleMyBusinessUsername))
            {
                GoogleMyBusinessUsername = GoogleMyBusinessUsername.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleMyBusinessPassword))
            {
                GoogleMyBusinessPassword = GoogleMyBusinessPassword.Trim();
            }
            if (!String.IsNullOrEmpty(KeyWords))
            {
                KeyWords = KeyWords.Trim();
            }
            if (!String.IsNullOrEmpty(TargetKeyPhases))
            {
                TargetKeyPhases = TargetKeyPhases.Trim();
            }
            if (!String.IsNullOrEmpty(TargetAreas))
            {
                TargetAreas = TargetAreas.Trim();
            }
            if (!String.IsNullOrEmpty(CompetitorsUrl))
            {
                CompetitorsUrl = CompetitorsUrl.Trim();
            }
            if (!String.IsNullOrEmpty(SocialMedia))
            {
                SocialMedia = SocialMedia.Trim();
            }
            if (!String.IsNullOrEmpty(SocialMedia2))
            {
                SocialMedia2 = SocialMedia2.Trim();
            }
            if (!String.IsNullOrEmpty(SocialMedia3))
            {
                SocialMedia3 = SocialMedia3.Trim();
            }
            if (!String.IsNullOrEmpty(SocialMedia4))
            {
                SocialMedia4 = SocialMedia4.Trim();
            }
            if (!String.IsNullOrEmpty(OtherMarketingTypes))
            {
                OtherMarketingTypes = OtherMarketingTypes.Trim();
            }
            if (!String.IsNullOrEmpty(MarketingGoals))
            {
                MarketingGoals = MarketingGoals.Trim();
            }

            //ExpandPlaning = ExpandPlaning.Trim();

            yield return(ValidationResult.Success);
        }
示例#8
0
 public BlogController(IPostService postService, IOptions <BlogOptions> blogSettings, IOptions <SocialMedia> socialMediaSettings)
 {
     _postService         = postService;
     _blogSettings        = blogSettings.Value;
     _socialMediaSettings = socialMediaSettings.Value;
 }
示例#9
0
 public SocialMediaModule(DiscordSocketClient client, ILogger <SocialMediaModule> logger, SocialMedia socialMedia)
 {
     Client      = client;
     _logger     = logger;
     SocialMedia = socialMedia;
 }
示例#10
0
 public Person(string name, Address address, SocialMedia socialmedia)
 {
     Name        = name;
     Address     = address;
     SocialMedia = socialmedia;
 }
        public override void Execute()
        {
            WriteLiteral("<h2>Contact details</h2>\r\n");


            #line 4 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"

            var socialMedia = new SocialMedia
            {
                DisplayName = Model.CompetitionName,
                Facebook    = Model.Facebook,
                Twitter     = Model.Twitter,
                Instagram   = Model.Instagram,
                YouTube     = Model.YouTube
            };
            if (!string.IsNullOrWhiteSpace(Model.PublicContactDetails) || !string.IsNullOrWhiteSpace(Model.Website) || socialMedia.HasSocialMedia())
            {
            #line default
            #line hidden

            #line 15 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"
                Write(Html.Raw(Model.PublicContactDetails));


            #line default
            #line hidden

            #line 15 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"


                if (!string.IsNullOrWhiteSpace(Model.Website))
                {
            #line default
            #line hidden
                    WriteLiteral("            <p>Visit the <a");

                    WriteAttribute("href", Tuple.Create(" href=\"", 636), Tuple.Create("\"", 657)

            #line 19 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"
                                   , Tuple.Create(Tuple.Create("", 643), Tuple.Create <System.Object, System.Int32>(Model.Website

            #line default
            #line hidden
                                                                                                                    , 643), false)
                                   );

                    WriteLiteral(">");


            #line 19 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"
                    Write(Model.CompetitionName);


            #line default
            #line hidden
                    WriteLiteral("\'s website</a>.</p>\r\n");


            #line 20 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"
                }



            #line default
            #line hidden

            #line 22 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"
                Write(Html.Partial("_SocialMedia", socialMedia));


            #line default
            #line hidden

            #line 22 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"
                ;
            }
            else
            {
            #line default
            #line hidden

            #line 26 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"
                Write(Html.Partial("_ContactDetailsMissing", "competition"));


            #line default
            #line hidden

            #line 26 "..\..\Views\Partials\_CompetitionContactDetails.cshtml"
            }


            #line default
            #line hidden
        }
示例#12
0
        public void InitializeData()
        {
            _dbContext.Database.EnsureDeleted();
            if (_dbContext.Database.EnsureCreated())
            {
                // BEGIN CATEGORIES
                Category restrauntCategory = new Category()
                {
                    Name = "Restaurant"
                };
                Category winkelCategory = new Category()
                {
                    Name = "Winkel"
                };
                Category cafeCategory = new Category()
                {
                    Name = "Café"
                };
                Category schoolCategory = new Category()
                {
                    Name = "School"
                };

                var categories = new List <Category>
                {
                    restrauntCategory, winkelCategory, cafeCategory, schoolCategory
                };
                // END CATEGORIES

                // BEGIN ROLE
                Role customerRole = new Role()
                {
                    Name = "Customer"
                };
                Role merchantRole = new Role()
                {
                    Name = "Merchant"
                };

                var roles = new List <Role>
                {
                    customerRole, merchantRole
                };
                //END ROLE

                // BEGIN USERS
                Customer customerLennert = new Customer()
                {
                    FirstName = "Lennert", LastName = "Bontinck", Email = "*****@*****.**"
                };
                customerLennert.Login = new Login()
                {
                    Role = customerRole, Username = "******"
                };

                Customer customerBram = new Customer()
                {
                    FirstName = "Bram", LastName = "De Coninck", Email = "*****@*****.**"
                };
                customerBram.Login = new Login()
                {
                    Role = customerRole, Username = "******"
                };

                Customer customerJodi = new Customer()
                {
                    FirstName = "Jodi", LastName = "De Loof", Email = "*****@*****.**"
                };
                customerJodi.Login = new Login()
                {
                    Role = customerRole, Username = "******"
                };

                Merchant merchantRestaurantSpaghetti = new Merchant()
                {
                    FirstName = "Spaghetti", LastName = "Verantwoordelijke", Email = "*****@*****.**"
                };
                merchantRestaurantSpaghetti.Login = new Login()
                {
                    Role = merchantRole, Username = "******"
                };

                Merchant merchantWinkelFnac = new Merchant()
                {
                    FirstName = "Fnac", LastName = "Verantwoordelijke", Email = "*****@*****.**"
                };
                merchantWinkelFnac.Login = new Login()
                {
                    Role = merchantRole, Username = "******"
                };

                Merchant merchantCafeSafir = new Merchant()
                {
                    FirstName = "Safir", LastName = "Verantwoordelijke", Email = "*****@*****.**"
                };
                merchantCafeSafir.Login = new Login()
                {
                    Role = merchantRole, Username = "******"
                };

                Merchant merchantSchoolHoGent = new Merchant()
                {
                    FirstName = "HoGent", LastName = "Verantwoordelijke", Email = "*****@*****.**"
                };
                merchantSchoolHoGent.Login = new Login()
                {
                    Role = merchantRole, Username = "******"
                };

                var customers = new List <Customer>
                {
                    customerLennert, customerBram, customerJodi
                };
                var merchants = new List <Merchant>
                {
                    merchantRestaurantSpaghetti, merchantWinkelFnac, merchantCafeSafir, merchantSchoolHoGent
                };
                // END USERS

                // START SET PASSWORDS
                byte[] salt = new byte[128 / 8];
                using (var randomGetal = RandomNumberGenerator.Create())
                {
                    randomGetal.GetBytes(salt);
                }

                string hash = Convert.ToBase64String(KeyDerivation.Pbkdf2(
                                                         password: "******",
                                                         salt: salt,
                                                         prf: KeyDerivationPrf.HMACSHA1,
                                                         iterationCount: 10000,
                                                         numBytesRequested: 256 / 8));

                foreach (User user in customers)
                {
                    user.Login.Salt = salt;
                    user.Login.Hash = hash;
                }

                foreach (User user in merchants)
                {
                    user.Login.Salt = salt;
                    user.Login.Hash = hash;
                }
                // END SET PASSWORDS

                // START SOCIAL MEDIA
                SocialMedia facebookSocialMedia = new SocialMedia()
                {
                    LogoPath = "img/socialMediaLogos/facebook/facebook.png", Name = "Facebook"
                };
                SocialMedia instagramSocialMedia = new SocialMedia()
                {
                    LogoPath = "img/socialMediaLogos/instagram/instagram.png", Name = "Instagram"
                };
                SocialMedia twitterSocialMedia = new SocialMedia()
                {
                    LogoPath = "img/socialMediaLogos/twitter/twitter.png", Name = "Twitter"
                };

                var socialsMedias = new List <SocialMedia>
                {
                    facebookSocialMedia, instagramSocialMedia, twitterSocialMedia
                };
                // END SOCIAL MEDIA

                // START COMPANIES
                Company mrspaghettiCompany = new Company()
                {
                    Name = "Mr Spaghetti"
                };
                Company fnacCompany = new Company()
                {
                    Name = "Fnac"
                };
                Company safirCompany = new Company()
                {
                    Name = "Safir"
                };
                Company hogentCompany = new Company()
                {
                    Name = "HoGent"
                };
                // END COMPANIES

                // START ESTABLISHMENT
                // Day of week 0 = maandag, openinghours null = gesloten
                Establishment mrspaghettiAalstEstablishment = new Establishment()
                {
                    Name = "Restaurant Mr Spaghetti", Description = "Kom langs bij Mister Spaghetti en laat je verbazen door de pasta bij uitstek!", PostalCode = "9300", City = "Aalst", Street = "Hopmarkt", HouseNumber = "33", Latitude = 50.937142, Longitude = 4.036673
                };

                mrspaghettiAalstEstablishment.EstablishmentCategories.Add(new EstablishmentCategory()
                {
                    Category = restrauntCategory
                });
                mrspaghettiAalstEstablishment.EstablishmentCategories.Add(new EstablishmentCategory()
                {
                    Category = cafeCategory
                });

                mrspaghettiAalstEstablishment.EstablishmentSocialMedias.Add(new EstablishmentSocialMedia()
                {
                    SocialMedia = facebookSocialMedia, Url = "https://www.facebook.com/WeLoveMisterSpaghettiAalst/"
                });

                mrspaghettiAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/1/1.jpg"
                });
                mrspaghettiAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/1/2.jpg"
                });

                mrspaghettiAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 0
                });
                mrspaghettiAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 1
                });
                mrspaghettiAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 2, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 11, Startminute = 30, EndHour = 14, EndMinute = 00
                        }, new OpenHour()
                        {
                            StartHour = 18, Startminute = 00, EndHour = 22, EndMinute = 00
                        }
                    }
                });
                mrspaghettiAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 3, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 11, Startminute = 30, EndHour = 14, EndMinute = 00
                        }, new OpenHour()
                        {
                            StartHour = 18, Startminute = 00, EndHour = 22, EndMinute = 00
                        }
                    }
                });
                mrspaghettiAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 4, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 11, Startminute = 30, EndHour = 14, EndMinute = 00
                        }, new OpenHour()
                        {
                            StartHour = 18, Startminute = 00, EndHour = 22, EndMinute = 00
                        }
                    }
                });
                mrspaghettiAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 5, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 11, Startminute = 30, EndHour = 14, EndMinute = 00
                        }, new OpenHour()
                        {
                            StartHour = 18, Startminute = 00, EndHour = 22, EndMinute = 00
                        }
                    }
                });
                mrspaghettiAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 6, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 11, Startminute = 30, EndHour = 14, EndMinute = 00
                        }, new OpenHour()
                        {
                            StartHour = 18, Startminute = 00, EndHour = 22, EndMinute = 00
                        }
                    }
                });

                mrspaghettiAalstEstablishment.ExceptionalDays.Add(new ExceptionalDay()
                {
                    Day = DateTime.Today, Message = "Gesloten wegens familiale redenen."
                });
                mrspaghettiAalstEstablishment.ExceptionalDays.Add(new ExceptionalDay()
                {
                    Day = DateTime.Today.AddDays(4), Message = "All you can eat event!"
                });
                mrspaghettiAalstEstablishment.ExceptionalDays.Add(new ExceptionalDay()
                {
                    Day = DateTime.Today.AddDays(10), Message = "Ladies night event!"
                });

                mrspaghettiAalstEstablishment.Events.Add(new Event()
                {
                    StartDate = DateTime.Today.AddDays(4).AddHours(11).AddMinutes(30), EndDate = DateTime.Today.AddDays(4).AddHours(22),
                    Name      = "All you can eat",
                    Message   = "Bij het all you can eat event betaal je een inkom van 20 euro en krijg je een ganse avond spaghetti voorgeschoteld! De normale openingsuren gelden.",
                    Images    = new List <Image>()
                    {
                        new Image()
                        {
                            Path = "img/events/1/1.jpg"
                        }, new Image()
                        {
                            Path = "img/events/1/2.jpg"
                        }
                    }
                });
                mrspaghettiAalstEstablishment.Events.Add(new Event()
                {
                    StartDate = DateTime.Today.AddDays(10).AddHours(18), EndDate = DateTime.Today.AddDays(10).AddHours(23),
                    Name      = "Ladies night",
                    Message   = "Voor deze ladies night kunnen alle meiden vanaf 6u savonds terrecht bij Mr Spaghetti te Aalst voor een hapje en een drankje terwijl er een Sturm Der Liebe marathon afspeeld op het groot scherm!",
                    Images    = new List <Image>()
                    {
                        new Image()
                        {
                            Path = "img/events/2/1.jpg"
                        }, new Image()
                        {
                            Path = "img/events/2/2.jpg"
                        }
                    }
                });

                mrspaghettiAalstEstablishment.Promotions.Add(new Promotion()
                {
                    StartDate = DateTime.Today, EndDate = DateTime.Today.AddDays(10).AddHours(5),
                    Name      = "€ 5 korting op spaghetti",
                    Message   = "€ 5 korting op een spaghetti naar keuze bij het vermelden van de couponcode 'Spaghet5'.",
                    Images    = new List <Image>()
                    {
                        new Image()
                        {
                            Path = "img/promotions/1/1.jpg"
                        }, new Image()
                        {
                            Path = "img/promotions/1/2.jpg"
                        }
                    },
                    Attachments = new List <File>()
                    {
                        new File()
                        {
                            Name = "QR-code", Path = "files/promotions/1/1.pdf"
                        }
                    }
                });

                mrspaghettiCompany.Establishments.Add(mrspaghettiAalstEstablishment);
                //-------
                Establishment fnacAalstEstablishment = new Establishment()
                {
                    Name = "Fnac Aalst", Description = "Ontdek onze nieuwe Fnac winkel, en vind al je onmisbare artikelen: Boeken, CD's, Computers, Telefoons en nog veel meer.", PostalCode = "9300", City = "Aalst", Street = "Kattestraat", HouseNumber = "17", Latitude = 50.939538, Longitude = 4.037435
                };

                fnacAalstEstablishment.EstablishmentCategories.Add(new EstablishmentCategory()
                {
                    Category = winkelCategory
                });

                fnacAalstEstablishment.EstablishmentSocialMedias.Add(new EstablishmentSocialMedia()
                {
                    SocialMedia = facebookSocialMedia, Url = "https://www.facebook.com/FnacAalst/"
                });
                fnacAalstEstablishment.EstablishmentSocialMedias.Add(new EstablishmentSocialMedia()
                {
                    SocialMedia = twitterSocialMedia, Url = "https://twitter.com/fnacbelgie"
                });

                fnacAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/2/1.jpg"
                });
                fnacAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/2/2.jpg"
                });
                fnacAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/2/3.jpg"
                });

                fnacAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 0, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 18, EndMinute = 00
                        }
                    }
                });
                fnacAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 1, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 18, EndMinute = 00
                        }
                    }
                });
                fnacAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 2, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 18, EndMinute = 00
                        }
                    }
                });
                fnacAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 3, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 18, EndMinute = 00
                        }
                    }
                });
                fnacAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 4, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 18, EndMinute = 00
                        }
                    }
                });
                fnacAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 5, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 18, EndMinute = 00
                        }
                    }
                });
                fnacAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 6
                });

                fnacAalstEstablishment.ExceptionalDays.Add(new ExceptionalDay()
                {
                    Day = DateTime.Today.AddDays(2), Message = "Gesloten wegens werken"
                });

                fnacAalstEstablishment.Promotions.Add(new Promotion()
                {
                    StartDate = DateTime.Today.AddDays(12), EndDate = DateTime.Today.AddDays(16),
                    Name      = "Week van de smartphone.",
                    Message   = "Tot wel 50% korting op ons assortiment smartphones. Kom eens binnen en ontdek welk toestel onze experts u aanbevelen.",
                    Images    = new List <Image>()
                    {
                        new Image()
                        {
                            Path = "img/promotions/2/1.jpg"
                        }, new Image()
                        {
                            Path = "img/promotions/2/2.jpg"
                        }
                    }
                });

                fnacCompany.Establishments.Add(fnacAalstEstablishment);
                //-------
                Establishment safirAalstEstablishment = new Establishment()
                {
                    Name = "Café Safir", Description = "Het café van Aalst voor jong en oud! Verschillende snack en lunch mogelijkheden aanwezig.", PostalCode = "9300", City = "Aalst", Street = "Grote Markt", HouseNumber = "22", Latitude = 50.938424, Longitude = 4.038867
                };

                safirAalstEstablishment.EstablishmentCategories.Add(new EstablishmentCategory()
                {
                    Category = cafeCategory
                });
                safirAalstEstablishment.EstablishmentCategories.Add(new EstablishmentCategory()
                {
                    Category = restrauntCategory
                });

                safirAalstEstablishment.EstablishmentSocialMedias.Add(new EstablishmentSocialMedia()
                {
                    SocialMedia = facebookSocialMedia, Url = "https://www.facebook.com/pages/category/Cafe/Safir-188724374609159/"
                });
                safirAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/3/1.jpg"
                });
                safirAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/3/2.jpg"
                });
                safirAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/3/3.jpg"
                });

                safirAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 0, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 0, EndMinute = 00
                        }
                    }
                });
                safirAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 1, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 0, EndMinute = 00
                        }
                    }
                });
                safirAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 2, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 0, EndMinute = 00
                        }
                    }
                });
                safirAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 3, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 0, EndMinute = 00
                        }
                    }
                });
                safirAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 4, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 0, EndMinute = 00
                        }
                    }
                });
                safirAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 5, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 9, Startminute = 30, EndHour = 0, EndMinute = 00
                        }
                    }
                });
                safirAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 6
                });

                safirAalstEstablishment.Promotions.Add(new Promotion()
                {
                    StartDate = DateTime.Today.AddDays(2), EndDate = DateTime.Today.AddDays(2).AddHours(5),
                    Name      = "Happy hours!",
                    Message   = "2 pintjes voor de prijs van 1!",
                    Images    = new List <Image>()
                    {
                        new Image()
                        {
                            Path = "img/promotions/3/1.jpg"
                        }, new Image()
                        {
                            Path = "img/promotions/3/2.jpg"
                        }
                    }
                });

                safirCompany.Establishments.Add(safirAalstEstablishment);
                //-------
                Establishment hogentAalstEstablishment = new Establishment()
                {
                    Name = "HoGent Campus Aalst", Description = "De hogeschool Gent Campus Aalst inspireert en stimuleert mensen om, op eigen wijze, het verschil te maken in en voor de samenleving.", PostalCode = "9300", City = "Aalst", Street = "Arbeidstraat", HouseNumber = "14", Latitude = 51.141550, Longitude = 4.559644
                };

                hogentAalstEstablishment.EstablishmentCategories.Add(new EstablishmentCategory()
                {
                    Category = schoolCategory
                });

                hogentAalstEstablishment.EstablishmentSocialMedias.Add(new EstablishmentSocialMedia()
                {
                    SocialMedia = facebookSocialMedia, Url = "https://www.facebook.com/HoGentCampusAalst/"
                });
                hogentAalstEstablishment.EstablishmentSocialMedias.Add(new EstablishmentSocialMedia()
                {
                    SocialMedia = twitterSocialMedia, Url = "https://twitter.com/hogeschool_gent"
                });
                hogentAalstEstablishment.EstablishmentSocialMedias.Add(new EstablishmentSocialMedia()
                {
                    SocialMedia = instagramSocialMedia, Url = "https://www.instagram.com/explore/locations/420243736/hogent-stadscampus-aalst"
                });

                hogentAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/4/1.jpg"
                });
                hogentAalstEstablishment.Images.Add(new Image()
                {
                    Path = "img/establishments/4/2.jpg"
                });

                hogentAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 0, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 8, Startminute = 30, EndHour = 12, EndMinute = 00
                        }, new OpenHour()
                        {
                            StartHour = 13, Startminute = 00, EndHour = 16, EndMinute = 30
                        }
                    }
                });
                hogentAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 1, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 8, Startminute = 30, EndHour = 12, EndMinute = 00
                        }, new OpenHour()
                        {
                            StartHour = 13, Startminute = 00, EndHour = 16, EndMinute = 30
                        }
                    }
                });
                hogentAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 2, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 8, Startminute = 30, EndHour = 12, EndMinute = 00
                        }
                    }
                });
                hogentAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 3, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 8, Startminute = 30, EndHour = 12, EndMinute = 00
                        }, new OpenHour()
                        {
                            StartHour = 13, Startminute = 00, EndHour = 16, EndMinute = 30
                        }
                    }
                });
                hogentAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 4, OpenHours = new List <OpenHour>()
                    {
                        new OpenHour()
                        {
                            StartHour = 8, Startminute = 30, EndHour = 12, EndMinute = 00
                        }
                    }
                });
                hogentAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 5
                });
                hogentAalstEstablishment.OpenDays.Add(new OpenDay()
                {
                    DayOfTheWeek = 6
                });

                hogentAalstEstablishment.Events.Add(new Event()
                {
                    StartDate = new DateTime(2019, 3, 5).AddHours(14), EndDate = new DateTime(2019, 3, 8).AddHours(18),
                    Name      = "Open lessen dagen!",
                    Message   =
                        "Een goede manier om een toekomstige opleiding te kiezen, is gewoon komen proeven. Proeven van de leerstof, van de manier van lesgeven, van de sfeer op de campus. Gewoon een échte les meemaken tussen onze huidige studenten. Het aanbod aan Live! lessen is zeer divers. Pik eventueel ook een les mee uit een richting die je minder bekend in de oren klinkt.",
                    Images = new List <Image>()
                    {
                        new Image()
                        {
                            Path = "img/events/3/1.jpg"
                        }, new Image()
                        {
                            Path = "img/events/3/2.jpg"
                        }
                    },
                    Attachments = new List <File>()
                    {
                        new File()
                        {
                            Name = "Brochure Toegepaste Informatica", Path = "files/promotions/3/1.pdf"
                        }, new File()
                        {
                            Name = "Brochure bedrijfsmanagement", Path = "files/promotions/3/2.pdf"
                        }
                    }
                });

                hogentCompany.Establishments.Add(hogentAalstEstablishment);
                // END ESTABLISHMENT

                // START ASSIGNING COMPANY TO MERCHANT
                merchantRestaurantSpaghetti.Companies.Add(mrspaghettiCompany);
                merchantWinkelFnac.Companies.Add(fnacCompany);
                merchantCafeSafir.Companies.Add(safirCompany);
                merchantSchoolHoGent.Companies.Add(hogentCompany);
                // END ASSIGN COMPANY TO MERCHANT

                // START SUBSCRIPTIONS
                customerLennert.EstablishmentSubscriptions.Add(new EstablishmentSubscription()
                {
                    DateAdded = DateTime.Today.AddDays(-10), Establishment = fnacAalstEstablishment
                });
                customerLennert.EstablishmentSubscriptions.Add(new EstablishmentSubscription()
                {
                    DateAdded = DateTime.Today.AddDays(-4), Establishment = hogentAalstEstablishment
                });
                customerBram.EstablishmentSubscriptions.Add(new EstablishmentSubscription()
                {
                    DateAdded = DateTime.Today.AddDays(-8), Establishment = fnacAalstEstablishment
                });
                customerBram.EstablishmentSubscriptions.Add(new EstablishmentSubscription()
                {
                    DateAdded = DateTime.Today.AddDays(-3), Establishment = mrspaghettiAalstEstablishment
                });
                customerJodi.EstablishmentSubscriptions.Add(new EstablishmentSubscription()
                {
                    DateAdded = DateTime.Today.AddDays(-6), Establishment = safirAalstEstablishment
                });
                customerJodi.EstablishmentSubscriptions.Add(new EstablishmentSubscription()
                {
                    DateAdded = DateTime.Today.AddDays(-1), Establishment = mrspaghettiAalstEstablishment
                });
                // END SUBSCRIPTIONS

                // BEGIN SAVE CHANGES
                _dbContext.Categories.AddRange(categories);
                _dbContext.Roles.AddRange(roles);
                _dbContext.Merchants.AddRange(merchants);
                _dbContext.Customers.AddRange(customers);
                _dbContext.SaveChanges();
                _dbContext.SocialMedias.AddRange(socialsMedias);
                // END SAVE CHANGES
            }
        }
示例#13
0
 public ProfileSignedInEventArgs(SocialMedia socialMedia, dynamic parameters)
 {
     SocialMedia = socialMedia;
     Parameters  = parameters;
 }
 public ActionResult Add(SocialMedia s)
 {
     repos.TAdd(s);
     return(RedirectToAction("Index"));
 }
 public IActionResult UpdateSocialMedia(SocialMedia socialMedia)
 {
     _userService.UpdateSocialMedia(socialMedia);
     return(Ok());
 }
示例#16
0
        protected void FormatPoliticianRow(DataRow row)
        {
            var politicianKey = row.PoliticianKey();

            var tr = new HtmlTableRow().AddTo(CurrentHtmlTable, "trReportDetail");

            CreatePoliticianImageTag(politicianKey, ImageSize100).AddTo(
                new HtmlTableCell().AddTo(tr, "tdReportDetailLargeBold"));

            // Information We Have
            //var infoLines = new List<string>();

            var tdInfo = new HtmlTableCell().AddTo(tr, "tdReportDetailSmall");

            // Age, Phone, Address, Social Media
            var politicianAge = row.Age();

            if (string.IsNullOrWhiteSpace(politicianAge))
            {
                AddItem(tdInfo, "No DOB to compute age", Options.Strong | Options.Em);
                new HtmlBreak().AddTo(tdInfo);
            }
            else
            {
                AddItem(tdInfo, "Age " + politicianAge);
            }

            new HtmlBreak().AddTo(tdInfo);
            var politicianPhone = row.PublicPhone();

            if (string.IsNullOrWhiteSpace(politicianPhone))
            {
                AddItem(tdInfo, "No Phone", Options.Strong);
            }
            else
            {
                AddItem(tdInfo, politicianPhone.NormalizePhoneNumber(), Options.NoBreak);
            }

            new HtmlBreak().AddTo(tdInfo);
            var politicianAddress = row.PublicAddress();

            if (string.IsNullOrWhiteSpace(politicianAddress))
            {
                AddItem(tdInfo, "No Address", Options.Strong);
            }
            else
            {
                AddItem(tdInfo, politicianAddress);
                new HtmlBreak().AddTo(tdInfo);
                AddItem(tdInfo, row.PublicCityStateZip());
            }

            int socialMediaCount;
            var socialMediaAnchors = SocialMedia.GetAnchors(row, out socialMediaCount);

            new HtmlBreak(2).AddTo(tdInfo);
            if (socialMediaCount == 0)
            {
                AddItem(tdInfo, "No social media links or email address", Options.Strong | Options.Em);
                new HtmlBreak().AddTo(tdInfo);
            }
            else
            {
                socialMediaAnchors.AddTo(tdInfo);
            }

            // Web address
            new HtmlBreak().AddTo(tdInfo);
            var webAddress = row.PublicWebAddress();

            if (string.IsNullOrWhiteSpace(webAddress))
            {
                AddItem(tdInfo, "No web address", Options.Strong | Options.Em);
            }
            else
            {
                new HtmlAnchor
                {
                    HRef      = VotePage.NormalizeUrl(webAddress),
                    Target    = "website",
                    InnerHtml = "Have web address"
                }
            }.AddTo(tdInfo);
 public void AddSocialMedia(SocialMedia socialMedia)
 {
     _userDAL.AddSocialMedia(socialMedia);
 }
示例#18
0
        private Card RandomCard(Vector2 position, bool front, int playerID)
        {
            Card c = null;

            if (Globals.r.Next(4) == 0)
            {
                int cardsCount = 31;
                int rn         = Globals.r.Next(cardsCount);
                switch (rn)
                {
                case 0:
                    c = new Actor(position, front, playerID);
                    break;

                case 1:
                    c = new Artist(position, front, playerID);
                    break;

                case 2:
                    c = new Astrophysicist(position, front, playerID);
                    break;

                case 3:
                    c = new Babysitter(position, front, playerID);
                    break;

                case 4:
                    c = new BabysitterU(position, front, playerID);
                    break;

                case 5:
                    c = new BusDriver(position, front, playerID);
                    break;

                case 6:
                    c = new Conman(position, front, playerID);
                    break;

                case 7:
                    c = new DeliveryPerson(position, front, playerID);
                    break;

                case 8:
                    c = new DrugDealer(position, front, playerID);
                    break;

                case 9:
                    c = new FastFoodEmployee(position, front, playerID);
                    break;

                case 10:
                    c = new Hacker(position, front, playerID);
                    break;

                case 11:
                    c = new Hitman(position, front, playerID);
                    break;

                case 12:
                    c = new HumanTrafficker(position, front, playerID);
                    break;

                case 13:
                    c = new IndieGameDev(position, front, playerID);
                    break;

                case 14:
                    c = new Influencer(position, front, playerID);
                    break;

                case 15:
                    c = new InstaModel(position, front, playerID);
                    break;

                case 16:
                    c = new InternDev(position, front, playerID);
                    break;

                case 17:
                    c = new JuniorDev(position, front, playerID);
                    break;

                case 18:
                    c = new Musician(position, front, playerID);
                    break;

                case 19:
                    c = new OnlyFans(position, front, playerID);
                    break;

                case 20:
                    c = new Referee(position, front, playerID);
                    break;

                case 21:
                    c = new RiceFarmer(position, front, playerID);
                    break;

                case 22:
                    c = new Santa(position, front, playerID);
                    break;

                case 23:
                    c = new Shelfstacker(position, front, playerID);
                    break;

                case 24:
                    c = new Shoplifter(position, front, playerID);
                    break;

                case 25:
                    c = new Sporter(position, front, playerID);
                    break;

                case 27:
                    c = new Streamer(position, front, playerID);
                    break;

                case 28:
                    c = new SugarDaddy(position, front, playerID);
                    break;

                case 29:
                    c = new TaxiDriver(position, front, playerID);
                    break;

                case 30:
                    c = new Writer(position, front, playerID);
                    break;

                case 26:
                    c = new YogaInstructor(position, front, playerID);
                    break;
                }
            }
            else
            {
                int cardsCount = 12;
                int rn         = Globals.r.Next(cardsCount);
                switch (rn)
                {
                case 0:
                    c = new Alcohol(position, front, playerID);
                    break;

                case 1:
                    c = new Drugs(position, front, playerID);
                    break;

                case 2:
                    c = new EatingOut(position, front, playerID);
                    break;

                case 3:
                    c = new FastFood(position, front, playerID);
                    break;

                case 4:
                    c = new Gambling(position, front, playerID);
                    break;

                case 5:
                    c = new Gaming(position, front, playerID);
                    break;

                case 6:
                    c = new Joint(position, front, playerID);
                    break;

                case 7:
                    c = new PomXML(position, front, playerID);
                    break;

                case 8:
                    c = new Shopping(position, front, playerID);
                    break;

                case 9:
                    c = new Smoking(position, front, playerID);
                    break;

                case 10:
                    c = new SocialMedia(position, front, playerID);
                    break;

                case 11:
                    c = new Streaming(position, front, playerID);
                    break;
                }
            }

            return(c);
        }
 public void UpdateSocialMedia(SocialMedia socialMedia)
 {
     _userDAL.UpdateSocialMedia(socialMedia);
 }
 public IResult Add(SocialMedia socialMedia)
 {
     _socialDal.Add(socialMedia);
     return(new SuccessResult(Messages.SocialMediaAdded));
 }
示例#21
0
 public void UpdateSocialMedia(SocialMedia socialMedia)
 {
     unitOfWork.SocialMediaRepository.Update(socialMedia);
     unitOfWork.Save();
 }
 public IResult Update(SocialMedia socialMedia)
 {
     _socialDal.Update(socialMedia);
     return(new SuccessResult(Messages.SocialMediaUpdated));
 }
        public override void Execute()
        {
            #line 8 "..\..\Views\Team.cshtml"

            var authorizedToEdit = Model.IsAuthorized[AuthorizedAction.EditTeam] || Model.IsAuthorized[AuthorizedAction.DeleteTeam];
            Html.RequiresJs("~/js/show-all-competitions.js");


            #line default
            #line hidden
            WriteLiteral("\r\n<div");

            WriteLiteral(" class=\"container-xl\"");

            WriteLiteral(">\r\n    <h1>");


            #line 13 "..\..\Views\Team.cshtml"
            Write(Model.Team.TeamNameLocationAndPlayerType());


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");


            #line 15 "..\..\Views\Team.cshtml"


            #line default
            #line hidden

            #line 15 "..\..\Views\Team.cshtml"
            if (Model.Team.UntilYear.HasValue)
            {
            #line default
            #line hidden
                WriteLiteral("        <div");

                WriteLiteral(" class=\"alert alert-info\"");

                WriteLiteral(">\r\n            <p><strong>This team is no longer active.</strong></p>\r\n        </" +
                             "div>\r\n");


            #line 20 "..\..\Views\Team.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n    <ul");

            WriteAttribute("class", Tuple.Create(" class=\"", 710), Tuple.Create("\"", 787)
                           , Tuple.Create(Tuple.Create("", 718), Tuple.Create("nav", 718), true)
                           , Tuple.Create(Tuple.Create(" ", 721), Tuple.Create("nav-tabs", 722), true)

            #line 22 "..\..\Views\Team.cshtml"
                           , Tuple.Create(Tuple.Create("", 730), Tuple.Create <System.Object, System.Int32>(authorizedToEdit ? " nav-tabs-has-edit" : string.Empty

            #line default
            #line hidden
                                                                                                            , 730), false)
                           );

            WriteLiteral(">\r\n        <li");

            WriteLiteral(" class=\"nav-item\"");

            WriteLiteral(">\r\n            <em");

            WriteLiteral(" class=\"nav-link active\"");

            WriteLiteral(">Summary</em>\r\n        </li>\r\n        <li");

            WriteLiteral(" class=\"nav-item\"");

            WriteLiteral(">\r\n            <a");

            WriteLiteral(" class=\"nav-link\"");

            WriteAttribute("href", Tuple.Create(" href=\"", 953), Tuple.Create("\"", 989)

            #line 27 "..\..\Views\Team.cshtml"
                           , Tuple.Create(Tuple.Create("", 960), Tuple.Create <System.Object, System.Int32>(Model.Team.TeamRoute

            #line default
            #line hidden
                                                                                                            , 960), false)
                           , Tuple.Create(Tuple.Create("", 981), Tuple.Create("/matches", 981), true)
                           );

            WriteLiteral(">Matches</a>\r\n        </li>\r\n        <li");

            WriteLiteral(" class=\"nav-item\"");

            WriteLiteral(">\r\n            <a");

            WriteLiteral(" class=\"nav-link\"");

            WriteAttribute("href", Tuple.Create(" href=\"", 1081), Tuple.Create("\"", 1117)

            #line 30 "..\..\Views\Team.cshtml"
                           , Tuple.Create(Tuple.Create("", 1088), Tuple.Create <System.Object, System.Int32>(Model.Team.TeamRoute

            #line default
            #line hidden
                                                                                                             , 1088), false)
                           , Tuple.Create(Tuple.Create("", 1109), Tuple.Create("/players", 1109), true)
                           );

            WriteLiteral(">Players</a>\r\n        </li>\r\n        <li");

            WriteLiteral(" class=\"nav-item\"");

            WriteLiteral(">\r\n            <a");

            WriteLiteral(" class=\"nav-link\"");

            WriteAttribute("href", Tuple.Create(" href=\"", 1209), Tuple.Create("\"", 1248)

            #line 33 "..\..\Views\Team.cshtml"
                           , Tuple.Create(Tuple.Create("", 1216), Tuple.Create <System.Object, System.Int32>(Model.Team.TeamRoute

            #line default
            #line hidden
                                                                                                             , 1216), false)
                           , Tuple.Create(Tuple.Create("", 1237), Tuple.Create("/statistics", 1237), true)
                           );

            WriteLiteral(">Statistics</a>\r\n        </li>\r\n");


            #line 35 "..\..\Views\Team.cshtml"


            #line default
            #line hidden

            #line 35 "..\..\Views\Team.cshtml"
            if (authorizedToEdit)
            {
            #line default
            #line hidden
                WriteLiteral("            <li");

                WriteLiteral(" class=\"nav-item nav-item-admin\"");

                WriteLiteral(">\r\n                <a");

                WriteLiteral(" class=\"nav-link nav-link-edit\"");

                WriteAttribute("href", Tuple.Create(" href=\"", 1423), Tuple.Create("\"", 1456)

            #line 38 "..\..\Views\Team.cshtml"
                               , Tuple.Create(Tuple.Create("", 1430), Tuple.Create <System.Object, System.Int32>(Model.Team.TeamRoute

            #line default
            #line hidden
                                                                                                                 , 1430), false)
                               , Tuple.Create(Tuple.Create("", 1451), Tuple.Create("/edit", 1451), true)
                               );

                WriteLiteral(">Edit team</a>\r\n            </li>\r\n");


            #line 40 "..\..\Views\Team.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </ul>\r\n\r\n");

            WriteLiteral("    ");


            #line 43 "..\..\Views\Team.cshtml"
            Write(Html.Raw(Model.Team.Introduction));


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n");


            #line 45 "..\..\Views\Team.cshtml"


            #line default
            #line hidden

            #line 45 "..\..\Views\Team.cshtml"
            if (Model.Team.MatchLocations.Count > 0 || !string.IsNullOrWhiteSpace(Model.Team.PlayingTimes))
            {
            #line default
            #line hidden
                WriteLiteral("        <h2>When and where</h2>\r\n");


            #line 48 "..\..\Views\Team.cshtml"
                if (Model.Team.MatchLocations.Count > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("            <p>This team plays at ");


            #line 50 "..\..\Views\Team.cshtml"
                    Write(Html.Raw(Model.Team.MatchLocations.Humanize(x => $"<a href=\"{Html.Encode(x.MatchLocationRoute)}\">{Html.Encode(x.NameAndLocalityOrTownIfDifferent())}</a>")));


            #line default
            #line hidden
                    WriteLiteral(".</p>\r\n");


            #line 51 "..\..\Views\Team.cshtml"
                }
                if (!string.IsNullOrWhiteSpace(Model.Team.PlayingTimes))
                {
            #line default
            #line hidden

            #line 54 "..\..\Views\Team.cshtml"
                    Write(Html.Raw(Model.Team.PlayingTimes));


            #line default
            #line hidden

            #line 54 "..\..\Views\Team.cshtml"
                }
            }


            #line default
            #line hidden
            WriteLiteral("\r\n");


            #line 58 "..\..\Views\Team.cshtml"


            #line default
            #line hidden

            #line 58 "..\..\Views\Team.cshtml"

            var seasonListModel = new SeasonListViewModel
            {
                ShowCompetitionHeading = true
            };
            seasonListModel.Competitions.AddRange(Model.Team.Seasons
                                                  .GroupBy(x => x.Season.Competition.CompetitionId)
                                                  .Select(seasonsInACompetition =>
            {
                var competition = seasonsInACompetition.First().Season.Competition;
                competition.Seasons.AddRange(seasonsInACompetition.Select(season => season.Season));
                return(competition);
            })
                                                  .OrderByDescending(x => x.Seasons.First().FromYear).ThenByDescending(x => x.Seasons.First().UntilYear).ThenBy(x => x.ComparableName()));



            #line default
            #line hidden

            #line 73 "..\..\Views\Team.cshtml"
            Write(Html.Partial("_SeasonListExpandable", seasonListModel));


            #line default
            #line hidden

            #line 73 "..\..\Views\Team.cshtml"
            ;


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n");


            #line 76 "..\..\Views\Team.cshtml"


            #line default
            #line hidden

            #line 76 "..\..\Views\Team.cshtml"
            if (!string.IsNullOrWhiteSpace(Model.Team.Cost))
            {
            #line default
            #line hidden
                WriteLiteral("        <h2>How much does it cost?</h2>\r\n");


            #line 79 "..\..\Views\Team.cshtml"


            #line default
            #line hidden

            #line 79 "..\..\Views\Team.cshtml"
                Write(Html.Raw(Model.Team.Cost));


            #line default
            #line hidden

            #line 79 "..\..\Views\Team.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n    <h2>Contact details</h2>\r\n");


            #line 83 "..\..\Views\Team.cshtml"


            #line default
            #line hidden

            #line 83 "..\..\Views\Team.cshtml"

            var socialMedia = new SocialMedia
            {
                DisplayName = Model.Team.TeamName,
                Facebook    = Model.Team.Facebook,
                Twitter     = Model.Team.Twitter,
                Instagram   = Model.Team.Instagram,
                YouTube     = Model.Team.YouTube
            };
            if (!string.IsNullOrWhiteSpace(Model.Team.PublicContactDetails) || !string.IsNullOrWhiteSpace(Model.Team.Website) || socialMedia.HasSocialMedia())
            {
            #line default
            #line hidden

            #line 94 "..\..\Views\Team.cshtml"
                Write(Html.Raw(Model.Team.PublicContactDetails));


            #line default
            #line hidden

            #line 94 "..\..\Views\Team.cshtml"


                if (!string.IsNullOrWhiteSpace(Model.Team.Website))
                {
            #line default
            #line hidden
                    WriteLiteral("                <p>Visit <a");

                    WriteAttribute("href", Tuple.Create(" href=\"", 3711), Tuple.Create("\"", 3737)

            #line 98 "..\..\Views\Team.cshtml"
                                   , Tuple.Create(Tuple.Create("", 3718), Tuple.Create <System.Object, System.Int32>(Model.Team.Website

            #line default
            #line hidden
                                                                                                                     , 3718), false)
                                   );

                    WriteLiteral(">");


            #line 98 "..\..\Views\Team.cshtml"
                    Write(Model.Team.TeamName);


            #line default
            #line hidden
                    WriteLiteral("\'s website</a>.</p>\r\n");


            #line 99 "..\..\Views\Team.cshtml"
                }



            #line default
            #line hidden

            #line 101 "..\..\Views\Team.cshtml"
                Write(Html.Partial("_SocialMedia", socialMedia));


            #line default
            #line hidden

            #line 101 "..\..\Views\Team.cshtml"
            }
            else if (Model.Team.TeamType != TeamType.Representative)
            {
                // Prompt for more contact information, unless it's a representative team when we don't expect it


            #line default
            #line hidden

            #line 106 "..\..\Views\Team.cshtml"
                Write(Html.Partial("_ContactDetailsMissing", "team"));


            #line default
            #line hidden

            #line 106 "..\..\Views\Team.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n");


            #line 110 "..\..\Views\Team.cshtml"


            #line default
            #line hidden

            #line 110 "..\..\Views\Team.cshtml"
            if (Model.Team.ClubMark)
            {
            #line default
            #line hidden

            #line 112 "..\..\Views\Team.cshtml"
                Write(Html.Partial("_ClubMark"));


            #line default
            #line hidden

            #line 112 "..\..\Views\Team.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("</div>");
        }