Ejemplo n.º 1
0
        Vip MaterializeVipFromDto(VipDTO vipDTO)
        {
            var current = VipFactory.CreateVip(vipDTO.CreateOn, vipDTO.EndDateTime, vipDTO.AccountId, vipDTO.Remark);

            current.ChangeCurrentIdentity(vipDTO.Id);

            return(current);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// news a account
        /// </summary>
        /// <param name="praiseDTO"></param>
        /// <returns></returns>
        public VipDTO AddNewVip(VipDTO vipDTO)
        {
            //check preconditions
            if (vipDTO == null)
            {
                throw new ArgumentException(Messages.warning_CannotAddVipWithEmptyInformation);
            }

            //Create the entity and the required associated data
            var vip = VipFactory.CreateVip(vipDTO.CreateOn, vipDTO.EndDateTime, vipDTO.AccountId, vipDTO.Remark);

            //save entity
            SaveVip(vip);

            //return the data with id and assigned default values
            return(vip.ProjectedAs <VipDTO>());
        }