예제 #1
0
        /// <summary>
        /// Added notifications to the rate object.
        /// </summary>
        /// <returns>The notifications.</returns>
        /// <param name="r">Fluent object.</param>
        /// <param name="recipientNotificationType">Recipient notification type.</param>
        /// <param name="email">Email.</param>
        /// <typeparam name="T">IRates concrete class.</typeparam>
        /// <typeparam name="S">ISpecialServices concrete class.</typeparam>
        /// <typeparam name="P">IParameter concrete class.</typeparam>
        public static RatesArrayFluent <T> Notifications <T, S, P>(
            this RatesArrayFluent <T> r,
            RecipientNotificationType recipientNotificationType,
            string email
            )
            where T : class, IRates, new()
            where S : class, ISpecialServices, new()
            where P : class, IParameter, new()
        {
            var s = new S
            {
                SpecialServiceId = SpecialServiceCodes.NOTIFICATIONS
            };
            var np = new P
            {
                Name  = NotificationType.RECIPIENT_NOTIFICATION_TYPE.ToString(),
                Value = recipientNotificationType.ToString()
            };

            s.AddParameter(np);
            var em = new P
            {
                Name  = NotificationType.RECIPIENT_NOTIFICATION_EMAIL.ToString(),
                Value = email
            };

            s.AddParameter(em);
            r.SpecialService(s);
            return(r);
        }
예제 #2
0
        /// <summary>
        /// Verbal confirmation of delivery
        /// </summary>
        /// <typeparam name="T">Rate type</typeparam>
        /// <typeparam name="S">Special Service Type</typeparam>
        /// <typeparam name="P">Parameter Type</typeparam>
        /// <param name="ratesArray">this</param>
        /// <param name="val">Phone number</param>
        /// <returns></returns>
        public static RatesArrayFluent <T> VerbalConfirmation <T, S, P>(this RatesArrayFluent <T> ratesArray, string val)
            where S : ISpecialServices, new()
            where T : class, IRates, new()
            where P : IParameter, new()
        {
            var p = new List <IParameter>(1)
            {
                new P()
                {
                    Name = "VERBAL_CONF_PHONE", Value = val
                }
            };
            var s = new S()
            {
                SpecialServiceId = SpecialServiceCodes.PRL, InputParameters = p
            };

            ratesArray.SpecialService <S>(s);
            return(ratesArray);
        }
예제 #3
0
        /// <summary>
        /// Print a return label
        /// </summary>
        /// <typeparam name="T">Rate type</typeparam>
        /// <typeparam name="S">Special Service Type</typeparam>
        /// <typeparam name="P">Parameter Type</typeparam>
        /// <param name="ratesArray">this</param>
        /// <param name="val">Description of returned itemse</param>
        /// <returns></returns>
        public static RatesArrayFluent <T> PrintReturnLabel <T, S, P>(this RatesArrayFluent <T> ratesArray, string val)
            where S : ISpecialServices, new()
            where T : class, IRates, new()
            where P : IParameter, new()
        {
            var p = new List <IParameter>(1)
            {
                new P()
                {
                    Name = "RETURN_PKG_DESCRIPTION", Value = val
                }
            };
            var s = new S()
            {
                SpecialServiceId = SpecialServiceCodes.PRL, InputParameters = p
            };

            ratesArray.SpecialService <S>(s);
            return(ratesArray);
        }
예제 #4
0
        /// <summary>
        /// Declared value for insurance
        /// </summary>
        /// <typeparam name="T">Rate type</typeparam>
        /// <typeparam name="S">Special Service Type</typeparam>
        /// <typeparam name="P">Parameter Type</typeparam>
        /// <param name="ratesArray">this</param>
        /// <param name="val">Decalred value</param>
        /// <returns></returns>
        public static RatesArrayFluent <T> DeclaredValue <T, S, P>(this RatesArrayFluent <T> ratesArray, decimal val)
            where S : ISpecialServices, new()
            where T : class, IRates, new()
            where P : IParameter, new()
        {
            var p = new List <IParameter>(1)
            {
                new P()
                {
                    Name = "INPUT_VALUE", Value = val.ToString()
                }
            };
            var s = new S()
            {
                SpecialServiceId = SpecialServiceCodes.INS, InputParameters = p
            };

            ratesArray.SpecialService <S>(s);
            return(ratesArray);
        }
예제 #5
0
        /// <summary>
        /// Cash on delivery paid by check.
        /// </summary>
        /// <typeparam name="T">Rate type</typeparam>
        /// <typeparam name="S">Special Service Type</typeparam>
        /// <typeparam name="P">Parameter Type</typeparam>
        /// <param name="ratesArray">this</param>
        /// <param name="currency">Currency</param>
        /// <param name="val">Amount</param>
        /// <returns></returns>
        public static RatesArrayFluent <T> CODCheck <T, S, P>(this RatesArrayFluent <T> ratesArray, string currency, decimal val)
            where S : ISpecialServices, new()
            where T : class, IRates, new()
            where P : IParameter, new()
        {
            var p = new List <IParameter>(2)
            {
                new P()
                {
                    Name = "CURRENCY", Value = currency
                }, new P()
                {
                    Name = "INPUT_VALUE", Value = val.ToString()
                }
            };
            var s = new S()
            {
                SpecialServiceId = SpecialServiceCodes.COD_CHECK, InputParameters = p
            };

            ratesArray.SpecialService <S>(s);
            return(ratesArray);
        }
예제 #6
0
        /// <summary>
        /// Dry Ice service
        /// </summary>
        /// <typeparam name="T">Rate type</typeparam>
        /// <typeparam name="S">Special Service Type</typeparam>
        /// <typeparam name="P">Parameter Type</typeparam>
        /// <param name="ratesArray">this</param>
        /// <param name="weightUOM">Unit of measure "OZS" for ounces</param>
        /// <param name="val">Weight</param>
        /// <returns></returns>
        public static RatesArrayFluent <T> DryIce <T, S, P>(this RatesArrayFluent <T> ratesArray, string weightUOM, decimal val)
            where S : ISpecialServices, new()
            where T : class, IRates, new()
            where P : IParameter, new()
        {
            var p = new List <IParameter>(2)
            {
                new P()
                {
                    Name = "WEIGHT_UOM", Value = weightUOM
                }, new P()
                {
                    Name = "WEIGHT", Value = val.ToString()
                }
            };
            var s = new S()
            {
                SpecialServiceId = SpecialServiceCodes.DRY_ICE, InputParameters = p
            };

            ratesArray.SpecialService <S>(s);
            return(ratesArray);
        }