コード例 #1
0
        private void btn_addBinaryAttach_Click(object sender, EventArgs e)
        {
            string filename;

            byte[] attachmentbytes = IOFunctionality.GeneralizedLoadAttachment(out filename);
            if (attachmentbytes != null)
            {
                BinaryAttachmentV2 attachment = new BinaryAttachmentV2();
                if (ShipmentIC.InsertCorrespondence.Content.Attachments == null)
                {
                    ShipmentIC.InsertCorrespondence.Content.Attachments = new AttachmentsV2();
                }
                if (ShipmentIC.InsertCorrespondence.Content.Attachments.BinaryAttachments == null)
                {
                    ShipmentIC.InsertCorrespondence.Content.Attachments.BinaryAttachments = new BinaryAttachmentExternalBEV2List();
                }

                ShipmentIC.InsertCorrespondence.Content.Attachments.BinaryAttachments.Add(new BinaryAttachmentV2()
                {
                    Data             = attachmentbytes,
                    DestinationType  = UserTypeRestriction.Default,
                    Encrypted        = false,
                    ExtensionData    = null,
                    FileName         = filename,
                    FunctionType     = AttachmentFunctionType.Unspecified,
                    SendersReference = "RandomReference " + Guid.NewGuid(),
                    Name             = System.IO.Path.GetFileNameWithoutExtension(filename)
                });

                SetViewedItem(ShipmentIC, "Shipment for InsertCorrespondence");
            }
        }
コード例 #2
0
 public virtual void InvokeSave <T>(T saveObj)
 {
     try
     {
         IOFunctionality.GeneralizedSaveFile(saveObj);
     }
     catch (Exception ex)
     {
         SetViewedItem(ex, "Failed during save file.");
     }
 }
コード例 #3
0
 public virtual T InvokeLoad <T>()
 {
     try
     {
         return(IOFunctionality.GeneralizedLoadFile <T>());
     }
     catch (Exception ex)
     {
         SetViewedItem(ex, "Failed during load file.");
         throw;
     }
 }
コード例 #4
0
 private void btn_LoadRequest_Click(object sender, EventArgs e)
 {
     shipment.BatchLoggingRequest = IOFunctionality.GeneralizedLoadFile <BatchLoggingRequestExternal>();
 }
コード例 #5
0
 private void btn_SaveRequest_Click(object sender, EventArgs e)
 {
     IOFunctionality.GeneralizedSaveFile(shipment.BatchLoggingRequest);
 }
コード例 #6
0
 private void saveDataItembtn_Click(object sender, EventArgs e)
 {
     IOFunctionality.GeneralizedSaveFile(dataItemResult);
 }
コード例 #7
0
 private void btn_SaveResult_Click(object sender, EventArgs e)
 {
     IOFunctionality.GeneralizedSaveFile(result);
 }