Exemplo n.º 1
0
        public override AccountPlaceRequest GetInstance(ISession session, ManagedSecurityContext sec)
        {
            AccountPlaceRequest instance = base.GetInstance(session, sec);

            instance.Message   = this.Message;
            instance.Submitted = this.Submitted;
            if (Id == 0)
            {
                instance.Type    = ManagedAccountPlaceType.Find(session, this.Type);
                instance.Place   = session.Load <Place>(PlaceId);
                instance.Account = GetOwner(session, AccountId, sec);
            }
            return(instance);
        }
Exemplo n.º 2
0
        public override AccountPlace GetInstance(ISession session, ManagedSecurityContext sec)
        {
            AccountPlace instance = base.GetInstance(session, sec);

            instance.Description = this.Description;
            instance.Type        = ManagedAccountPlaceType.Find(session, this.Type);

            if (Id == 0)
            {
                // the account and the place cannot be switched after the relationship is created
                instance.Account = GetOwner(session, AccountId, sec);
                instance.Place   = session.Load <Place>(PlaceId);
            }

            return(instance);
        }