Example #1
0
        /// <summary>
        /// method usage of the web service method RetrievePanelOfReporters
        /// Clients should call this method to obtain a list of all financial institutions who filed Call Report
        /// for a particular reporting period. This method should typically be called once or infrequently to obtain
        /// the complete list of banks in the PoR. Subsequently, the web clients should call RetrieveFilersSinceDate
        /// to find out the list of banks that have filed their original or amended Call Reports.
        async public void LoadReportingInstitutions(FilingProcessCommandArgs commandLineArgs)
        {
            FFIECPublicWebService.ReportingDataSeriesName dsName = FFIECPublicWebService.ReportingDataSeriesName.Call;
            FFIECPublicWebService.RetrievalService        proxy  = new FFIECPublicWebService.RetrievalService();
            UsernameToken userToken = new UsernameToken(commandLineArgs.Credentials.UserName, commandLineArgs.Credentials.Password, PasswordOption.SendHashed);

            proxy.RequestSoapContext.Security.Tokens.Add(userToken);
            proxy.Timeout = 400000;

            FFIECPublicWebService.ReportingFinancialInstitution[] reporters =
                proxy.RetrievePanelOfReporters(dsName, commandLineArgs.ReportingCycleEndDate);

            Console.WriteLine("OK" + "Retrieved panel of reporters. ");
            foreach (FFIECPublicWebService.ReportingFinancialInstitution reporter in reporters)
            {
                Console.WriteLine("Adding " + reporter.Name.Trim() + "|" + reporter.ID_RSSD + "|" + reporter.State + "|" + reporter.HasFiledForReportingPeriod);

                var reportingInstitution = await ReportingInstitutionTable.Where(riItem => riItem.ID_RSSD == reporter.ID_RSSD).ToListAsync();

                if (reportingInstitution.Count == 0)
                {
                    CallReporter.Model.ReportingFinancialInstitution newInstitution = new CallReporter.Model.ReportingFinancialInstitution();

                    // ToDo: Put assignment in its own method, create assignment operators
                    newInstitution.Address                    = reporter.Address;
                    newInstitution.City                       = reporter.City;
                    newInstitution.FDICCertNumber             = reporter.FDICCertNumber;
                    newInstitution.FilingType                 = reporter.FilingType;
                    newInstitution.HasFiledForReportingPeriod = reporter.HasFiledForReportingPeriod;
                    newInstitution.ID_RSSD                    = reporter.ID_RSSD;
                    newInstitution.Name                       = reporter.Name;
                    newInstitution.OCCChartNumber             = reporter.OCCChartNumber;
                    newInstitution.OTSDockNumber              = reporter.OTSDockNumber;
                    newInstitution.PrimaryABARoutNumber       = reporter.PrimaryABARoutNumber;
                    newInstitution.State                      = reporter.State;
                    newInstitution.ZIP = reporter.ZIP;

                    await ReportingInstitutionTable.InsertAsync(newInstitution);
                }
                else
                {
                    await UpdateAsync(ReportingInstitutionTable, reportingInstitution[0], reporter);
                }
            }

            Console.WriteLine("OK" + "Total members of POR = " + reporters.Length.ToString());
        }
Example #2
0
        public async Task UpdateAsync(IMobileServiceTable <CallReporter.Model.ReportingFinancialInstitution> reportingInstitutionTable,
                                      CallReporter.Model.ReportingFinancialInstitution cachedReportingItem,
                                      CallReporter.Model.ReportingFinancialInstitution fetchedReportingItem)
        {
            cachedReportingItem.Address                    = fetchedReportingItem.Address;
            cachedReportingItem.City                       = fetchedReportingItem.City;
            cachedReportingItem.FDICCertNumber             = fetchedReportingItem.FDICCertNumber;
            cachedReportingItem.FilingType                 = fetchedReportingItem.FilingType;
            cachedReportingItem.HasFiledForReportingPeriod = fetchedReportingItem.HasFiledForReportingPeriod;
            cachedReportingItem.Name                       = fetchedReportingItem.Name;
            cachedReportingItem.OCCChartNumber             = fetchedReportingItem.OCCChartNumber;
            cachedReportingItem.OTSDockNumber              = fetchedReportingItem.OTSDockNumber;
            cachedReportingItem.PrimaryABARoutNumber       = fetchedReportingItem.PrimaryABARoutNumber;
            cachedReportingItem.State                      = fetchedReportingItem.State;
            cachedReportingItem.ZIP = fetchedReportingItem.ZIP;

            // Update cached record just in case something changed so our cache will be up to date
            await reportingInstitutionTable.UpdateAsync(cachedReportingItem);
        }