internal MobileDevice(DataModel.MobileDevices entity) : base(entity) { Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited }
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(); }
/// <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)); }
/// <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(); }
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); }
/// <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(); }
/// <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); }
private void _InitGeoLocation(DataModel.Orders entity) { if (null != entity.X && null != entity.Y) _geoLocation = new Point(entity.X.Value, entity.Y.Value); }
internal FuelType(DataModel.FuelTypes entity) : base(entity) { Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited }
/// <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); }
internal Schedule(DataModel.Schedules entity) : base(entity) { }
internal Zone(DataModel.Zones entity) : base(entity) { }
internal DriverSpecialty(DataModel.DriverSpecialties entity) : base(entity) { Debug.Assert(0 < entity.CreationTime); // NOTE: must be inited }
private void _InitCapacities(DataModel.Orders entity, CapacitiesInfo capacitiesInfo) { _capacities = Capacities.CreateFromDBString(entity.Capacities, capacitiesInfo); _capacities.PropertyChanged += new PropertyChangedEventHandler(Capacities_PropertyChanged); }
/// <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); }
private void _InitCustomProperties(DataModel.Orders entity, OrderCustomPropertiesInfo info) { _customProperties = OrderCustomProperties.CreateFromDBString(entity.CustomProperties, info); _customProperties.PropertyChanged += new PropertyChangedEventHandler(CustomProperties_PropertyChanged); }
/// <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)); }
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); }
/// <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); }