Exemplo n.º 1
0
 /// <summary>
 /// Initializes geo location using entity data.
 /// </summary>
 /// <param name="entity">Entity data.</param>
 private void _InitGeoLocation(DataModel.Locations entity)
 {
     if (entity.X != null && entity.Y != null)
     {
         _geoLocation = new Point(entity.X.Value, entity.Y.Value);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes TimeWindow2 usind entity data.
        /// </summary>
        /// <param name="entity">Entity data.</param>
        private void _InitTimeWindow2(DataModel.Locations entity)
        {
            if (entity.OpenFrom2 != null && entity.OpenTo2 != null)
            {
                _SetTimeWindow2(entity);
            }
            else
            {
                _ClearTimeWindow2();
            }

            _timeWindow2.PropertyChanged += new PropertyChangedEventHandler(_TimeWindow2PropertyChanged);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <c>Location</c> class.
        /// </summary>
        /// <param name="entity">Entity data.</param>
        internal Location(DataModel.Locations entity)
            : base(entity)
        {
            Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited

            // Enable address validation.
            IsAddressValidationEnabled = true;

            // init holder objects
            _InitTimeWindow(entity);
            _InitTimeWindow2(entity);
            _InitAddress(entity);
            _InitGeoLocation(entity);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes Address property using entity data.
 /// </summary>
 /// <param name="entity">Entity data.</param>
 private void _InitAddress(DataModel.Locations entity)
 {
     Address.FullAddress      = entity.FullAddress;
     Address.Unit             = entity.Unit;
     Address.AddressLine      = entity.AddressLine;
     Address.Locality1        = entity.Locality1;
     Address.Locality2        = entity.Locality2;
     Address.Locality3        = entity.Locality3;
     Address.CountyPrefecture = entity.CountyPrefecture;
     Address.PostalCode1      = entity.PostalCode1;
     Address.PostalCode2      = entity.PostalCode2;
     Address.StateProvince    = entity.StateProvince;
     Address.Country          = entity.Country;
     Address.MatchMethod      = entity.Locator; // ToDo rename MatchMethod
     _SubscribeToAddressEvent();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Sets time window 2 using data from database.
 /// </summary>
 /// <param name="entity">Entity object Locations.</param>
 private void _SetTimeWindow2(DataModel.Locations entity)
 {
     _timeWindow2 =
         TimeWindow.CreateFromEffectiveTimes(new TimeSpan((long)entity.OpenFrom2),
                                             new TimeSpan((long)entity.OpenTo2));
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Locations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLocations(Locations locations)
 {
     base.AddObject("Locations", locations);
 }
 /// <summary>
 /// Create a new Locations object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static Locations CreateLocations(global::System.Guid id)
 {
     Locations locations = new Locations();
     locations.Id = id;
     return locations;
 }