Beispiel #1
0
        /// <summary>
        /// The add operation schedule.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <returns>
        /// A LocationOperationSchedule.
        /// </returns>
        public virtual LocationOperationSchedule AddOperationSchedule(string name)
        {
            Check.IsNotNullOrWhitespace(name, "LocationOperationSchedule name is required.");

            LocationOperationSchedule locationOperationSchedule = null;
            var newLocationOperatingSchedule = new LocationOperationSchedule(name);

            DomainRuleEngine.CreateRuleEngine(this, "AddOperationSchedule")
            .WithContext(newLocationOperatingSchedule)
            .Execute(() =>
            {
                locationOperationSchedule          = newLocationOperatingSchedule;
                locationOperationSchedule.Location = this;
                _locationOperationSchedules.Add(locationOperationSchedule);
                NotifyItemAdded(() => LocationOperationSchedules, locationOperationSchedule);
            });

            return(locationOperationSchedule);
        }
Beispiel #2
0
 /// <summary>
 /// The remove operation schedule.
 /// </summary>
 /// <param name="locationOperationSchedule">
 /// The location operation schedule.
 /// </param>
 public virtual void RemoveOperationSchedule(LocationOperationSchedule locationOperationSchedule)
 {
     _locationOperationSchedules.Delete(locationOperationSchedule);
     NotifyItemRemoved(() => LocationOperationSchedules, locationOperationSchedule);
 }
Beispiel #3
0
        /// <summary>
        /// The add operation schedule.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <returns>
        /// A LocationOperationSchedule.
        /// </returns>
        public virtual LocationOperationSchedule AddOperationSchedule(string name)
        {
            Check.IsNotNullOrWhitespace(name, "LocationOperationSchedule name is required.");

            LocationOperationSchedule locationOperationSchedule = null;
            var newLocationOperatingSchedule = new LocationOperationSchedule ( name );

            DomainRuleEngine.CreateRuleEngine( this, "AddOperationSchedule" )
                .WithContext(newLocationOperatingSchedule)
                .Execute(() =>
                    {
                        locationOperationSchedule = newLocationOperatingSchedule;
                        locationOperationSchedule.Location = this;
                    _locationOperationSchedules.Add(locationOperationSchedule);
                    NotifyItemAdded(() => LocationOperationSchedules, locationOperationSchedule);
                });

            return locationOperationSchedule;
        }
Beispiel #4
0
 /// <summary>
 /// The remove operation schedule.
 /// </summary>
 /// <param name="locationOperationSchedule">
 /// The location operation schedule.
 /// </param>
 public virtual void RemoveOperationSchedule(LocationOperationSchedule locationOperationSchedule)
 {
     _locationOperationSchedules.Delete(locationOperationSchedule);
     NotifyItemRemoved(() => LocationOperationSchedules, locationOperationSchedule);
 }