Exemplo n.º 1
0
        protected List <LifeTimeObject> GetScenarioRedfaultLifetimePdResult(ECL_Scenario _scenario)
        {
            var redefaultLifetimePd = new List <LifeTimeObject>();

            switch (_scenario)
            {
            case ECL_Scenario.Best:
                redefaultLifetimePd = FileSystemStorage <LifeTimeObject> .ReadCsvData(this._eclId, ECLStringConstants.i.PdRedefaultLifetimeBests_Table(this._eclType));

                break;

            case ECL_Scenario.Optimistic:
                redefaultLifetimePd = FileSystemStorage <LifeTimeObject> .ReadCsvData(this._eclId, ECLStringConstants.i.PdRedefaultLifetimeOptimistics_Table(this._eclType));

                break;

            case ECL_Scenario.Downturn:
                redefaultLifetimePd = FileSystemStorage <LifeTimeObject> .ReadCsvData(this._eclId, ECLStringConstants.i.PdRedefaultLifetimeDownturns_Table(this._eclType));

                break;

            default:
                return(null);
            }
            Log4Net.Log.Info($"LGD_RedefaultLifetimePD - {_scenario}");
            return(redefaultLifetimePd);
        }
        public List <LifeTimeObject> Get_LifetimePd_And_RedefaultLifetimePD_Result()
        {
            var lifetimePd = new List <LifeTimeObject>();

            switch (_scenario)
            {
            case ECL_Scenario.Best:
                lifetimePd = FileSystemStorage <LifeTimeObject> .ReadCsvData(this._eclId, ECLStringConstants.i.PdLifetimeBests_Table(this._eclType));

                break;

            case ECL_Scenario.Optimistic:
                lifetimePd = FileSystemStorage <LifeTimeObject> .ReadCsvData(this._eclId, ECLStringConstants.i.PdLifetimeOptimistics_Table(this._eclType));

                break;

            case ECL_Scenario.Downturn:
                lifetimePd = FileSystemStorage <LifeTimeObject> .ReadCsvData(this._eclId, ECLStringConstants.i.PdLifetimeDownturns_Table(this._eclType));

                break;

            default:
                return(null);
            }

            return(lifetimePd);
        }
        public bool ProcessFrameworkResult(string filename, FrameworkParameters input)
        {
            try
            {
                var frameworkResult = FileSystemStorage <ResultDetailDataMore> .ReadCsvData(filename);

                var c = new ResultDetailDataMore();


                Type           myObjOriginalType = c.GetType();
                PropertyInfo[] myProps           = myObjOriginalType.GetProperties();

                var dt = new System.Data.DataTable();
                for (int i = 0; i < myProps.Length; i++)
                {
                    dt.Columns.Add(myProps[i].Name, myProps[i].PropertyType);
                }

                dt.Columns.Add($"{input.EclType}EclId", typeof(Guid));


                //var lstContractNoLog = new List<string>();

                foreach (var _d in frameworkResult)
                {
                    //if (lstContractNoLog.Any(o => o == _d.ContractNo))
                    //    continue;

                    //lstContractNoLog.Add(_d.ContractNo);
                    try { c.OriginalOutstandingBalance = 0.0; } catch { }
                    //(double)batchContracts.FirstOrDefault(o => o.ContractNo == c.ContractNo).OutstandingBalanceLCY; } catch { }

                    var Id = Guid.NewGuid();
                    dt.Rows.Add(new object[]
                    {
                        Id, _d.Stage, _d.Outstanding_Balance, _d.ECL_Best_Estimate, _d.ECL_Optimistic, _d.ECL_Downturn, _d.Impairment_ModelOutput,
                        _d.Overrides_Stage, _d.Overrides_TTR_Years, _d.Overrides_FSV, _d.Overrides_Overlay, _d.Overrides_ECL_Best_Estimate, _d.Overrides_ECL_Optimistic, _d.Overrides_ECL_Downturn, _d.Overrides_Impairment_Manual, _d.ContractNo, _d.AccountNo,
                        _d.CustomerNo, _d.Segment, _d.ProductType, _d.Sector, _d.OriginalOutstandingBalance, input.EclId
                    });
                }

                //Save to Report Detail
                var r = DataAccess.i.ExecuteBulkCopy(dt, ECLStringConstants.i.EclFramworkReportDetail(input.EclType));

                return(true);
            }
            catch (Exception ex)
            {
                Log4Net.Log.Error(ex);
                return(false);
            }
        }
        private List <EIRProjections> GetEirProjectionData()
        {
            var r = FileSystemStorage <EIRProjections> .ReadCsvData(this._eclId, ECLStringConstants.i.EadEirProjections_Table(this._eclType));

            return(r);
        }
Exemplo n.º 5
0
        public List <SicrInputs> GetSircInputResult()
        {
            var sicrData = FileSystemStorage <SicrInputs> .ReadCsvData(this._eclId, ECLStringConstants.i.PdMappings_Table(this._eclType));

            return(sicrData);
        }
Exemplo n.º 6
0
        internal List <PdMappings> GetPdMapping()
        {
            var pdMapping = FileSystemStorage <PdMappings> .ReadCsvData(this._eclId, ECLStringConstants.i.PdMappings_Table(this._eclType));

            return(pdMapping);
        }