public void Update(TaxonomyReportModel entity)
        {
            LogLine(string.Format("update {0} - {1} in database.", entity.Id, entity.Description));

            int rowsAffected = Connection.Execute(@"UPDATE  XMS_TAXONOMY_REPORTS  
                            SET DESCRIPTION =: Description,
                            PERIOD_TYPE = :PeriodType,  
                            ENTRY_URI = :EntryUri, 
                            FILE_NAME = :FileName,  
                            ENTITY_IDENTIFIER = :EntityIdentifire,  
                            CURRENCY = :Currency, 
                            DECIMALS = :Decimals, 
                            ENTITY_SCHEMA = :EntitySchema, 
                            DECIMAL_DECIMALS = :DecimalDecimals, 
                            INTEGER_DECIMALS = :IntegerDecimals, 
                            MONETARY_DECIMALS = :MonetaryDecimals, 
                            PURE_DECIMALS = :PureDecimals, 
                            SHARES_DECIMALS = :SharesDecimals, 
                            TN_PROCESSOR_ID = :TnProcessorId, 
                            TN_REVISION_ID = :TnRevisonId
                            WHERE TAXONOMY_ID = :TaxonomyId  and ID = :Id",
                                                  new
            {
                Description      = entity.Description,
                PeriodType       = OracleHelpers.PeriodTypeToString(entity.PeriodType),
                TaxonomyId       = entity.TaxonomyId,
                Id               = entity.Id,
                EntryUri         = entity.EntryUri,
                FileName         = entity.FileName,
                EntityIdentifire = entity.EntityIdentifier,
                Currency         = entity.Currency,
                Decimals         = entity.Decimals,
                EntitySchema     = entity.EntitySchema,
                DecimalDecimals  = entity.DecimalDecimals,
                IntegerDecimals  = entity.IntegerDecimals,
                MonetaryDecimals = entity.MonetaryDecimals,
                PureDecimals     = entity.PureDecimals,
                SharesDecimals   = entity.SharesDecimals,
                TnProcessorId    = entity.TnProcessorId,
                TnRevisonId      = entity.TnRevisionId,
            }
                                                  );

            if (rowsAffected == 0)
            {
                throw new NoRowsAffectedException("Update TaxonomyReport failed rowsAffected :" + rowsAffected);
            }
        }
Пример #2
0
        public void Add(LocalReportModel entity)
        {
            LogLine(string.Format("adding {0} - {1} to database.", entity.Id, entity.Description));


            int rowsAffected = Connection.Execute(@"INSERT INTO XMS_LOCAL_REPORTS (TAXONOMY_ID,
                                                                                        SOURCE_ID,
                                                                                        ID,
                                                                                        ENTRY_URI,
                                                                                        FILE_NAME,
                                                                                        DESCRIPTION,
                                                                                        ENTITY_IDENTIFIER,
                                                                                        PERIOD_TYPE,
                                                                                        CURRENCY,
                                                                                        DECIMALS,
                                                                                        ENTITY_SCHEMA,
                                                                                        DECIMAL_DECIMALS,
                                                                                        INTEGER_DECIMALS,
                                                                                        MONETARY_DECIMALS,
                                                                                        PURE_DECIMALS,
                                                                                        SHARES_DECIMALS,
                                                                                        TN_PROCESSOR_ID,
                                                                                        TN_REVISION_ID,
                                                                                        UPDATE_USER,
                                                                                        UPDATE_USER_DSC,
                                                                                        UPDATE_DATE) 
                                                                                VALUES (:TaxonomyId,
                                                                                        :SourceId,
                                                                                        :Id,
                                                                                        :EntryUri,
                                                                                        :FileName,
                                                                                        :Description,
                                                                                        :EntityIdentifire,
                                                                                        :PeriodType,
                                                                                        :Currency,
                                                                                        :Decimals,
                                                                                        :EntitySchema,
                                                                                        :DecimalDecimals,
                                                                                        :IntegerDecimals,
                                                                                        :MonetaryDecimals,
                                                                                        :PureDecimals,
                                                                                        :SharesDecimals,
                                                                                        :TnProcessorId,
                                                                                        :TnRevisionId,
                                                                                        :UpdateDate,
                                                                                        :UpdateUser,
                                                                                        :UpdateUserDsc)",
                                                  new
            {
                Description      = entity.Description,
                PeriodType       = OracleHelpers.PeriodTypeToString(entity.PeriodType),
                TaxonomyId       = entity.TaxonomyId,
                Id               = entity.Id,
                SourceId         = entity.SourceId,
                EntryUri         = entity.EntryUri,
                FileName         = entity.FileName,
                EntityIdentifire = entity.EntityIdentifier,
                Currency         = entity.Currency,
                Decimals         = entity.Decimals,
                EntitySchema     = entity.EntitySchema,
                DecimalDecimals  = entity.DecimalDecimals,
                IntegerDecimals  = entity.IntegerDecimals,
                MonetaryDecimals = entity.MonetaryDecimals,
                PureDecimals     = entity.PureDecimals,
                SharesDecimals   = entity.SharesDecimals,
                TnProcessorId    = entity.TnProcessorId,
                TnRevisionId     = entity.TnRevisionId,
                UpdateDate       = entity.UpdateDate,
                UpdateUser       = entity.UpdateUser,
                UpdateUserDsc    = entity.UpdateUserDsc,
            });

            if (rowsAffected == 0)
            {
                throw new NoRowsAffectedException("Add LocalReport failed rowsAffected :" + rowsAffected);
            }
        }