public static OrganisationV ToOrganisationV(this OrganisationEditorViewModel editorViewModel, Guid ownerUserId, Guid modifiedUserId)
        {
            var newEntityV = BaseApprovableEntity.CreateNewVersion <OrganisationV>(ownerUserId, modifiedUserId);

            newEntityV.HeaderKey               = editorViewModel.HeaderKey;
            newEntityV.OrganisationName        = editorViewModel.OrganisationName;
            newEntityV.OrganisationDescription = editorViewModel.OrganisationDescription;
            newEntityV.ParentOrganisationGuid  = editorViewModel.ParentOrganisationGuid;
            newEntityV.CountryGuid             = editorViewModel.CountryGuid;
            newEntityV.WebAddress              = editorViewModel.WebAddress;
            newEntityV.EffectiveFrom           = editorViewModel.EffectiveFrom;

            return(newEntityV);
        }
        public static CountryV ToCountryV(this CountryEditorViewModel editorViewModel, Guid ownerUserId, Guid modifiedUserId)
        {
            var newEntityV = BaseApprovableEntity.CreateNewVersion <CountryV>(ownerUserId, modifiedUserId);

            newEntityV.HeaderKey        = editorViewModel.HeaderKey;
            newEntityV.CountryName      = editorViewModel.CountryName;
            newEntityV.OrganisationGuid = editorViewModel.OrganisationGuid;
            newEntityV.ResourceGuid     = editorViewModel.ResourceGuid;
            newEntityV.WebAddress       = editorViewModel.WebAddress;
            newEntityV.EffectiveFrom    = editorViewModel.EffectiveFrom;
            newEntityV.EffectiveTo      = editorViewModel.EffectiveTo;

            return(newEntityV);
        }
Exemplo n.º 3
0
        public static CompetitionV ToCompetitionV(this CompetitionEditorViewModel editorViewModel, Guid ownerUserId, Guid modifiedUserId)
        {
            var newEntityV = BaseApprovableEntity.CreateNewVersion <CompetitionV>(ownerUserId, modifiedUserId);

            newEntityV.HeaderKey           = editorViewModel.HeaderKey;
            newEntityV.CompetitionName     = editorViewModel.CompetitionName;
            newEntityV.CompetitionType     = editorViewModel.CompetitionType;
            newEntityV.OrganisationGuid    = editorViewModel.OrganisationGuid;
            newEntityV.Rank                = editorViewModel.Rank;
            newEntityV.CampaignPeriodType  = PeriodType.Year;
            newEntityV.CampaignPeriodValue = 1;
            newEntityV.WebAddress          = editorViewModel.WebAddress;
            newEntityV.EffectiveFrom       = editorViewModel.EffectiveFrom;
            newEntityV.EffectiveTo         = editorViewModel.EffectiveTo;

            return(newEntityV);
        }
Exemplo n.º 4
0
        public static PersonV ToPersonV(this PersonEditorViewModel editorViewModel, Guid ownerUserId, Guid modifiedUserId)
        {
            var newEntityV = BaseApprovableEntity.CreateNewVersion <PersonV>(ownerUserId, modifiedUserId);

            newEntityV.HeaderKey     = editorViewModel.HeaderKey;
            newEntityV.Forenames     = editorViewModel.Forenames;
            newEntityV.Surname       = editorViewModel.Surname;
            newEntityV.SearchText    = newEntityV.SetSearchText();
            newEntityV.DateOfBirth   = editorViewModel.DateOfBirth;
            newEntityV.DateOfDeath   = editorViewModel.DateOfDeath;
            newEntityV.CountryGuid   = editorViewModel.CountryGuid;
            newEntityV.Height        = editorViewModel.Height;
            newEntityV.WebAddress    = editorViewModel.WebAddress;
            newEntityV.EffectiveFrom = editorViewModel.EffectiveFrom;
            newEntityV.EffectiveTo   = editorViewModel.EffectiveTo;

            return(newEntityV);
        }
        public static VenueV ToVenueV(this VenueEditorViewModel editorViewModel, Guid ownerUserId, Guid modifiedUserId)
        {
            var newEntityV = BaseApprovableEntity.CreateNewVersion <VenueV>(ownerUserId, modifiedUserId);

            newEntityV.HeaderKey     = editorViewModel.HeaderKey;
            newEntityV.VenueName     = editorViewModel.VenueName;
            newEntityV.Capacity      = editorViewModel.Capacity;
            newEntityV.Address1      = editorViewModel.Address1;
            newEntityV.Address2      = editorViewModel.Address2;
            newEntityV.Address3      = editorViewModel.Address3;
            newEntityV.Address4      = editorViewModel.Address4;
            newEntityV.PostCode      = editorViewModel.PostCode;
            newEntityV.CountryGuid   = editorViewModel.CountryGuid;
            newEntityV.WebAddress    = editorViewModel.WebAddress;
            newEntityV.EffectiveFrom = editorViewModel.EffectiveFrom;
            newEntityV.EffectiveTo   = editorViewModel.EffectiveTo;

            return(newEntityV);
        }
Exemplo n.º 6
0
        public static MatchV ToMatchV(this MatchEditorViewModel editorViewModel, Guid ownerUserId, Guid modifiedUserId, Guid campaignStageGuid)
        {
            var newEntityV = BaseApprovableEntity.CreateNewVersion <MatchV>(ownerUserId, modifiedUserId);

            newEntityV.HeaderKey        = editorViewModel.HeaderKey;
            newEntityV.MatchDate        = editorViewModel.MatchDate.Date;
            newEntityV.MatchTimeTicks   = (editorViewModel.MatchDate - editorViewModel.MatchDate.Date).Ticks;
            newEntityV.CampaignStageKey = campaignStageGuid;
            newEntityV.VenueGuid        = editorViewModel.VenueGuid;
            newEntityV.Attendance       = editorViewModel.Attendance;
            newEntityV.Team1Guid        = editorViewModel.Team1Guid;
            newEntityV.Team1HT          = editorViewModel.Team1Ht;
            newEntityV.Team1FT          = editorViewModel.Team1Ft;
            newEntityV.Team2Guid        = editorViewModel.Team2Guid;
            newEntityV.Team2HT          = editorViewModel.Team2Ht;
            newEntityV.Team2FT          = editorViewModel.Team2Ft;
            newEntityV.WebAddress       = editorViewModel.WebAddress;
            newEntityV.EffectiveFrom    = Date.LowDate;
            newEntityV.EffectiveTo      = Date.HighDate;

            return(newEntityV);
        }
Exemplo n.º 7
0
        public static TeamV ToTeamV(this TeamEditorViewModel editorViewModel, Guid ownerUserId, Guid modifiedUserId)
        {
            var newEntityV = BaseApprovableEntity.CreateNewVersion <TeamV>(ownerUserId, modifiedUserId);

            newEntityV.HeaderKey = editorViewModel.HeaderKey;
            //newEntityV.TeamName = editorViewModel.TeamName;
            newEntityV.HomeVenueGuid = editorViewModel.HomeVenueGuid;
            newEntityV.CountryGuid   = editorViewModel.CountryGuid;
            newEntityV.ResourceGuid  = editorViewModel.ResourceGuid;
            newEntityV.WebAddress    = editorViewModel.WebAddress;
            newEntityV.EffectiveFrom = editorViewModel.EffectiveFrom;
            newEntityV.EffectiveTo   = editorViewModel.EffectiveTo;

            var teamNames = new List <TeamName>();

            if (!string.IsNullOrWhiteSpace(editorViewModel.EditorTeamNameNative))
            {
                teamNames.Add(new TeamName()
                {
                    PrimaryKey   = Guid.NewGuid(),
                    TeamVKey     = newEntityV.PrimaryKey,
                    TeamNameType = TeamNameType.Primary,
                    LanguageType = LanguageType.Native,
                    Description  = editorViewModel.EditorTeamNameNative.Trim()
                });
            }

            if (!string.IsNullOrWhiteSpace(editorViewModel.EditorTeamNameEnglish))
            {
                teamNames.Add(new TeamName()
                {
                    PrimaryKey   = Guid.NewGuid(),
                    TeamVKey     = newEntityV.PrimaryKey,
                    TeamNameType = TeamNameType.Primary,
                    LanguageType = LanguageType.English,
                    Description  = editorViewModel.EditorTeamNameEnglish.Trim()
                });
            }

            if (!string.IsNullOrWhiteSpace(editorViewModel.EditorShortname))
            {
                teamNames.Add(new TeamName()
                {
                    PrimaryKey   = Guid.NewGuid(),
                    TeamVKey     = newEntityV.PrimaryKey,
                    TeamNameType = TeamNameType.ShortName,
                    LanguageType = LanguageType.Native,
                    Description  = editorViewModel.EditorShortname.Trim()
                });
            }

            if (!string.IsNullOrWhiteSpace(editorViewModel.EditorNickname))
            {
                teamNames.Add(new TeamName()
                {
                    PrimaryKey   = Guid.NewGuid(),
                    TeamVKey     = newEntityV.PrimaryKey,
                    TeamNameType = TeamNameType.Nickname,
                    LanguageType = LanguageType.Native,
                    Description  = editorViewModel.EditorNickname.Trim()
                });
            }

            if (!string.IsNullOrWhiteSpace(editorViewModel.EditorFullName))
            {
                teamNames.Add(new TeamName()
                {
                    PrimaryKey   = Guid.NewGuid(),
                    TeamVKey     = newEntityV.PrimaryKey,
                    TeamNameType = TeamNameType.FullName,
                    LanguageType = LanguageType.Native,
                    Description  = editorViewModel.EditorFullName.Trim()
                });
            }

            newEntityV.TeamNames = teamNames;

            return(newEntityV);
        }