public void Inicializar() { RegistroBase.InicializarProcessamentoRegistros(); DbCommand cmd = UndTrabalho.DBArquivoSpedContabil.GetStoredProcCommand( SqlExpressionsContimaticRepository.GetExpressionNovaSequenciaArquivo()); this._NumeroIdentificacaoArquivo = Convert.ToInt32( UndTrabalho.DBArquivoSpedContabil.ExecuteScalar(cmd)); this._informacoesArquivo = this.GetRecordInformacoesArquivo(); this._informacoesArquivo.CodigoEmpresa = UndTrabalho.CodigoEmpresa; this._informacoesArquivo.DataInicial = UndTrabalho.DataInicial; this._informacoesArquivo.DataFinal = UndTrabalho.DataFinal; this._informacoesArquivo.TipoArquivo = UndTrabalho.TipoArquivo.ToString().ToUpper(); this._informacoesArquivo.TipoRemessa = UndTrabalho.TipoRemessa.ToString().ToUpper(); this._informacoesArquivo.Save(); }
private ArquivoContmaticRecord GetRecordInformacoesArquivo() { IDictionary <string, string> properties = new Dictionary <string, string>(); properties.Add("connection.driver_class", ConfigurationManager.AppSettings["ActiveRecordDriver"]); properties.Add("dialect", ConfigurationManager.AppSettings["ActiveRecordDialect"]); properties.Add("connection.provider", ConfigurationManager.AppSettings["ActiveRecordConnectionProvider"]); properties.Add("connection.connection_string", ConfigurationManager.ConnectionStrings["DBArquivoSpedContmatic"].ConnectionString); //criar o config do contmatic properties.Add("proxyfactory.factory_class", ConfigurationManager.AppSettings["ActiveRecordProxyFactory"]); InPlaceConfigurationSource source = new InPlaceConfigurationSource(); source.Add(typeof(ActiveRecordBase), properties); ActiveRecordStarter.Initialize(source, typeof(ArquivoContmaticRecord)); return(ArquivoContmaticRecord.Find(this._NumeroIdentificacaoArquivo)); }