Beispiel #1
0
        private DataTable ConvertToFilingDataTable(List <FilingRecord> records)
        {
            DataTable dtFilingData = DataAccessTypes.CreateFilingDataTable();

            foreach (var r in records)
            {
                DataRow rowFilingData = dtFilingData.NewRow();

                rowFilingData["Code"] = r.Code;
                if (r.Value != null)
                {
                    rowFilingData["Value"] = (decimal)r.Value;
                }
                else
                {
                    rowFilingData["Value"] = DBNull.Value;
                }

                if (r.Value_Str != null)
                {
                    rowFilingData["Value_Str"] = r.Value_Str;
                }
                else
                {
                    rowFilingData["Value_Str"] = DBNull.Value;
                }

                if (r.Value_Dttm != null)
                {
                    rowFilingData["Value_Dttm"] = r.Value_Dttm;
                }
                else
                {
                    rowFilingData["Value_Dttm"] = DBNull.Value;
                }

                rowFilingData["UnitName"]         = r.Unit;
                rowFilingData["PeriodStart"]      = r.PeriodStart != DateTime.MinValue ? r.PeriodStart : r.Instant;
                rowFilingData["PeriodEnd"]        = r.PeriodEnd != DateTime.MinValue ? r.PeriodEnd : r.Instant;
                rowFilingData["SourceFactId"]     = r.SourceFactId;
                rowFilingData["MultivalueFactId"] = r.FactId;

                dtFilingData.Rows.Add(rowFilingData);
            }

            return(dtFilingData);
        }
Beispiel #2
0
        private DataTable ConverToMetadataTable(List <InsertFilingDetailsParams.FilingMetadaRecord> records)
        {
            DataTable dtMetadata = DataAccessTypes.CreateFilingMetadataTable();

            foreach (var r in records)
            {
                DataRow rowMetadata = dtMetadata.NewRow();

                rowMetadata["Name"]     = r.Name;
                rowMetadata["Value"]    = r.Value;
                rowMetadata["DataType"] = r.Type;

                dtMetadata.Rows.Add(rowMetadata);
            }

            return(dtMetadata);
        }