This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using log4net; | |
namespace Zoom.MailingExtracts | |
{ | |
public class ZipModule : IDisposable | |
{ | |
protected static readonly ILog Log = LogManager.GetLogger(typeof(ZipModule)); | |
protected string BrandName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void FTPZippedFile(some params....) | |
{ | |
//create and set variables | |
var fallback = Policy | |
.Handle<SessionRemoteException>() | |
.Fallback((ex)=> SendEmail(ex.Message)); | |
var fileUploadResult = fallback.Execute(() => | |
UploadFile(zipFileName, fullzipFilepath, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string UploadFile(string zipFileName, string fullZipFilePath, | |
TransferOptions transOptions, SessionOptions sessionOptions) | |
{ | |
using (var session = new Session()) | |
{ | |
session.Open(sessionOptions); | |
return session.PutFiles( | |
zipFileName, | |
fullZipFilePath, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using Polly; | |
namespace SpreadsheetImporter | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
namespace SpreadsheetImporter | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
ReadFile(@"C:\temp\jam2.xls"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using log4net; | |
using WinSCP; | |
public class Upload | |
{ | |
public static void SendFile(UploadConfig config, ILog log) | |
{ | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UploadConfig | |
{ | |
public string Protocol { get; set; } | |
public string Host { get; set; } | |
public string User { get; set; } | |
public string Password { get; set; } | |
public string ZipFileName { get; set; } | |
public string RemotePath { get; set; } | |
public string PrivateKeyPath { get; set; } | |
public string Port { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.IO.Compression; | |
using log4net; | |
public class ZipUtil : IZip | |
{ | |
private static readonly ILog Log = LogManager.GetLogger(typeof(ZipModule)); | |
private string _zipFileName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IZip | |
{ | |
void SetZipFileName(string zipfileName); | |
void SetFilesToZip(List<string> files); | |
void CreateArchive(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void createShipment( utcdatetime _shipmentDate, | |
SalesTable _salesTable, | |
str _noOfParcels = "1" | |
) | |
{ | |
RoyalMail.shippingAPIPortTypeClient serviceClient; | |
RoyalMail.createShipmentRequest shipmentRequest; | |
RoyalMail.createShipmentResponse shipmentResponse; |
NewerOlder