Ejemplo n.º 1
0
        internal static bool IsInternationalPiece(MailpieceShapeEnum mailPiece)
        {
            switch (mailPiece)
            {
            case MailpieceShapeEnum.IrregularParcel:
            case MailpieceShapeEnum.LargeFlatRateBox:
            case MailpieceShapeEnum.LargeParcel:
            case MailpieceShapeEnum.LargeVideoFlatRateBox:
            case MailpieceShapeEnum.MediumFlatRateBox:
            case MailpieceShapeEnum.OversizedParcel:
            case MailpieceShapeEnum.Parcel:
            case MailpieceShapeEnum.SmallFlatRateBox:
                return(true);

            case MailpieceShapeEnum.Card:
            case MailpieceShapeEnum.DVDFlatRateBox:
            case MailpieceShapeEnum.Flat:
            case MailpieceShapeEnum.FlatRateCardboardEnvelope:
            case MailpieceShapeEnum.FlatRateEnvelope:
            case MailpieceShapeEnum.FlatRateGiftCardEnvelope:
            case MailpieceShapeEnum.FlatRateLegalEnvelope:
            case MailpieceShapeEnum.FlatRatePaddedEnvelope:
            case MailpieceShapeEnum.FlatRateWindowEnvelope:
            case MailpieceShapeEnum.Letter:
            case MailpieceShapeEnum.SmallFlatRateEnvelope:
                return(false);

            default:
                return(false);
            }
        }
Ejemplo n.º 2
0
 public MailPieceClass(MailpieceShapeEnum mailpiece)
 {
     this.MailPiece       = mailpiece;
     this.MailPieceName   = MailPieceClass.GetMailPieceName(mailpiece);
     this.IsDomestic      = MailPieceClass.IsDomesticPiece(MailPiece);
     this.IsInternational = MailPieceClass.IsInternationalPiece(MailPiece);
 }
Ejemplo n.º 3
0
        private static string GetIntegratedFormType(bool isInternationalShipping, MailClassEnum mailClassEnum, MailpieceShapeEnum mailpieceShapeEnum)
        {
            string str;
            bool   flag;

            if (!isInternationalShipping)
            {
                str = ((mailClassEnum == MailClassEnum.FirstClassMail || mailClassEnum == MailClassEnum.PriorityMail || mailClassEnum == MailClassEnum.LibraryMail || mailClassEnum == MailClassEnum.MediaMail ? false : mailClassEnum != MailClassEnum.ParcelSelect) ? "FORM2976A" : "FORM2976");
            }
            else
            {
                if (mailClassEnum == MailClassEnum.FirstClassMailInternational)
                {
                    flag = false;
                }
                else if (mailClassEnum != MailClassEnum.PriorityMailInternational)
                {
                    flag = true;
                }
                else
                {
                    flag = (mailpieceShapeEnum == MailpieceShapeEnum.FlatRateEnvelope || mailpieceShapeEnum == MailpieceShapeEnum.FlatRateLegalEnvelope || mailpieceShapeEnum == MailpieceShapeEnum.FlatRatePaddedEnvelope ? false : mailpieceShapeEnum != MailpieceShapeEnum.SmallFlatRateBox);
                }
                str = (flag ? "FORM2976A" : "FORM2976");
            }
            return(str);
        }
Ejemplo n.º 4
0
        internal static string ParseMailpieceShape(MailpieceShapeEnum mailpieceShapeEnum)
        {
            string result = string.Empty;

            switch (mailpieceShapeEnum)
            {
            case MailpieceShapeEnum.Card:
            {
                result = "Card";
                break;
            }

            case MailpieceShapeEnum.Letter:
            {
                result = "Letter";
                break;
            }

            case MailpieceShapeEnum.Flat:
            {
                result = "Flat";
                break;
            }

            case MailpieceShapeEnum.Parcel:
            {
                result = "Parcel";
                break;
            }

            case MailpieceShapeEnum.LargeParcel:
            {
                result = "LargeParcel";
                break;
            }

            case MailpieceShapeEnum.IrregularParcel:
            {
                result = "IrregularParcel";
                break;
            }

            case MailpieceShapeEnum.OversizedParcel:
            {
                result = "OversizedParcel";
                break;
            }

            case MailpieceShapeEnum.FlatRateEnvelope:
            {
                result = "FlatRateEnvelope";
                break;
            }

            case MailpieceShapeEnum.FlatRateLegalEnvelope:
            {
                result = "FlatRateLegalEnvelope";
                break;
            }

            case MailpieceShapeEnum.FlatRatePaddedEnvelope:
            {
                result = "FlatRatePaddedEnvelope";
                break;
            }

            case MailpieceShapeEnum.FlatRateGiftCardEnvelope:
            {
                result = "FlatRateGiftCardEnvelope";
                break;
            }

            case MailpieceShapeEnum.FlatRateWindowEnvelope:
            {
                result = "FlatRateWindowEnvelope";
                break;
            }

            case MailpieceShapeEnum.FlatRateCardboardEnvelope:
            {
                result = "FlatRateCardboardEnvelope";
                break;
            }

            case MailpieceShapeEnum.SmallFlatRateEnvelope:
            {
                result = "SmallFlatRateEnvelope";
                break;
            }

            case MailpieceShapeEnum.SmallFlatRateBox:
            {
                result = "SmallFlatRateBox";
                break;
            }

            case MailpieceShapeEnum.MediumFlatRateBox:
            {
                result = "MediumFlatRateBox";
                break;
            }

            case MailpieceShapeEnum.LargeFlatRateBox:
            {
                result = "LargeFlatRateBox";
                break;
            }

            case MailpieceShapeEnum.DVDFlatRateBox:
            {
                result = "DVDFlatRateBox";
                break;
            }

            case MailpieceShapeEnum.LargeVideoFlatRateBox:
            {
                result = "LargeVideoFlatRateBox";
                break;
            }
            }
            return(result);
        }
Ejemplo n.º 5
0
        internal static string GetMailPieceName(MailpieceShapeEnum mailpiece)
        {
            switch (mailpiece)
            {
            case MailpieceShapeEnum.Card:
                return("Card");

            case MailpieceShapeEnum.DVDFlatRateBox:
                return("DVD Flat Rate Box");

            case MailpieceShapeEnum.Flat:
                return("Flat");

            case MailpieceShapeEnum.FlatRateCardboardEnvelope:
                return("Flat Rate Cardboard Envelope");

            case MailpieceShapeEnum.FlatRateEnvelope:
                return("Flat Rate Evnelope");

            case MailpieceShapeEnum.FlatRateGiftCardEnvelope:
                return("Flat Rate Giftcard Envelope");

            case MailpieceShapeEnum.FlatRateLegalEnvelope:
                return("Flat Rate Legal Envelope");

            case MailpieceShapeEnum.FlatRatePaddedEnvelope:
                return("Flat Rate Padded Envelope");

            case MailpieceShapeEnum.FlatRateWindowEnvelope:
                return("Flat Rate Window Envelope");

            case MailpieceShapeEnum.IrregularParcel:
                return("Irregular Parcel");

            case MailpieceShapeEnum.LargeFlatRateBox:
                return("Large Flat Rate Box");

            case MailpieceShapeEnum.LargeParcel:
                return("Large Parcel");

            case MailpieceShapeEnum.LargeVideoFlatRateBox:
                return("Large Video Flat Rate Box");

            case MailpieceShapeEnum.Letter:
                return("Letter");

            case MailpieceShapeEnum.MediumFlatRateBox:
                return("Medium Flat Rate Box");

            case MailpieceShapeEnum.OversizedParcel:
                return("Oversized Parcel");

            case MailpieceShapeEnum.Parcel:
                return("Parcel");

            case MailpieceShapeEnum.SmallFlatRateBox:
                return("Small Flat Rate Box");

            case MailpieceShapeEnum.SmallFlatRateEnvelope:
                return("Small Flat Rate Envelope");

            default:
                return("");
            }
        }