示例#1
0
        public CountryDTO Update(CountryDTO oCountryDTO)
        {
            CountryDTO returnUserMap = null;
            if (oCountryDTO != null && oCountryDTO.CountryID > 0)
            {
                oCountryRepos.UpdateCountry(0, CountryAssembler.ToEntity(oCountryDTO));
                returnUserMap = oCountryDTO;
            }

            return returnUserMap;
        }
示例#2
0
        /// <summary>
        /// Converts this instance of <see cref="Country"/> to an instance of <see cref="CountryDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="Country"/> to convert.</param>
        public static CountryDTO ToDTO(this Country entity)
        {
            if (entity == null) return null;

            var dto = new CountryDTO();

            dto.CountryID = entity.CountryID;
            dto.Name = entity.Name;
            dto.Abbreviation = entity.Abbreviation;
            dto.Code = entity.Code;
            dto.PhoneCode = entity.PhoneCode;

            entity.OnDTO(dto);

            return dto;
        }
示例#3
0
        public AddressDTO(Int32 addressID, String title, String line1, String line2, String line3, String city, String state, String zipCode, Nullable<Int32> countryID, Nullable<Int32> addressTypeID, CountryDTO country, TypeCodeDTO typeCode, List<BusinessAddressDTO> businessAddresses, List<UserAddressDTO> userAddresses)
        {
			this.AddressID = addressID;
			this.Title = title;
			this.Line1 = line1;
			this.Line2 = line2;
			this.Line3 = line3;
			this.City = city;
			this.State = state;
			this.ZipCode = zipCode;
			this.CountryID = countryID;
			this.AddressTypeID = addressTypeID;
			this.Country = country;
			this.TypeCode = typeCode;
			this.BusinessAddresses = businessAddresses;
			this.UserAddresses = userAddresses;
        }
示例#4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="CountryDTO"/> converted from <see cref="Country"/>.</param>
 static partial void OnDTO(this Country entity, CountryDTO dto);
示例#5
0
 public AddressDTO(Int32 addressID, String title, String line1, String line2, String line3, String city, String state, String zipCode, Nullable <Int32> countryID, Nullable <Int32> addressTypeID, CountryDTO country, TypeCodeDTO typeCode, List <BusinessAddressDTO> businessAddresses, List <UserAddressDTO> userAddresses)
 {
     this.AddressID         = addressID;
     this.Title             = title;
     this.Line1             = line1;
     this.Line2             = line2;
     this.Line3             = line3;
     this.City              = city;
     this.State             = state;
     this.ZipCode           = zipCode;
     this.CountryID         = countryID;
     this.AddressTypeID     = addressTypeID;
     this.Country           = country;
     this.TypeCode          = typeCode;
     this.BusinessAddresses = businessAddresses;
     this.UserAddresses     = userAddresses;
 }