示例#1
0
 public override void SetInstance(AccountGroup value)
 {
     Name          = value.Name;
     Description   = value.Description;
     Created       = value.Created;
     Modified      = value.Modified;
     IsPrivate     = value.IsPrivate;
     AccountBlogId = (value.AccountBlog != null) ? value.AccountBlog.Id : 0;
     if (!IsPrivate)
     {
         PictureId = ManagedAccountGroup.GetRandomAccountGroupPictureId(value);
     }
     base.SetInstance(value);
 }
示例#2
0
 public override void SetInstance(AccountGroupAccount value)
 {
     AccountId        = value.Account.Id;
     AccountName      = value.Account.Name;
     AccountPictureId = ManagedAccount.GetRandomAccountPictureId(value.Account);
     if (!value.AccountGroup.IsPrivate)
     {
         AccountGroupPictureId = ManagedAccountGroup.GetRandomAccountGroupPictureId(value.AccountGroup);
     }
     AccountGroupId   = value.AccountGroup.Id;
     AccountGroupName = value.AccountGroup.Name;
     IsAdministrator  = value.IsAdministrator;
     Created          = value.Created;
     Modified         = value.Modified;
     base.SetInstance(value);
 }
 public override void SetInstance(AccountGroupAccountInvitation value)
 {
     AccountId                = value.Account.Id;
     AccountName              = value.Account.Name;
     AccountPictureId         = ManagedAccount.GetRandomAccountPictureId(value.Account);
     RequesterId              = value.Requester.Id;
     RequesterIsAdministrator = ManagedAccountGroupAccountInvitation.IsRequesterAdministrator(value);
     RequesterName            = value.Requester.Name;
     RequesterPictureId       = ManagedAccount.GetRandomAccountPictureId(value.Requester);
     AccountGroupId           = value.AccountGroup.Id;
     AccountGroupName         = value.AccountGroup.Name;
     if (!value.AccountGroup.IsPrivate)
     {
         AccountGroupPictureId = ManagedAccountGroup.GetRandomAccountGroupPictureId(value.AccountGroup);
     }
     AccountGroupIsPrivate = value.AccountGroup.IsPrivate;
     Message  = value.Message;
     Created  = value.Created;
     Modified = value.Modified;
     base.SetInstance(value);
 }
示例#4
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);
        }