示例#1
0
        /// <summary>
        /// Undo any pending changes and revert back fields to the old ones.
        /// </summary>
        public void UndoPendingChanges()
        {
            foreach (Worker worker in Workers)
            {
                worker.Calls.Remove(this);
            }

            //THIS NEEDS WORK!
            if (_id == 0)
            {
                //its new so lets delete it!

                ServiceUser.Calls.Remove(this);

                CallManager.Instance.Calls.Remove(this);
            }
            else
            {
                idServiceUser    = (int)this.Old["idServiceUser"];
                duration_mins    = (int)this.Old["duration_mins"];
                required_workers = (int)this.Old["required_workers"];
                time             = (DateTime)this.Old["time"];
                flag             = (FlagCode)this.Old["flagcode"];
                notes            = (string)this.Old["notes"];
                traveltime_mins  = (int)this.Old["traveltime_mins"];

                Workers.Clear();
                Workers.AddRange(OldWorkers);
            }

            _markedForDeletion = false;

            _MarkForSave = false;
        }
 public WorkInProgressResult(IEnumerable <string> workers) : this()
 {
     Workers.AddRange(workers ?? new List <string>());
 }