Example #1
0
        Specway MaterializeSpecwayFromDto(SpecwayDTO specwayDTO)
        {
            var current = SpecwayFactory.CreateSpecway(specwayDTO.AccountId, specwayDTO.Name, specwayDTO.SourcePrivince, specwayDTO.SourceCity,
                                                       specwayDTO.SourceArea, specwayDTO.SourceAddress, specwayDTO.SourceTelehone, specwayDTO.SourceMobile, specwayDTO.DestCity, specwayDTO.DestCity1,
                                                       specwayDTO.DestCity2, specwayDTO.DestCity3, specwayDTO.HeadUrl, specwayDTO.CardPositiveUrl, specwayDTO.CardnegativeUrl, specwayDTO.BusinessUrl,
                                                       specwayDTO.Remark, specwayDTO.ViewCount, specwayDTO.SceneUrl1, specwayDTO.SceneUrl2, specwayDTO.SceneUrl3, specwayDTO.SceneUrl4, specwayDTO.SceneUrl5, specwayDTO.SceneUrl6, specwayDTO.SceneUrl7, specwayDTO.SceneUrl8, specwayDTO.SceneUrl9, specwayDTO.SceneUrl10, specwayDTO.SceneUrl11, specwayDTO.SceneUrl12, specwayDTO.SceneUrl13, specwayDTO.SceneUrl14, specwayDTO.SceneUrl15, specwayDTO.SceneUrl16, specwayDTO.SceneUrl17, specwayDTO.SceneUrl18, specwayDTO.Lng, specwayDTO.Lat
                                                       );

            current.ChangeCurrentIdentity(current.Id);

            return(current);
        }
Example #2
0
        /// <summary>
        /// news a account
        /// </summary>
        /// <param name="praiseDTO"></param>
        /// <returns></returns>
        public SpecwayDTO AddNewSpecway(SpecwayDTO specwayDTO)
        {
            //check preconditions
            if (specwayDTO == null)
            {
                throw new ArgumentException(Messages.warning_CannotAddSpecwayWithEmptyInformation);
            }

            //Create the entity and the required associated data
            var specway = SpecwayFactory.CreateSpecway(specwayDTO.AccountId, specwayDTO.Name, specwayDTO.SourcePrivince, specwayDTO.SourceCity,
                                                       specwayDTO.SourceArea, specwayDTO.SourceAddress, specwayDTO.SourceTelehone, specwayDTO.SourceMobile, specwayDTO.DestCity, specwayDTO.DestCity1,
                                                       specwayDTO.DestCity2, specwayDTO.DestCity3, specwayDTO.HeadUrl, specwayDTO.CardPositiveUrl, specwayDTO.CardnegativeUrl, specwayDTO.BusinessUrl,
                                                       specwayDTO.Remark, specwayDTO.ViewCount, specwayDTO.SceneUrl1, specwayDTO.SceneUrl2, specwayDTO.SceneUrl3, specwayDTO.SceneUrl4, specwayDTO.SceneUrl5, specwayDTO.SceneUrl6, specwayDTO.SceneUrl7, specwayDTO.SceneUrl8, specwayDTO.SceneUrl9, specwayDTO.SceneUrl10, specwayDTO.SceneUrl11, specwayDTO.SceneUrl12, specwayDTO.SceneUrl13, specwayDTO.SceneUrl14, specwayDTO.SceneUrl15, specwayDTO.SceneUrl16, specwayDTO.SceneUrl17, specwayDTO.SceneUrl18, specwayDTO.Lng, specwayDTO.Lat
                                                       );

            //save entity
            SaveSpecway(specway);

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