예제 #1
0
        public override void SetInstance(Place instance)
        {
            Name        = instance.Name;
            Type        = instance.Type.Name;
            Description = instance.Description;
            Created     = instance.Created;
            Modified    = instance.Modified;
            Street      = instance.Street;
            Zip         = instance.Zip;
            CrossStreet = instance.CrossStreet;
            Phone       = instance.Phone;
            Fax         = instance.Fax;
            Email       = instance.Email;
            if (instance.City != null)
            {
                City = instance.City.Name;
            }
            if (instance.City != null && instance.City.State != null)
            {
                State = instance.City.State.Name;
            }
            if (instance.City != null && instance.City.Country != null)
            {
                Country = instance.City.Country.Name;
            }
            if (instance.Neighborhood != null)
            {
                Neighborhood = instance.Neighborhood.Name;
            }
            PictureId = ManagedService <PlacePicture, TransitPlacePicture> .GetRandomElementId(instance.PlacePictures);

            AccountId = instance.Account.Id;
            base.SetInstance(instance);
        }
예제 #2
0
        public static int GetRandomAccountGroupPictureId(AccountGroup group)
        {
            if (group == null || group.AccountGroupPictures == null || group.AccountGroupPictures.Count == 0)
            {
                return(0);
            }

            return(ManagedService <AccountGroupPicture, TransitAccountGroupPicture> .GetRandomElementId(group.AccountGroupPictures));
        }
예제 #3
0
        public override void SetInstance(AccountStory value)
        {
            Name                  = value.Name;
            Summary               = value.Summary;
            AccountId             = value.Account.Id;
            AccountName           = value.Account.Name;
            AccountPictureId      = ManagedAccount.GetRandomAccountPictureId(value.Account);
            AccountStoryPictureId = ManagedService <AccountStoryPicture, TransitAccountStoryPicture> .GetRandomElementId(value.AccountStoryPictures);

            Created  = value.Created;
            Modified = value.Modified;
            Publish  = value.Publish;
            base.SetInstance(value);
        }
예제 #4
0
        public override void SetInstance(ScheduleInstance instance)
        {
            if (instance.Schedule.AccountEvents == null || instance.Schedule.AccountEvents.Count != 1)
            {
                throw new Exception(string.Format("Orphaned schedule instance {0}.", instance.Id));
            }

            AccountEvent evt = (AccountEvent)instance.Schedule.AccountEvents[0];

            AccountEventId   = evt.Id;
            AccountEventType = evt.AccountEventType.Name;
            Description      = evt.Description;
            Created          = evt.Created;
            Modified         = evt.Modified;
            AccountId        = evt.Account.Id;
            AccountName      = evt.Account.Name;
            ScheduleId       = evt.Schedule.Id;
            PlaceId          = evt.Place.Id;
            PlaceName        = evt.Place.Name;
            if (evt.Place.City != null)
            {
                PlaceCity = evt.Place.City.Name;
            }
            if (evt.Place.City != null && evt.Place.City.Country != null)
            {
                PlaceCountry = evt.Place.City.Country.Name;
            }
            if (evt.Place.City != null && evt.Place.City.State != null)
            {
                PlaceState = evt.Place.City.State.Name;
            }
            if (evt.Place.Neighborhood != null)
            {
                PlaceNeighborhood = evt.Place.Neighborhood.Name;
            }
            Name      = evt.Name;
            Phone     = evt.Phone;
            Email     = evt.Email;
            Website   = evt.Website;
            Cost      = evt.Cost;
            PictureId = ManagedService <AccountEventPicture, TransitAccountEventPicture> .GetRandomElementId(evt.AccountEventPictures);

            StartDateTime = instance.StartDateTime;
            EndDateTime   = instance.EndDateTime;
            Instance      = instance.Instance;
            NoEndDateTime = instance.Schedule.NoEndDateTime;

            base.SetInstance(instance);
        }
예제 #5
0
        public override void SetInstance(AccountPlace instance)
        {
            Type             = instance.Type.Name;
            Description      = instance.Description;
            Created          = instance.Created;
            Modified         = instance.Modified;
            AccountId        = instance.Account.Id;
            PlaceId          = instance.Place.Id;
            AccountName      = instance.Account.Name;
            PlaceName        = instance.Place.Name;
            AccountPictureId = ManagedAccount.GetRandomAccountPictureId(instance.Account);
            PlacePictureId   = ManagedService <PlacePicture, TransitPlacePicture> .GetRandomElementId(instance.Place.PlacePictures);

            CanWrite = instance.Type.CanWrite;
            base.SetInstance(instance);
        }
예제 #6
0
        public override void SetInstance(AccountEvent instance)
        {
            AccountEventType = instance.AccountEventType.Name;
            Description      = instance.Description;
            Created          = instance.Created;
            Modified         = instance.Modified;
            AccountId        = instance.Account.Id;
            AccountName      = instance.Account.Name;
            ScheduleId       = instance.Schedule.Id;
            PlaceId          = instance.Place.Id;
            PlaceName        = instance.Place.Name;
            if (instance.Place.City != null)
            {
                PlaceCity = instance.Place.City.Name;
            }
            if (instance.Place.City != null && instance.Place.City.Country != null)
            {
                PlaceCountry = instance.Place.City.Country.Name;
            }
            if (instance.Place.City != null && instance.Place.City.State != null)
            {
                PlaceState = instance.Place.City.State.Name;
            }
            if (instance.Place.Neighborhood != null)
            {
                PlaceNeighborhood = instance.Place.Neighborhood.Name;
            }
            Name      = instance.Name;
            Phone     = instance.Phone;
            Email     = instance.Email;
            Website   = instance.Website;
            Cost      = instance.Cost;
            Publish   = instance.Publish;
            PictureId = ManagedService <AccountEventPicture, TransitAccountEventPicture> .GetRandomElementId(instance.AccountEventPictures);

            base.SetInstance(instance);
        }
예제 #7
0
        public override void SetInstance(AccountGroupPlace instance)
        {
            Created               = instance.Created;
            AccountGroupId        = instance.AccountGroup.Id;
            PlaceId               = instance.Place.Id;
            AccountGroupName      = instance.AccountGroup.Name;
            PlaceName             = instance.Place.Name;
            AccountGroupPictureId = ManagedAccountGroup.GetRandomAccountGroupPictureId(instance.AccountGroup);
            PlacePictureId        = ManagedService <PlacePicture, TransitPlacePicture> .GetRandomElementId(instance.Place.PlacePictures);

            if (instance.Place.City != null)
            {
                PlaceCity = instance.Place.City.Name;
            }
            if (instance.Place.City != null && instance.Place.City.State != null)
            {
                PlaceState = instance.Place.City.State.Name;
            }
            if (instance.Place.City != null && instance.Place.City.Country != null)
            {
                PlaceCountry = instance.Place.City.Country.Name;
            }
            base.SetInstance(instance);
        }