private void RequestData(TimeSpan _delay, Shipping _sp, AlarmPriority _pr, EntitiesDataContext EDC, bool _TimeOutExpired)
        {
            string _frmt = "RequestDataTrucktrailerDrivers".GetLocalizedString();

            _frmt = String.Format(_frmt, _delay, DateTime.Now + _delay);
            Shipping.RequiredOperations _ro = 0;
            switch (_pr)
            {
            case AlarmPriority.Normal:
                _ro = _sp.CalculateOperations2Do(false, true, _TimeOutExpired);
                _frmt.Insert(0, "Remainder".GetLocalizedString());
                break;

            case AlarmPriority.High:
                _ro = _sp.CalculateOperations2Do(true, true, _TimeOutExpired);
                _frmt.Insert(0, "LastCall".GetLocalizedString());
                break;

            case AlarmPriority.Warning:
                _ro = _sp.CalculateOperations2Do(false, true, _TimeOutExpired);
                _frmt.Insert(0, "Warnning".GetLocalizedString());
                break;

            case AlarmPriority.None:
            case AlarmPriority.Invalid:
            default:
                break;
            }
            SetupEnvironment(_delay, _ro, _sp, _pr, EDC, _frmt, EmailType.RequestData);
        }
        private void MakeCanceled(Shipping _sp, EntitiesDataContext EDC)
        {
            _sp.ShippingState = ShippingState.Canceled;
            Shipping.RequiredOperations _ro = _sp.CalculateOperations2Do(true, true, true);
            string _frmt = "ShipmentCancelled".GetLocalizedString();

            _frmt = String.Format(_frmt, _sp.Editor);
            SetupEnvironment(Shipping.WatchTolerance, _ro, _sp, AlarmPriority.High, EDC, _frmt, EmailType.Canceled);
        }
        private void MakeDelayed(Shipping _sp, EntitiesDataContext EDC, bool _TimeOutExpired)
        {
            if (_sp.TruckAwaiting.GetValueOrDefault(false))
            {
                return;
            }
            _sp.ShippingState = ShippingState.Delayed;
            string _frmt = "TruckLateCallDriver".GetLocalizedString();

            _frmt = String.Format(_frmt, _sp.PartnerTitle != null ? _sp.PartnerTitle.CellPhone : " ?????");
            Shipping.RequiredOperations _ro = _sp.CalculateOperations2Do(true, true, _TimeOutExpired) & Shipping.CarrierOperations;
            SetupEnvironment(Shipping.WatchTolerance, _ro, _sp, AlarmPriority.High, EDC, _frmt, EmailType.Delayed);
        }