internal MobileDevice(DataModel.MobileDevices entity)
     : base(entity)
 {
     Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited
 }
Example #2
0
 private void _InitAddress(DataModel.Orders 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();
 }
Example #3
0
 /// <summary>
 /// Sets time window using entity data.
 /// </summary>
 /// <param name="entity"></param>
 private void _SetTimeWindow(DataModel.Routes entity)
 {
     _timeWindow =
         TimeWindow.CreateFromEffectiveTimes(new TimeSpan((long)entity.WorkFrom),
                                             new TimeSpan((long)entity.WorkTo));
 }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <c>Route</c> class.
        /// </summary>
        /// <param name="entity">Entity initialize datas.</param>
        internal Route(DataModel.Routes entity)
            : base(entity)
        {
            Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited

            _InitTimeWindow(entity);
            _breaks = Breaks.CreateFromDBString(entity.Breaks);
            _days = Days.CreateFromDBString(entity.Days);

            // If collection is in schedule - remember it schedule.routes and
            // subscribe to collection changed event.
            if (this.Schedule != null)
            {
                this.Schedule.RoutesCollectionInitialized += _ScheduleRoutesCollectionInitialized;
            }

            _InitPropertiesEvents();
        }
Example #5
0
        internal Vehicle(DataModel.Vehicles entity)
            : base(entity)
        {
            Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited

            _SpecialtiesWrap.DataObjects.CollectionChanged += new NotifyCollectionChangedEventHandler(_Specialties_CollectionChanged);
            if (null != _MobileDeviceWrap.Value)
                _MobileDeviceWrap.Value.PropertyChanged += new PropertyChangedEventHandler(_MobileDevice_PropertyChanged);
        }
Example #6
0
 /// <summary>
 /// inits time window.
 /// </summary>
 /// <param name="entity">Entity data.</param>
 private void _InitTimeWindow(DataModel.Routes entity)
 {
     if ((null != entity.WorkFrom) && (null != entity.WorkTo))
         _SetTimeWindow(entity);
     else
         _ClearTimeWindow();
 }
Example #7
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);
 }
Example #8
0
 private void _InitGeoLocation(DataModel.Orders entity)
 {
     if (null != entity.X && null != entity.Y)
         _geoLocation = new Point(entity.X.Value, entity.Y.Value);
 }
Example #9
0
 internal FuelType(DataModel.FuelTypes entity)
     : base(entity)
 {
     Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited
 }
Example #10
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);
        }
Example #11
0
 internal Schedule(DataModel.Schedules entity)
     : base(entity)
 {
 }
Example #12
0
 internal Zone(DataModel.Zones entity)
     : base(entity)
 {
 }
 internal DriverSpecialty(DataModel.DriverSpecialties entity)
     : base(entity)
 {
     Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited
 }
Example #14
0
 private void _InitCapacities(DataModel.Orders entity, CapacitiesInfo capacitiesInfo)
 {
     _capacities = Capacities.CreateFromDBString(entity.Capacities, capacitiesInfo);
     _capacities.PropertyChanged += new PropertyChangedEventHandler(Capacities_PropertyChanged);
 }
Example #15
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);
        }
Example #16
0
 private void _InitCustomProperties(DataModel.Orders entity, OrderCustomPropertiesInfo info)
 {
     _customProperties = OrderCustomProperties.CreateFromDBString(entity.CustomProperties, info);
     _customProperties.PropertyChanged += new PropertyChangedEventHandler(CustomProperties_PropertyChanged);
 }
Example #17
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));
 }
Example #18
0
        internal Order(DataModel.Orders entity)
            : base(entity)
        {
            Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited

            // Enable address validation.
            IsAddressValidationEnabled = true;

            _InitTimeWindow(_Entity.TW1From, _Entity.TW1To, ref _timeWindow1);
            _InitTimeWindow(_Entity.TW2From, _Entity.TW2To, ref _timeWindow2);

            _timeWindow1.PropertyChanged += new PropertyChangedEventHandler(TimeWindow_PropertyChanged1);
            _timeWindow2.PropertyChanged += new PropertyChangedEventHandler(TimeWindow_PropertyChanged2);
            _VehicleSpecialtiesWrap.DataObjects.CollectionChanged += new NotifyCollectionChangedEventHandler(VehicleSpecialties_CollectionChanged);
            _DriverSpecialtiesWrap.DataObjects.CollectionChanged += new NotifyCollectionChangedEventHandler(DriverSpecialties_CollectionChanged);

            _InitAddress(entity);
            _InitGeoLocation(entity);
        }
Example #19
0
        /// <summary>
        /// Create and initializes a instance of the <c>Barrier</c> class.
        /// </summary>
        /// <param name="entity">Entity for initialization.</param>
        internal Barrier(DataModel.Barriers entity)
            : base(entity)
        {
            Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited

            _barrierEffect = BarrierEffect.CreateFromDBString(entity.BarrierType);

            _barrierEffect.PropertyChanged +=
                new PropertyChangedEventHandler(_BarrierEffect_PropertyChanged);
        }