Beispiel #1
0
        public static void GetStreamedattachmentFromFile(IntermediaryStreamedSubmitAttachmentShipment streamedAttachment)
        {
            OpenFileDialog ofd    = new OpenFileDialog();
            DialogResult   result = ofd.ShowDialog();

            if (result == DialogResult.OK)
            {
                streamedAttachment.FileName = Path.GetFileName(ofd.FileName);
                streamedAttachment.Name     = Path.GetFileNameWithoutExtension(ofd.FileName);
                streamedAttachment.FilePath = Path.GetFullPath(ofd.FileName);
                FileInfo fi   = new FileInfo(ofd.FileName);
                double   a    = fi.Length;
                string   mark = " MB";
                if (a > 1000000)
                {
                    a = a / 1000000;
                }
                else
                {
                    a    = a / 1000;
                    mark = " KB";
                }

                streamedAttachment.FileSize = string.Format("{0:0.00}", a) + mark;
            }
        }
Beispiel #2
0
 public IntermediaryInboundStreamedFormEC2()
 {
     InitializeComponent();
     IisepFunc = new IntermediaryInboundStreamedEndPointFunctionalityEC2();
     IisepFunc.ReturnMessageXml += ReturnMessageXmlHandler;
     Shipment     = new IntermediaryStreamedSubmitAttachmentShipment();
     TestShipment = new BaseShipment();
     Result       = new IntermediaryStreamedAttachmentResult();
 }
Beispiel #3
0
 public IntermediaryInboundStreamedForm()
 {
     InitializeComponent();
     iisepFunc = new IntermediaryInboundStreamedEndPointFunctionality();
     iisepFunc.ReturnMessageXml += ReturnMessageXmlHandler;
     shipment     = new IntermediaryStreamedSubmitAttachmentShipment();
     testShipment = new Classes.BaseShipment();
     result       = new IntermediaryStreamedAttachmentResult();
 }
        public IntermediaryStreamedAttachmentResult SubmitAttachmentStreamed(IntermediaryStreamedSubmitAttachmentShipment shipment)
        {
            IntermediaryStreamedAttachmentResult result = new IntermediaryStreamedAttachmentResult();
            var client = GenerateProxy(shipment.EndpointName, shipment.Certificate);

            using (FileStream fs = new FileStream(shipment.FilePath, FileMode.Open))
            {
                OperationContext = "IntStreamedSubmitAttachment";
                client.SubmitAttachmentStreamedEC(shipment.AttachmentTypeName, shipment.CheckSum, shipment.EndUserSystemReference, shipment.FileName,
                                                  shipment.Name, shipment.ReporteeElementId, shipment.Password, shipment.Username, fs,
                                                  out result.ParentReceiptId, out result.ReceiptHistory, out result.ReceiptId, out result.ReceiptStatusCode, out result.ReceiptText, out result.ReceiptTypeName);
            }
            return(result);
        }