Ejemplo n.º 1
0
 public override void RollbackTransaction() => CurrentTransaction.Rollback();
Ejemplo n.º 2
0
        public JsonResult LoadGrid(string sidx, string sord, int rows, int page = 1)
        {
            if (Request["Tab"] == "History")
            {
                string   getCardNo     = (Request["CardNo"].Trim() != "") ? Request["CardNo"].Trim() : null;
                string   getAcctNo     = (Request["AccountNo"].Trim() != "") ? Request["AccountNo"].Trim() : null;
                DateTime getTransDate1 = DateTime.ParseExact(Request["TransDate1"], "dd/MM/yyyy", null);
                DateTime getTransDate2;
                if (Request["TransDate2"] != "")
                {
                    getTransDate2 = DateTime.ParseExact(Request["TransDate2"], "dd/MM/yyyy", null).AddDays(1);
                }
                else
                {
                    getTransDate2 = getTransDate1.AddDays(1);
                }

                var data = db.GetHistoryDebitTransactions(getAcctNo, getCardNo, Formatter.FormatDateHist(getTransDate1), Formatter.FormatDateHist(getTransDate2)).ToList()
                           .Select(x => new
                {
                    MerchantID   = x.MerchantId,
                    TerminalID   = x.TerminalId,
                    Batch        = x.Batch,
                    Date         = x.Date,
                    DateOnly     = x.DateOnly,
                    Time         = x.Time,
                    TrTp         = x.TrTp,
                    CardNo       = x.CardNo,
                    AccountNo    = x.AccountNo,
                    Amount       = x.Amount,
                    Cash         = x.Cash,
                    ResponseCode = x.ResponseCode,
                    ApprCd       = x.ApprCd,
                    TraceNo      = x.TraceNo,
                    RefNo        = x.RefNo,
                    Cashier      = x.Cashier,
                    RequestID    = x.RequestId,
                    Merchant     = x.Merchant,
                    Date2        = x.Date.ToString()
                });

                int pageIndex    = Convert.ToInt32(page) - 1;
                int pageSize     = rows;
                int totalRecords = data.Count();
                int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)pageSize);

                data = data.Skip((page - 1) * pageSize).Take(pageSize);

                var       recordCount = data.Count();
                JSONTable jTable      = new JSONTable();
                jTable.total   = totalPages;
                jTable.page    = page;
                jTable.records = totalRecords;
                jTable.rows    = data.ToArray();

                return(Json(jTable, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var    culture    = CultureInfo.GetCultureInfo("de-DE");
                string atmNo      = Request["ATMNo"];
                string lnet       = Request["LNET"];
                string fiid       = Request["FIID"];
                string terminalId = Request["TerminalID"];
                string trxDate    = Formatter.ToStringExact(DateTime.ParseExact(Request["TransDate"], "dd/MM/yyyy", null), "MM/dd/yyyy");

                string startDate = trxDate + " 00:00:00";
                string endDate   = trxDate + " 23:59:59";

                Params param = new Params()
                {
                    Parameter = new Dictionary <string, string>()
                };

                param.Parameter.Add("atmNo", atmNo);
                param.Parameter.Add("startDate", startDate);
                param.Parameter.Add("endDate", endDate);
                param.Parameter.Add("lnet", lnet);
                param.Parameter.Add("fiid", fiid);
                if (!string.IsNullOrEmpty(terminalId))
                {
                    param.Parameter.Add("terminalId", terminalId);
                }

                var trx  = CurrentTransaction.Debit(param);
                var data = trx.Select(x => new
                {
                    Number          = x.Number,
                    TransactionCode = x.TransactionCode,
                    TransactionDate = x.TransactionDate,
                    TransactionTime = x.TransactionTime,
                    Amount          = string.Format(culture, "{0:n}", Int32.Parse(x.Amount)),
                    ResponseCode    = x.ResponseCode,
                    ApprovalCode    = x.ApprovalCode,
                    AtmCardNo       = x.AtmCardNo,
                    TerminalId      = x.TerminalId,
                    CashAmount      = string.Format(culture, "{0:n}", Int32.Parse(x.CashAmount)),
                    AccountNumber   = x.AccountNumber,
                    Retailer        = x.Retailer,
                    TraceNo         = x.TraceNo,
                    Batch           = x.Batch,
                    SequenceNo      = x.SequenceNo,
                    CardType        = x.CardType
                }
                                      );

                int pageIndex    = Convert.ToInt32(page) - 1;
                int pageSize     = rows;
                int totalRecords = trx.Count();
                int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)pageSize);


                data = data.Skip((page - 1) * pageSize).Take(pageSize);

                var       recordCount = data.Count();
                JSONTable jTable      = new JSONTable();
                jTable.total   = totalPages;
                jTable.page    = page;
                jTable.records = totalRecords;
                jTable.rows    = data.ToArray();

                return(Json(jTable, JsonRequestBehavior.AllowGet));
            }
        }
        public void Dispose()
        {
            CurrentTransaction?.Dispose();

            _realConnection.Dispose();
        }
Ejemplo n.º 4
0
 public override void CommitTransaction() => CurrentTransaction.Commit();
 public void CommitTransaction() => CurrentTransaction.Commit();
 public void RollbackTransaction() => CurrentTransaction.Rollback();
Ejemplo n.º 7
0
 public void Dispose()
 {
     CurrentTransaction?.Dispose();
     CurrentTransaction = null;
     _semaphore?.Dispose();
 }
Ejemplo n.º 8
0
        public JsonResult LoadGrid(string sidx, string sord, int rows, int page = 1)
        {
            if (Request["Tab"] == "History" && Request["SearchTerminalID"] != "Yes")
            {
                Dictionary <string, string> MappingCurrencyCode = getListMapping("CurrencyCode", "CurrencyCode");
                string   getCardNo     = (Request["CardNo"].Trim() != "") ? Request["CardNo"].Trim() : null;
                string   getFrAcctNo   = (Request["FromAccount"].Trim() != "") ? Request["FromAccount"].Trim() : null;
                DateTime getTransDate1 = DateTime.ParseExact(Request["TransDate1"], "dd/MM/yyyy", null);
                DateTime getTransDate2;

                if (Request["TransDate2"] != "")
                {
                    getTransDate2 = DateTime.ParseExact(Request["TransDate2"], "dd/MM/yyyy", null).AddDays(1);
                }
                else
                {
                    getTransDate2 = getTransDate1.AddDays(1);
                }

                var data = db.GetHistoryATMTransactions(getCardNo, getFrAcctNo, null, Formatter.FormatDateHist(getTransDate1), Formatter.FormatDateHist(getTransDate2)).ToList()
                           .Select(x => new
                {
                    TransactionDate        = x.TransactionDate,
                    Terminal               = x.Terminal,
                    CardNo                 = x.CardNo,
                    TransactionCode        = x.TransactionCode,
                    FromAccount            = x.FromAccount,
                    Amount                 = x.Amount,
                    Company                = x.Company,
                    ToAccount              = x.ToAccount,
                    Rate                   = x.Rate,
                    Currency               = (MappingCurrencyCode.ContainsKey(x.Currency)) ? MappingCurrencyCode[x.Currency] : "",
                    Forex                  = x.Forex,
                    ResponseCode           = x.ResponseCode,
                    Response               = x.Response,
                    Sequence               = x.Sequence,
                    RequestID              = x.RequestID,
                    DateOnly               = x.DateOnly,
                    Time                   = x.Time,
                    Location               = x.Location,
                    TransactionDescription = x.TransactionDescription,
                    Date2                  = x.TransactionDate.ToString()
                });

                int pageIndex    = Convert.ToInt32(page) - 1;
                int pageSize     = rows;
                int totalRecords = data.Count();
                int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)pageSize);

                data = data.Skip((page - 1) * pageSize).Take(pageSize);

                var       recordCount = data.Count();
                JSONTable jTable      = new JSONTable();
                jTable.total   = totalPages;
                jTable.page    = page;
                jTable.records = totalRecords;
                jTable.rows    = data.ToArray();

                return(Json(jTable, JsonRequestBehavior.AllowGet));
            }
            else if (Request["Tab"] == "History" && Request["SearchTerminalID"] == "Yes")
            {
                Dictionary <string, string> MappingCurrencyCode = getListMapping("CurrencyCode", "CurrencyCode");
                string getTerminalID = Request["TerminalID"].Trim();
                string getSequenceNo = Request["SequenceNo"].Trim();

                var data = db.GetHistoryATMTransactionsByTerminalID(getTerminalID, getSequenceNo).ToList()
                           .Select(x => new
                {
                    TransactionDate        = x.TransactionDate,
                    Terminal               = x.Terminal,
                    CardNo                 = x.CardNo,
                    TransactionCode        = x.TransactionCode,
                    FromAccount            = x.FromAccount,
                    Amount                 = x.Amount,
                    Company                = x.Company,
                    ToAccount              = x.ToAccount,
                    Rate                   = x.Rate,
                    Currency               = (MappingCurrencyCode.ContainsKey(x.Currency)) ? MappingCurrencyCode[x.Currency] : "",
                    Forex                  = x.Forex,
                    ResponseCode           = x.ResponseCode,
                    Response               = x.Response,
                    Sequence               = x.Sequence,
                    RequestID              = x.RequestID,
                    DateOnly               = x.DateOnly,
                    Time                   = x.Time,
                    Location               = x.Location,
                    TransactionDescription = x.TransactionDescription,
                    Date2                  = x.TransactionDate.ToString()
                });

                int pageIndex    = Convert.ToInt32(page) - 1;
                int pageSize     = rows;
                int totalRecords = data.Count();
                int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)pageSize);

                data = data.Skip((page - 1) * pageSize).Take(pageSize);

                var       recordCount = data.Count();
                JSONTable jTable      = new JSONTable();
                jTable.total   = totalPages;
                jTable.page    = page;
                jTable.records = totalRecords;
                jTable.rows    = data.ToArray();

                return(Json(jTable, JsonRequestBehavior.AllowGet));
            }
            else
            {
                Dictionary <string, string> MappingTransactionCode = getListMapping("TransactionType", "ATM Current");
                Dictionary <string, string> MappingCurrencyCode    = getListMapping("CurrencyCode", "CurrencyCode");

                string atmNo      = Request["ATMNo"];
                string lnet       = Request["LNET"];
                string fiid       = Request["FIID"];
                string terminalId = Request["TerminalID"];
                string trxDate    = Formatter.ToStringExact(DateTime.ParseExact(Request["TransDate"], "dd/MM/yyyy", null), "MM/dd/yyyy");

                string startDate = trxDate + " 00:00:00";
                string endDate   = trxDate + " 23:59:59";

                Params param = new Params()
                {
                    Parameter = new Dictionary <string, string>()
                };

                param.Parameter.Add("atmNo", atmNo);
                param.Parameter.Add("startDate", startDate);
                param.Parameter.Add("endDate", endDate);
                param.Parameter.Add("lnet", lnet);
                param.Parameter.Add("fiid", fiid);
                if (!string.IsNullOrEmpty(terminalId))
                {
                    param.Parameter.Add("terminalId", terminalId);
                }

                var culture = CultureInfo.GetCultureInfo("de-DE");
                var trx     = CurrentTransaction.ATM(param);
                var data    = trx.Select(x => new
                {
                    Number                 = x.Number,
                    TransactionCode        = x.TransactionCode,
                    TransactionDate        = x.TransactionDate,
                    Amount1                = string.Format(culture, "{0:n}", Int32.Parse(x.Amount1)),
                    ResponseCode           = x.ResponseCode,
                    ResponseDescription    = x.ResponseDescription,
                    TransactionDescription = (MappingTransactionCode.ContainsKey(x.TransactionCode)) ? MappingTransactionCode[x.TransactionCode] : "",
                    Currency               = (MappingCurrencyCode.ContainsKey(x.Currency)) ? MappingCurrencyCode[x.Currency] : "",
                    Terminal               = x.Terminal,
                    Rate             = string.Format(culture, "{0:n}", Int32.Parse(x.Rate)),
                    ConversionAmount = x.ConversionAmount,
                    Amount2          = x.Amount2,
                    FromAccount      = x.FromAccount,
                    ToAccount        = x.ToAccount,
                    PayeeCode        = x.PayeeCode,
                    PayeeNumber      = x.PayeeNumber,
                    SequenceNumber   = x.SequenceNumber
                }
                                         );

                int pageIndex    = Convert.ToInt32(page) - 1;
                int pageSize     = rows;
                int totalRecords = trx.Count();
                int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)pageSize);

                data = data.Skip((page - 1) * pageSize).Take(pageSize);

                var       recordCount = data.Count();
                JSONTable jTable      = new JSONTable();
                jTable.total   = totalPages;
                jTable.page    = page;
                jTable.records = totalRecords;
                jTable.rows    = data.ToArray();

                return(Json(jTable, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 9
0
        // public void AddItem(Snack snack, int index)
        // {
        //     Snacks.Insert(index, snack);
        // }

        // public void AddItem(Electronic electronic)
        // {
        //     //add is the new push
        //     Electronics.Add(electronic);
        // }

        // public void AddItem(Electronic electronic, int index)
        // {
        //     Electronics.Insert(index, electronic);
        // }
        #endregion

        public string AddQuarter()
        {
            CurrentTransaction += .25m;
            return(CurrentTransaction.ToString());
        }
Ejemplo n.º 10
0
 public void RollbackTransaction()
 {
     CurrentTransaction?.Rollback();
 }
Ejemplo n.º 11
0
 public void CommitTransaction()
 {
     CurrentTransaction?.Commit();
 }
Ejemplo n.º 12
0
 public virtual void Commit()
 {
     CurrentTransaction?.Complete();
 }
Ejemplo n.º 13
0
 public void Commit()
 {
     CurrentTransaction.Commit();
     CurrentTransaction = null;
 }