Пример #1
0
        public IActionResult OfferLetterReportInvestment(string applicationRefNo)
        {
            ReportRespObj response2 = new ReportRespObj();

            if (string.IsNullOrEmpty(applicationRefNo))
            {
                return(View(new ReportRespObj {
                    Status = new APIResponseStatus {
                        IsSuccessful = false
                    }
                }));
            }
            try
            {
                var gosGatewayClient        = _httpClientFactory.CreateClient("GOSDEFAULTGATEWAY");
                HttpResponseMessage result1 = new HttpResponseMessage();
                HttpResponseMessage result2 = new HttpResponseMessage();
                try
                {
                    result2 = gosGatewayClient.GetAsync($"/loanapplication/generate/offerletter/investment?ApplicationRef={applicationRefNo}").Result;
                    if (!result2.IsSuccessStatusCode)
                    {
                        return(View(new ReportRespObj {
                            Status = new APIResponseStatus {
                                IsSuccessful = false
                            }
                        }));
                    }
                    var data2 = result2.Content.ReadAsStringAsync().Result;
                    response2 = JsonConvert.DeserializeObject <ReportRespObj>(data2);
                }
                catch (Exception ex) { throw new HttpRequestException(); }

                if (response2.Status.IsSuccessful)
                {
                    var dto = new ReportRespObj
                    {
                        OfferLetterDetails    = response2.OfferLetterDetails,
                        OfferLetterRepayments = response2.OfferLetterRepayments,
                    };
                    return(View(dto));
                }
                return(View(new ReportRespObj {
                    Status = new APIResponseStatus {
                        IsSuccessful = false
                    }
                }));
            }
            catch (Exception ex)
            {
                return(View(response2.Status));
            }
        }
Пример #2
0
        public IActionResult ProfitandLossReport(DateTime date1, DateTime date2)
        {
            ReportRespObj response2 = new ReportRespObj();

            try
            {
                var gosGatewayClient        = _httpClientFactory.CreateClient("GOSDEFAULTGATEWAY");
                HttpResponseMessage result1 = new HttpResponseMessage();
                HttpResponseMessage result2 = new HttpResponseMessage();
                try
                {
                    result2 = gosGatewayClient.GetAsync($"/gl/generate/plreport?date1={date1}&date2={date2}").Result;
                    if (!result2.IsSuccessStatusCode)
                    {
                        return(View(new ReportRespObj {
                            Status = new APIResponseStatus {
                                IsSuccessful = false
                            }
                        }));
                    }
                    var data2 = result2.Content.ReadAsStringAsync().Result;
                    response2 = JsonConvert.DeserializeObject <ReportRespObj>(data2);
                }
                catch (Exception ex) { throw new HttpRequestException(); }

                if (response2.Status.IsSuccessful)
                {
                    var dto = new ReportRespObj
                    {
                        PLreports = response2.PLreports,
                    };
                    return(View(dto));
                }
                return(View(new ReportRespObj {
                    Status = new APIResponseStatus {
                        IsSuccessful = false
                    }
                }));
            }
            catch (Exception ex)
            {
                return(View(response2.Status));
            }
        }
Пример #3
0
        public IActionResult InvestmentCorporateCustomerReport(DateTime date1, DateTime date2, int customerTypeId)
        {
            ReportRespObj response2 = new ReportRespObj();

            try
            {
                var gosGatewayClient        = _httpClientFactory.CreateClient("GOSDEFAULTGATEWAY");
                HttpResponseMessage result2 = new HttpResponseMessage();
                try
                {
                    result2 = gosGatewayClient.GetAsync($"/loanapplication/investment/corporate/customer/report?date1={date1}&date2={date2}&customerTypeId={customerTypeId}").Result;
                    if (!result2.IsSuccessStatusCode)
                    {
                        return(View(new ReportRespObj {
                            Status = new APIResponseStatus {
                                IsSuccessful = false
                            }
                        }));
                    }
                    var data2 = result2.Content.ReadAsStringAsync().Result;
                    response2 = JsonConvert.DeserializeObject <ReportRespObj>(data2);
                }
                catch (Exception ex) { throw new HttpRequestException(); }

                if (response2.Status.IsSuccessful)
                {
                    var dto = new ReportRespObj
                    {
                        CorporateInvestorCustomers = response2.CorporateInvestorCustomers,
                    };
                    return(View(dto));
                }
                return(View(new ReportRespObj {
                    Status = new APIResponseStatus {
                        IsSuccessful = false
                    }
                }));
            }
            catch (Exception ex)
            {
                return(View(response2.Status));
            }
        }