Beispiel #1
0
        public IHttpActionResult TransactionHistory(string accountNo, string country, string currency)
        {
            DateTime startDate = new DateTime(2014, 01, 01);
            DateTime endDate   = DateTime.Now;
            //Temp
            string sdate = String.Format("{0:00}", startDate.Day) +
                           String.Format("{0:00}", startDate.Month) + startDate.Year.ToString().Substring(2, 2);

            string edate = String.Format("{0:00}", endDate.Day) +
                           String.Format("{0:00}", endDate.Month) + endDate.Year.ToString().Substring(2, 2);


            string environment = System.Configuration.ConfigurationManager.AppSettings["Environment." + country];

            EquationAdapter             adapter    = new EquationAdapter();
            Dictionary <string, string> dictionary = this.TransactionCodes(country);

            TransactionHistoryRequest request = new TransactionHistoryRequest();

            request.TransactionHeader = new TransactionHeader(country, environment, "1", 1);
            request.Currency          = currency;
            request.AccountBranch     = accountNo.Substring(0, 4);
            request.AccountBasicNo    = accountNo.Substring(4, 6);
            request.AccountSuffix     = accountNo.Substring(10, 3);
            request.StartDate         = sdate;
            request.EndDate           = edate;
            request.MarketSegment     = "00";
            request.ServicePackage    = "00";

            TransactionHistoryResponse response = adapter.TransactionHistory(request);

            if (response.ResponseCode == Constants.Equation_Success)
            {
                foreach (Transaction transaction in response.Transactions)
                {
                    if (dictionary.ContainsKey(transaction.Code))
                    {
                        transaction.Description = dictionary[transaction.Code].ToString();
                    }
                    else
                    {
                        transaction.Description = transaction.Code;
                    }
                }
                return(Json(response));
            }
            else
            {
                throw new HttpRequestException(response.ResponseDescription);
            }
        }
Beispiel #2
0
        public IHttpActionResult PortfolioInquiry(string customerNo, string country, string currency)
        {
            DateTime startTime = DateTime.Now;

            string environment = System.Configuration.ConfigurationManager.AppSettings["Environment." + country];

            EquationAdapter             adapter    = new EquationAdapter();
            Dictionary <string, string> dictionary = this.AccountTypes(country);

            PortfolioRequest request = new PortfolioRequest();

            request.TransactionHeader = new TransactionHeader(country, environment, "1", 1);
            request.CustomerNo        = customerNo;
            request.Currency          = currency;
            request.MarketSegment     = "00";
            request.ServicePackage    = "00";
            PortfolioResponse response = adapter.PortfolioInquiry(request);

            response.ResponseTime = DateTime.Now.Subtract(startTime).TotalMilliseconds;

            if (response.ResponseCode == Constants.Equation_Success)
            {
                foreach (Account account in response.Accounts)
                {
                    if (dictionary.ContainsKey(account.Type))
                    {
                        account.Description = dictionary[account.Type].ToString();
                    }
                    else
                    {
                        account.Description = account.Type;
                    }
                }
                return(Json(response));
            }
            else
            {
                throw new HttpRequestException(response.ResponseDescription);
            }
        }
Beispiel #3
0
        public IHttpActionResult CustomerInquiry(string customerNo, string country)
        {
            DateTime        startTime   = DateTime.Now;
            string          environment = System.Configuration.ConfigurationManager.AppSettings["Environment." + country];
            CustomerRequest request     = new CustomerRequest();

            request.TransactionHeader = new TransactionHeader(country, environment, "1", 1);
            request.CustomerNo        = customerNo;

            EquationAdapter adapter  = new EquationAdapter();
            Customer        response = adapter.CustomerInquiry(request);

            response.ResponseTime = DateTime.Now.Subtract(startTime).TotalMilliseconds;
            if (response.ResponseCode == Constants.Equation_Success)
            {
                return(Json(response));
            }
            else
            {
                throw new HttpRequestException(response.ResponseDescription);
            }
        }