Пример #1
0
        /// <summary>
        /// Helper method to change the status and also notify the parent order to change its status
        /// if necessary.
        /// </summary>
        /// <param name="status"></param>
        private void SetStatus(ProcedureStatus status)
        {
            if (status != _status)
            {
                _status = status;

                if (_status == ProcedureStatus.IP)
                {
                    UpdateStartTime();
                }

                if (this.IsTerminated)
                {
                    UpdateEndTime();
                }

                // Cancelled/discontinued procedures should not be left in downtime recovery mode.
                if (_status == ProcedureStatus.CA || _status == ProcedureStatus.DC)
                {
                    this.DowntimeRecoveryMode = false;
                }

                // the order should never be null, unless this is a brand new instance that has not yet been assigned an order
                if (_order != null)
                {
                    _order.UpdateStatus();
                }
            }
        }
 private void CheckStatus(ProcedureStatus status, Procedure o)
 {
     Assert.AreEqual(status, o.Status, string.Format("Exptected {0} status {1}", o.GetClass().Name, status.ToString()));
 }
 private void CheckStatus(ProcedureStatus status, Procedure o)
 {
     Assert.AreEqual(status, o.Status, string.Format("Exptected {0} status {1}", o.GetClass().Name, status.ToString()));
 }
Пример #4
0
		/// <summary>
		/// Helper method to change the status and also notify the parent order to change its status
		/// if necessary.
		/// </summary>
		/// <param name="status"></param>
		private void SetStatus(ProcedureStatus status)
		{
			if (status != _status)
			{
				_status = status;

				if (_status == ProcedureStatus.IP)
					UpdateStartTime();

				if (this.IsTerminated)
					UpdateEndTime();

				// Cancelled/discontinued procedures should not be left in downtime recovery mode.
				if (_status == ProcedureStatus.CA || _status == ProcedureStatus.DC)
					this.DowntimeRecoveryMode = false;

				// the order should never be null, unless this is a brand new instance that has not yet been assigned an order
				if (_order != null)
					_order.UpdateStatus();
			}
		}