Exemple #1
0
        public static SMSTopUpTransaction SMSTopUp(Params request)
        {
            SMSTopUpTransaction transaction = new SMSTopUpTransaction();
            Params param = new Params()
            {
                Parameter = new Dictionary <string, string>()
            };

            try
            {
                param.RequestTransType = "GetTopUpTransactionByMobileNo";
                param.Parameter.Add("FK_CustID", request.Parameter.ContainsKey("mobileNo") ? request.Parameter["mobileNo"].Trim() : string.Empty);
                param.Parameter.Add("StartDate", Formatter.ToStringExact(Convert.ToDateTime(request.Parameter["startDate"]), "MM/dd/yyyy"));
                param.Parameter.Add("EndDate", Formatter.ToStringExact(Convert.ToDateTime(request.Parameter["endDate"]).AddDays(1), "MM/dd/yyyy"));
                param.WSDL = "ESBDBDelimiter";
                ESBData data = EAI.RetrieveESBData(param);

                if (data.Result != null && data.Result.Count > 0)
                {
                    foreach (StringDictionary entry in data.Result)
                    {
                        SMSTopUpTRX trx             = new SMSTopUpTRX();
                        DateTime?   TransactionDate = Formatter.ParseExact(entry["createddate"], "MM/dd/yyyy hh:mm:ss tt");
                        trx.TransactionDate     = TransactionDate;
                        trx.RequestId           = entry["billerid"];
                        trx.AtmCardNumber       = entry["cardnumber"];
                        trx.AccountNumber       = entry["acctidfrom"];
                        trx.ValueOfTransactions = Formatter.GetParsedNumeric(entry["amt"], false);
                        trx.ResponseCode        = Utility.GetDisplayText("TransactionAttributeMapping", "SMS Top Up", "Response Code", entry["srvrstatuscode"]);
                        transaction.Transactions.Add(trx);
                    }

                    param.Parameter        = new Dictionary <string, string>();
                    param.RequestTransType = "GetTopUpInfoByMobileNo";
                    param.Parameter.Add("CustId", request.Parameter.ContainsKey("mobileNo") ? request.Parameter["mobileNo"].Trim() : string.Empty);
                    param.WSDL = "ESBDBDelimiter";
                    ESBData information = EAI.RetrieveESBData(param);
                    if (information.Result != null && information.Result.Count > 0)
                    {
                        transaction.ATMCardNumber     = information.Result[0]["cardnumber"];
                        transaction.ATMCardHolderName = information.Result[0]["custname"];
                        transaction.Status            = Utility.GetStatusInfo(information.Result[0]["status"]);
                    }
                }
            }
            catch (Exception e)
            {
            }
            return(transaction);
        }
Exemple #2
0
        public JsonResult LoadGrid(string sidx, string sord, int rows, int page = 1)
        {
            string getSearchby  = Request["_searchby"];
            string getVal       = Request["_val"];
            string getStartDate = Request["_startDate"];
            string getEndDate   = Request["_endDate"];
            string getTrxType   = Request["_trxType"];

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

            param.RequestTransType = "GetTopUpTransactionByMobileNo";
            param.Parameter.Add("mobileNo", getVal);
            param.Parameter.Add("startDate", getStartDate);
            param.Parameter.Add("endDate", getEndDate);

            SMSTopUpTransaction model = ChannelTransaction.SMSTopUp(param);
            var trx = model.Transactions.ToList().Select(x => new
            {
                AtmCardNumber       = x.AtmCardNumber,
                TransactionDate     = x.TransactionDate,
                RequestId           = x.RequestId,
                AccountNumber       = x.AccountNumber,
                ValueOfTransactions = x.ValueOfTransactions,
                ResponseCode        = x.ResponseCode,
            });

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

            trx = trx.Skip((page - 1) * pageSize).Take(pageSize);
            var       recordCount = trx.Count();
            JSONTable jTable      = new JSONTable();

            jTable.total   = totalPages;
            jTable.page    = page;
            jTable.records = totalRecords;
            jTable.rows    = trx.ToArray();

            jTable.additional = model.ATMCardHolderName + "<@z>" + model.ATMCardNumber + "<@z>" + model.Status;

            return(Json(jTable, JsonRequestBehavior.AllowGet));
        }