Ejemplo n.º 1
0
        /// <summary>
        /// Создание нового объекта из старого с учётом требований транслитерации
        /// </summary>
        /// <param name="old">Старая информация об агентстве</param>
        /// <param name="latinRegistration">Необходимость транслитерации</param>
        public AgencyInfo(AgencyInfo old, bool latinRegistration = true)
        {
            Address = old.Address;
            if (latinRegistration)
            {
                Name = Transliteration.CyrillicToLatin(old.Name).ToUpper();

                if (Address != null)
                {
                    if (!string.IsNullOrEmpty(Address.City))
                    {
                        Address.City = Transliteration.CyrillicToLatin(Address.City).ToUpper();
                    }

                    if (!string.IsNullOrEmpty(Address.State))
                    {
                        Address.State = Transliteration.CyrillicToLatin(Address.State).ToUpper();
                    }

                    if (!string.IsNullOrEmpty(Address.StreetAddress))
                    {
                        Address.StreetAddress = Transliteration.CyrillicToLatin(Address.StreetAddress).ToUpper();
                    }
                }
            }
            else
            {
                Name = old.Name;
            }
        }
Ejemplo n.º 2
0
		/// <summary>
		/// Создание нового объекта из старого с учётом требований транслитерации
		/// </summary>
		/// <param name="old">Старая информация об агентстве</param>
		/// <param name="latinRegistration">Необходимость транслитерации</param>
		public AgencyInfo(AgencyInfo old, bool latinRegistration = true)
		{
			Address = old.Address;
			if (latinRegistration)
			{
				Name = Transliteration.UARUStoENG(old.Name).ToUpper();

				if (Address != null)
				{
					if (!string.IsNullOrEmpty(Address.City))
					{
						Address.City = Transliteration.UARUStoENG(Address.City).ToUpper();
					}

					if (!string.IsNullOrEmpty(Address.State))
					{
						Address.State = Transliteration.UARUStoENG(Address.State).ToUpper();
					}

					if (!string.IsNullOrEmpty(Address.StreetAddress))
					{
						Address.StreetAddress = Transliteration.UARUStoENG(Address.StreetAddress).ToUpper();
					}
				}
			}
			else
			{
				Name = old.Name;
			}
		}