Exemplo n.º 1
0
        private int NoOfDaysAllowed(MailServiceENUM mailServiceEnum, MailLocalOrForiegnENUM mailLocalOrForiegnEnum)
        {
            string err = "";

            switch (mailLocalOrForiegnEnum)
            {
            case MailLocalOrForiegnENUM.InPakistan:
                switch (mailServiceEnum)
                {
                case MailServiceENUM.Post:
                    return(VerificationConfig.Number_Of_Days_Allowed_For_Local_Post);

                case MailServiceENUM.Courier:
                    return(VerificationConfig.Number_Of_Days_Allowed_For_Local_Courier);

                case MailServiceENUM.Unknown:
                default:
                    err = string.Format("No such choice for No. of days allowed: Service: {0}, Local/Foreign: {1}",
                                        mailServiceEnum.ToString().ToTitleSentance(),
                                        mailLocalOrForiegnEnum.ToString().ToTitleSentance());
                    throw new Exception(err);
                }
                ;


            case MailLocalOrForiegnENUM.OutOfPakistan:
                switch (mailServiceEnum)
                {
                case MailServiceENUM.Post:
                    return(VerificationConfig.Number_Of_Days_Allowed_For_Foreign_Post);

                case MailServiceENUM.Courier:
                    return(VerificationConfig.Number_Of_Days_Allowed_For_Foreign_Courier);

                case MailServiceENUM.Unknown:
                default:
                    err = string.Format("No such choice for No. of days allowed: Service: {0}, Local/Foreign: {1}",
                                        mailServiceEnum.ToString().ToTitleSentance(),
                                        mailLocalOrForiegnEnum.ToString().ToTitleSentance());
                    throw new Exception(err);
                }
                ;


            case MailLocalOrForiegnENUM.Unknown:
            default:
                err = string.Format("No such choice for No. of days allowed: Service: {0}, Local/Foreign: {1}",
                                    mailServiceEnum.ToString().ToTitleSentance(),
                                    mailLocalOrForiegnEnum.ToString().ToTitleSentance());
                throw new Exception(err);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// These are the number of pieces allowed to the mailer per mailing.
        /// </summary>
        private int numberOfMailPcsAllowedPerMailingToMailer(Mailer mailer, MailServiceENUM mailServiceEnum)
        {
            if (mailServiceEnum == MailServiceENUM.Post)
            {
                switch (getMailerTrustLevel_Helper(mailer))
                {
                case TrustLevelENUM.Level1:
                    return(MailersTrustLevelConfig.Level1_Postal);

                case TrustLevelENUM.Level2:
                    return(MailersTrustLevelConfig.Level2_Postal);

                case TrustLevelENUM.Level3:
                    return(MailersTrustLevelConfig.Level3_Postal);

                case TrustLevelENUM.Level4:
                    return(MailersTrustLevelConfig.Level4_Postal);

                case TrustLevelENUM.Level5:
                    return(MailersTrustLevelConfig.Level5_Postal);

                case TrustLevelENUM.Unknown:
                case TrustLevelENUM.BlackListed:
                default:
                    return(0);
                }
            }
            if (mailServiceEnum == MailServiceENUM.Courier)
            {
                switch (getMailerTrustLevel_Helper(mailer))
                {
                case TrustLevelENUM.Level1:
                    return(MailersTrustLevelConfig.Level1_Courier);

                case TrustLevelENUM.Level2:
                    return(MailersTrustLevelConfig.Level2_Courier);

                case TrustLevelENUM.Level3:
                    return(MailersTrustLevelConfig.Level3_Courier);

                case TrustLevelENUM.Level4:
                    return(MailersTrustLevelConfig.Level4_Courier);

                case TrustLevelENUM.Level5:
                    return(MailersTrustLevelConfig.Level5_Courier);

                case TrustLevelENUM.Unknown:
                case TrustLevelENUM.BlackListed:
                default:
                    return(0);
                }
            }

            throw new Exception(
                      string.Format("No such mail serivice! {0}",
                                    mailServiceEnum
                                    .ToString()
                                    .ToTitleSentance()));
        }
Exemplo n.º 3
0
        private double getVerificaionCharges(MailServiceENUM mailServiceEnum, MailLocalOrForiegnENUM mailLocalOrForiegnEnum, out string btnCaption)
        {
            string error            = "";
            double verificationCost = 0;

            btnCaption = "Error";
            switch (mailServiceEnum)
            {
            case MailServiceENUM.Post:
                switch (mailLocalOrForiegnEnum)
                {
                case MailLocalOrForiegnENUM.InPakistan:
                    //is in Pakistan
                    verificationCost = VerificationConfig.Sale_Postal_Local;
                    btnCaption       = string.Format("POST [pkrs {0}]", verificationCost);
                    break;

                case MailLocalOrForiegnENUM.OutOfPakistan:
                    //is foreign
                    verificationCost = VerificationConfig.Sale_Postal_International;
                    btnCaption       = string.Format("POST [pkrs {0}]", verificationCost);
                    break;

                case MailLocalOrForiegnENUM.Unknown:
                default:
                    error = string.Format("No such option");
                    throw new Exception(error);
                }
                break;

            case MailServiceENUM.Courier:
                switch (mailLocalOrForiegnEnum)
                {
                case MailLocalOrForiegnENUM.InPakistan:
                    //is in Pakistan
                    verificationCost = VerificationConfig.Sale_Courier_Local;
                    btnCaption       = string.Format("COURIER [pkrs {0}]", verificationCost);
                    break;

                case MailLocalOrForiegnENUM.OutOfPakistan:
                    verificationCost = VerificationConfig.Sale_Courier_International;
                    btnCaption       = string.Format("COURIER [pkrs {0}]", verificationCost);
                    //is foreign
                    break;

                case MailLocalOrForiegnENUM.Unknown:
                default:
                    error = string.Format("No such option");
                    throw new Exception(error);
                }
                break;

            default:
                error = string.Format("No such option: {0}", mailServiceEnum.ToString().ToTitleSentance());
                throw new Exception(error);
            }

            return(verificationCost);
        }