public override bool Exists(SwiftDataDataContext dataContext) { bool ret; try { ret = dataContext.SwiftStatements.Where(s => s is MT535 && s.BIC == BIC && AccountNumber == s.AccountNumber && s.Date == Date && s.StatementNumber == StatementNumber && ((MT535)s).SenderReference == SenderReference).Count() > 0; } catch (Exception ex) { ret = true; // Assume it exists because we had an error string err = "Database query failed whilst determining whether a swift 535 message was already in the database."; Notifier.DUOC("Swift Importer Error", string.Format("{0}\r\n\r\n{1}\r\n\r\n{2}", err, ex.Message, ex.StackTrace)); } return(ret); }
private void Connect() { SQLServer db = null; string connStr; try { db = new SQLServer(Dsn); connStr = db.ConnectionString; } finally { if (db != null) { db.Close(); } db = null; } swiftData = new SwiftDataDataContext(connStr); swiftData.CommandTimeout = 0; //10 mins }
private void Disconnect() { swiftData.Dispose(); swiftData = null; }
public virtual void Insert(SwiftDataDataContext dataContext) { ID = dataContext.InsertSwiftStatement(StatementType, BIC, AccountNumber, StatementNumber, SequenceNumber, Date, FileName); }
public override void Insert(SwiftDataDataContext dataContext) { ID = dataContext.InsertMT940Statement(StatementType, BIC, AccountNumber, StatementNumber, SequenceNumber, Date, FileName, Currency, OpeningBalance, ClosingBalance); }
public override void Insert(SwiftDataDataContext dataContext) { ID = dataContext.InsertMT535Statement(StatementType, BIC, AccountNumber, StatementNumber, SequenceNumber, Date, FileName, SenderReference); }