예제 #1
0
파일: SwiftData.cs 프로젝트: colinnaylor/CN
        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);
        }
예제 #2
0
        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
        }
예제 #3
0
 private void Disconnect()
 {
     swiftData.Dispose();
     swiftData = null;
 }
예제 #4
0
파일: SwiftData.cs 프로젝트: colinnaylor/CN
 public virtual void Insert(SwiftDataDataContext dataContext)
 {
     ID = dataContext.InsertSwiftStatement(StatementType, BIC, AccountNumber, StatementNumber, SequenceNumber, Date, FileName);
 }
예제 #5
0
파일: SwiftData.cs 프로젝트: colinnaylor/CN
 public override void Insert(SwiftDataDataContext dataContext)
 {
     ID = dataContext.InsertMT940Statement(StatementType, BIC, AccountNumber, StatementNumber, SequenceNumber, Date, FileName, Currency, OpeningBalance, ClosingBalance);
 }
예제 #6
0
파일: SwiftData.cs 프로젝트: colinnaylor/CN
 public override void Insert(SwiftDataDataContext dataContext)
 {
     ID = dataContext.InsertMT535Statement(StatementType, BIC, AccountNumber, StatementNumber, SequenceNumber, Date, FileName, SenderReference);
 }