Exemple #1
0
 public static bool AddTransaction(CISSB.TransactionInfoResponse response, CISSB.TransactionInfoRequest request, string RequestType, string STAN1)
 {
     try
     {
         bool IsAdded = true;
         using (var db = new SoneriCISEntities())
         {
             tbl_transactions t = new tbl_transactions();
             t.Narration               = request.TransactionNarration;
             t.Amount                  = double.Parse(request.TransactionAmount.ToString());
             t.DebitAccountNo          = request.DrCustomerAccountNumber;
             t.CreditAccountNo         = request.CrCustomerAccountNumber;
             t.RequestType             = RequestType;
             t.STAN                    = STAN1;
             t.ResponseCode            = response.ResponseCode;
             t.ResponseCodeDescription = response.ResponseCodeDescription;
             t.BranchCode              = response.TransactionBranchCode;
             t.TransactionDateTime     = DateTime.Now;
             t.TransactionIdNo         = response.TransactionIdentificationNo;
             t.TransactionRefNo        = response.TransactionRefNo;
             db.tbl_transactions.Add(t);
             db.SaveChanges();
         }
         return(IsAdded);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemple #2
0
 public static bool AddTransaction(CISSB.TransactionInfoResponse response, CISSB.TransactionInfoRequest request, string RequestType, string STAN1, string CardNo)
 {
     try
     {
         bool IsAdded = false;
         using (var db = new SoneriCISEntities())
         {
             tbl_transactions t = new tbl_transactions();
             t.Narration               = request.TransactionNarration;
             t.Amount                  = double.Parse(request.TransactionAmount.ToString());
             t.DebitAccountNo          = request.DrCustomerAccountNumber;
             t.CreditAccountNo         = request.CrCustomerAccountNumber;
             t.RequestType             = RequestType;
             t.STAN                    = STAN1.Substring(3, STAN1.Length - 3);//STAN1;
             t.ResponseCode            = response.ResponseCode;
             t.ResponseCodeDescription = response.ResponseCodeDescription;
             t.BranchCode              = response.TransactionBranchCode;
             t.TransactionDateTime     = DateTime.Now;
             t.TransactionIdNo         = response.TransactionIdentificationNo;
             t.TransactionRefNo        = CardNo;
             db.tbl_transactions.Add(t);
             db.SaveChanges();
             IsAdded = true;
             FileHelper.RecoveryErrorLog("Income Transaction DB Insert", "Response Code:" + response.ResponseCode + "Response Desc:" + response.ResponseCodeDescription + "FT: " + response.TransactionIdentificationNo + "STAN:" + STAN1 + "FT:" + response.TransactionIdentificationNo, "Status:" + IsAdded, new System.Diagnostics.StackTrace(true).GetFrame(0).GetFileLineNumber().ToString());
         }
         return(IsAdded);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemple #3
0
 public static bool AddRecoveryTransaction(string DrCustomerAccountNumber, decimal TransactionAmount, string TransactionNarration, string RequestType, string BranchCode, string STAN1, string CardNo)
 {
     try
     {
         STAN1 = STAN1.Substring(3, STAN1.Length - 3);
         bool IsAdded = true;
         using (var db = new SoneriCISEntities())
         {
             tbl_transactions t = new tbl_transactions();
             t.Narration      = TransactionNarration;
             t.Amount         = double.Parse(TransactionAmount.ToString());
             t.DebitAccountNo = DrCustomerAccountNumber;
             //t.CreditAccountNo = request.CrCustomerAccountNumber;
             t.RequestType = RequestType;
             t.STAN        = STAN1;
             //t.ResponseCode = response.ResponseCode;
             //t.ResponseCodeDescription = response.ResponseCodeDescription;
             //t.BranchCode = response.TransactionBranchCode;
             t.TransactionDateTime = DateTime.Now;
             //t.TransactionIdNo = response.TransactionIdentificationNo;
             t.TransactionRefNo = CardNo;
             db.tbl_transactions.Add(t);
             db.SaveChanges();
         }
         return(IsAdded);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
 public bool AddTransaction(tbl_transactions row)
 {
     try
     {
         using (var db = new SoneriCISEntities())
         {
             db.tbl_transactions.Add(row);
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
        public tbl_transactions GetLastTransaction()
        {
            try
            {
                bool             isnull = false;
                tbl_transactions lst    = new tbl_transactions();
                using (var db = new SoneriCISEntities())
                {
                    lst = db.tbl_transactions.Where(x => x.RequestType == "RC").OrderByDescending(a => a.TransactionDateTime).FirstOrDefault();
                }


                return(lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }