/// <summary>
        /// Convert a ProvinceList to a WebProvince array.
        /// </summary>
        /// <param name="provinces">The ProvinceList.</param>
        /// <returns>The WebProvince array.</returns>
        internal static List <WebProvince> GetProvinces(ProvinceList provinces)
        {
            Province           province;
            Int32              provinceIndex;
            WebProvince        webProvince;
            List <WebProvince> webProvinces;

            webProvinces = null;
            if (provinces.IsNotEmpty())
            {
                webProvinces = new List <WebProvince>();
                for (provinceIndex = 0; provinceIndex < provinces.Count; provinceIndex++)
                {
                    province       = provinces[provinceIndex];
                    webProvince    = new WebProvince();
                    webProvince.Id = province.Id;
#if DATA_SPECIFIED_EXISTS
                    webProvince.IdSpecified = true;
#endif
                    webProvince.Name           = province.Name;
                    webProvince.Identifier     = province.Identifier;
                    webProvince.IsProvincePart = province.IsProvincePart;
#if DATA_SPECIFIED_EXISTS
                    webProvince.IsProvincePartSpecified = true;
#endif
                    webProvince.PartOfProvinceId = province.PartOfProvinceId;
#if DATA_SPECIFIED_EXISTS
                    webProvince.PartOfProvinceIdSpecified = true;
#endif
                    webProvinces.Add(webProvince);
                }
            }
            return(webProvinces);
        }
Example #2
0
 private WebProvince GetProvince(Boolean refresh)
 {
     if (_province.IsNull() || refresh)
     {
         _province = GeographicManagerTest.GetOneProvince(GetContext());
     }
     return(_province);
 }
Example #3
0
 public WebProvinceTest()
 {
     _province = null;
 }