Exemple #1
0
        public int TaskModifyProcessParamRegGeral(int _CodigoEmpresa, int _CodigoNatFunc, int _CodigoNatFuncLider, int _CodigoNatCliente, int _CodigoNatFornecedor, int _CodigoNatBanco, int _CodigoStatusAtivo, int _CodigoStatusInativo, string _PermiteCGCCPFZerado, int _CodigoNatTomadora, int _CodigoNatResp, string _PermiteCGCCPFDuplicado, string _TipoModificacao)
        {
            int _Result = 0;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Rg_ModificaProcessoParamRegGeral]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoEmpresa", System.Data.DbType.Int32, _CodigoEmpresa));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoNatFunc", System.Data.DbType.Int32, _CodigoNatFunc));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoNatFuncLider", System.Data.DbType.Int32, _CodigoNatFuncLider));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoNatCliente", System.Data.DbType.Int32, _CodigoNatCliente));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoNatFornecedor", System.Data.DbType.Int32, _CodigoNatFornecedor));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoNatBanco", System.Data.DbType.Int32, _CodigoNatBanco));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoStatusAtivo", System.Data.DbType.Int32, _CodigoStatusAtivo));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoStatusInativo", System.Data.DbType.Int32, _CodigoStatusInativo));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@PermiteCGCCPFZerado", System.Data.DbType.String, _PermiteCGCCPFZerado));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoNatTomadora", System.Data.DbType.Int32, _CodigoNatTomadora));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoNatResp", System.Data.DbType.Int32, _CodigoNatResp));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@PermiteCGCCPFDuplicado", System.Data.DbType.String, _PermiteCGCCPFDuplicado));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@ModifyType", System.Data.DbType.String, _TipoModificacao));

            try
            {
                _Result = Convert.ToInt32(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteScalar));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
Exemple #2
0
        public SessaoUsuarioLogin RetornaProcessoSessaoUsuario(string _Usuario)
        {
            SessaoUsuarioLogin _Result           = null;
            DataTable          _DataTable        = new DataTable();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = " SELECT Usuario," +
                                                   " IdSession," +
                                                   " DateTimeSession," +
                                                   " MachineName," +
                                                   " MachineIP," +
                                                   " LogonNumber" +
                                                   " FROM ge_sessao_usuario" +
                                                   " WHERE Usuario = " + "'" + _Usuario + "'";

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.Text, null, ExecuteType.ExecuteDataTable);

                if (_DataTable.Rows.Count > 0)
                {
                    _Result = new SessaoUsuarioLogin(_DataTable.Rows[0]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _DataTable.Dispose();
            }

            return(_Result);
        }
Exemple #3
0
        public int TaskModifyProcessEmpresa(int _CodigoEmpresa, string _DescricaoEmpresa, string _DescricaoEmpresaRed, int _CodigoEmpresaConsolidada, string _Ativa, int _CodigoRg, string _Host, int _Port, string _Username, string _Senha, string _Email, string _EnderecoBanco, string _Versao, string _TipoModificacao)
        {
            int _Result = 0;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Rg_ModificaProcessoEmpresa]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoEmpresa", System.Data.DbType.Int32, _CodigoEmpresa));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@DescricaoEmpresa", System.Data.DbType.String, _DescricaoEmpresa));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@DescricaoEmpresaRed", System.Data.DbType.String, _DescricaoEmpresaRed));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoEmpresaConsolidada", System.Data.DbType.Int32, _CodigoEmpresaConsolidada));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Ativa", System.Data.DbType.String, _Ativa));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoRg", System.Data.DbType.Int32, _CodigoRg));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Host", System.Data.DbType.String, _Host));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Port", System.Data.DbType.Int32, _Port));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Username", System.Data.DbType.String, _Username));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Senha", System.Data.DbType.String, _Senha));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Email", System.Data.DbType.String, _Email));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@EnderecoBanco", System.Data.DbType.String, _EnderecoBanco));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Versao", System.Data.DbType.String, _Versao));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@ModifyType", System.Data.DbType.String, _TipoModificacao));

            try
            {
                _Result = Convert.ToInt32(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteScalar));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
Exemple #4
0
        public int ModificaProcessoSessaoUsuario(string _Usuario, string _IdSession, DateTime _DateTimeSession, string _MachineName, string _MachineIP, int _LogonNumber)
        {
            int _Result = 0;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Modifica_Processo_Sessao_Usuario]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Usuario", System.Data.DbType.String, _Usuario));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@IdSession", System.Data.DbType.String, _IdSession));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@DateTimeSession", System.Data.DbType.DateTime, _DateTimeSession));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@MachineName", System.Data.DbType.String, _MachineName));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@MachineIP", System.Data.DbType.String, _MachineIP));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@LogonNumber", System.Data.DbType.Int32, _LogonNumber));

            try
            {
                _Result = Convert.ToInt32(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteNonQuery));
            }
            catch (Exception _Ex)
            {
                throw _Ex;
            }

            return(_Result);
        }
        public List <GeProcesso> TaskGetCollectionGeProcessoByEmpresaAplicacaoTipoProcesso(int _CodigoEmpresa, int _CodigoAplicacao, string _Usuario, string _TipoDeModificacao)
        {
            List <GeProcesso>  _Result           = new List <GeProcesso>();
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            DataTable          _DataTable        = null;
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Ge_RetornaProcessoDeLiberacaoUsuarioPorEmpresaAplicacaoTipoProcesso]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoEmpresa", System.Data.DbType.Int32, _CodigoEmpresa));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoAplicacao", System.Data.DbType.Int32, _CodigoAplicacao));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Usuario", System.Data.DbType.String, _Usuario));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@TipoDeModificacao", System.Data.DbType.String, _TipoDeModificacao));

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteDataTable);

                foreach (DataRow _Row in _DataTable.Rows)
                {
                    _Result.Add(new GeProcesso(_Row));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
        public int TaskModifyProcessProcesso(int _CodigoProcesso, string _DescricaoProcesso, int _CodigoTipoProcesso, int _CodigoAplicacao, string _Ativo, string _Form, int _SequenciaProcesso, string _TipoModificacao)
        {
            int _Result = 0;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Ge_ModificaProcessoProcesso]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoProcesso", System.Data.DbType.Int32, _CodigoProcesso));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@DescricaoProcesso", System.Data.DbType.String, _DescricaoProcesso));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoTipoProcesso", System.Data.DbType.Int32, _CodigoTipoProcesso));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoAplicacao", System.Data.DbType.Int32, _CodigoAplicacao));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Ativo", System.Data.DbType.String, _Ativo));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Form", System.Data.DbType.String, _Form));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@SequenciaProcesso", System.Data.DbType.Int32, _SequenciaProcesso));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@ModifyType", System.Data.DbType.String, _TipoModificacao));

            try
            {
                _Result = Convert.ToInt32(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteScalar));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
Exemple #7
0
        public string ActionExecuteChangeLog(ChangesHeader _ChangesHeader, List <ChangeItem> _ChangeItemCollection)
        {
            string             _Result           = string.Empty;
            MappingChanges     _MappingChanges   = null;
            string             _XML              = string.Empty;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04_HistoricoModificacoes"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04_HistoricoModificacoes"].ProviderName;
            string             _TSQL             = "[dbo].[Log_ModificaLogModificacoes]";

            _MappingChanges = ServiceHelper.CreateInstance.GetMappingChanges(_ChangesHeader, _ChangeItemCollection);
            _XML            = SerializationData.CreateInstance.GetSerializableData(_MappingChanges, "MappingExecuteChangeLog");

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@XMLChangeLog", System.Data.DbType.Xml, _XML));

            try
            {
                _Result = Convert.ToString(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteScalar));
            }
            catch (Exception ex)
            {
                ExceptionHandling.CreateInstance.AddExceptionAndSaveTextFile(ex);
            }

            return(_Result);
        }
        public List <GeTipoProcesso> TaskGetCollectionGeTipoProcessoByFilter(string _StrFilter, int _IsFilter)
        {
            List <GeTipoProcesso> _Result        = new List <GeTipoProcesso>();
            List <DbParameter>    _ParameterList = new List <DbParameter>();
            DataTable             _DataTable     = null;
            string _ConnectionString             = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string _ProviderName = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string _TSQL         = "[dbo].[Ge_RetornaTipoProcesso]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@StrFilter", System.Data.DbType.String, _StrFilter));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@IsFilter", System.Data.DbType.Int32, _IsFilter));

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteDataTable);

                foreach (DataRow _Row in _DataTable.Rows)
                {
                    _Result.Add(new GeTipoProcesso(_Row));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
        public int TaskModifyProcessUsuario(string _Usuario, string _Nome, int _CodigoEmpresa, int _CodigoRG, string _StatusDBA, DateTime _DataCadastro, string _Senha, string _Ramal, string _Ativo, string _UsuarioIncl, string _TipoModificacao)
        {
            int _Result = 0;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Ge_ModificaProcessoUsuario]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Usuario", System.Data.DbType.String, _Usuario));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Nome", System.Data.DbType.String, _Nome));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoEmpresa", System.Data.DbType.Int32, _CodigoEmpresa));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoRG", System.Data.DbType.Int32, _CodigoRG));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@StatusDBA", System.Data.DbType.String, _StatusDBA));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@DataCadastro", System.Data.DbType.DateTime, _DataCadastro));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Senha", System.Data.DbType.String, _Senha));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Ramal", System.Data.DbType.String, _Ramal));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Ativo", System.Data.DbType.String, _Ativo));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@ModifyType", System.Data.DbType.String, _TipoModificacao));

            try
            {
                _Result = Convert.ToInt32(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteScalar));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
Exemple #10
0
        public string RetornaCaminhoDiretorioEmpresa(int _CodigoEmpresa)
        {
            string    _Result           = null;
            DataTable _DataTable        = new DataTable();
            string    _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string    _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string    _TSQL             = " SELECT dir_logo_empresa" +
                                          " FROM ge_parametro" +
                                          " WHERE id_tabela = " + _CodigoEmpresa;

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.Text, null, ExecuteType.ExecuteDataTable);

                if (_DataTable.Rows.Count > 0)
                {
                    _Result = _DataTable.Rows[0]["dir_logo_empresa"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _DataTable.Dispose();
            }

            return(_Result);
        }
Exemple #11
0
        public NomeFantasiaLogin GetNomeFantasiaTask(int _CodigoEmpresa)
        {
            NomeFantasiaLogin _Result           = null;
            DataTable         _DataTable        = new DataTable();
            string            _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string            _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string            _TSQL             = "select distinct" +
                                                  " emp.descr_empr_red as NomeFantasia" +
                                                  " from ge_empresa as emp" +
                                                  " where emp.cod_empr = " + _CodigoEmpresa;

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.Text, null, ExecuteType.ExecuteDataTable);

                if (_DataTable.Rows.Count > 0)
                {
                    _Result = new NomeFantasiaLogin(_DataTable.Rows[0]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _DataTable.Dispose();
            }

            return(_Result);
        }
Exemple #12
0
        public DataSet GetLoginTask(string _User, string _Password)
        {
            DataSet _Result           = null;
            string  _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string  _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string  _TSQL             = "declare @UserName char(20) = '" + _User + "'," +
                                        " @Password char(10) = '" + _Password + "'," +
                                        " @Usuario char(20)," +
                                        " @Senha char(10);" +

                                        " set @Usuario = (select usuario from ge_usuario where usuario = @UserName and senha = @Password and ativo = 'S');" +
                                        " set @Senha = (select senha from ge_usuario where usuario = @UserName and senha = @Password and ativo = 'S');" +

                                        " select usuario as Usuario," +
                                        " nome as Nome," +
                                        " cod_empr as CodigoEmpresa," +
                                        " cod_rg as CodigoRegistroGeral," +
                                        " status_dba as StatusDba," +
                                        " ramal as Ramal" +
                                        " from ge_usuario" +
                                        " where usuario = @Usuario" +
                                        " and senha = @Senha;" +

                                        " select distinct" +
                                        " upr.cod_empr as CodigoEmpresa," +
                                        " emp.descr_empr_red as NomeFantasia" +
                                        " from ge_usuario_processo as upr" +
                                        " inner join ge_empresa as emp" +
                                        " on upr.cod_empr = emp.cod_empr" +
                                        " inner join rg_reg_geral as rgl" +
                                        " on emp.cod_rg = rgl.cod_rg" +
                                        " and rgl.cod_status = 1" +
                                        " and upr.usuario = @Usuario" +
                                        " order by upr.cod_empr";

            try
            {
                _Result = (DataSet)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.Text, null, ExecuteType.ExecuteDataSet);
            }
            catch (Exception _Ex)
            {
                throw _Ex;
            }

            return(_Result);
        }
        public DataSet GetCollectionLiberacaoUsuarioTask()
        {
            DataSet _Result           = null;
            string  _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string  _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string  _TSQL             = "[dbo].[Ge_RetornaLiberacaoUsuario]";

            try
            {
                _Result = (DataSet)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.Text, null, ExecuteType.ExecuteDataSet);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
        public DataSet TaskGeCollectionGeTipoProcessoAplicacaoPorVinculo()
        {
            DataSet _Result           = null;
            string  _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string  _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string  _TSQL             = "[dbo].[Ge_RetornaTipoProcessoAplicacaoPorVinculo]";

            try
            {
                _Result = (DataSet)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, null, ExecuteType.ExecuteDataSet);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
Exemple #15
0
        public List <ProcessoLogin> GetProcessoLoginTask(int _CodigoAplicacao, int _CodigoTipoProcesso)
        {
            List <ProcessoLogin> _Result    = new List <ProcessoLogin>();
            DataTable            _DataTable = new DataTable();
            string _ConnectionString        = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string _ProviderName            = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string _TSQL = "select distinct" +
                           " upr.cod_proc as CodigoProcesso," +
                           " pro.descr_proc as DescricaoProcesso" +
                           " from ge_usuario_processo as upr" +
                           " inner join ge_processo as pro" +
                           " on upr.cod_proc = pro.cod_proc" +
                           " inner join ge_tipo_processo as tpr" +
                           " on pro.cod_tipo_proc = tpr.cod_tipo_proc" +
                           " inner join ge_aplicacao as apl" +
                           " on apl.cod_aplic = pro.cod_aplic" +
                           " where pro.cod_aplic = " + _CodigoAplicacao +
                           " and tpr.cod_tipo_proc = " + _CodigoTipoProcesso +
                           " order by upr.cod_proc";

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.Text, null, ExecuteType.ExecuteDataTable);

                foreach (DataRow _Row in _DataTable.Rows)
                {
                    _Result.Add(new ProcessoLogin(_Row));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _DataTable.Dispose();
            }

            return(_Result);
        }
        public DataSet TaskGetCollectionsRegistroGeral(int _IdEmpr, int _IdRg)
        {
            DataSet            _Result           = null;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Rg_RetornaRegistroGeral]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@IdEmpr", System.Data.DbType.Int32, _IdEmpr));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@IdRg", System.Data.DbType.Int32, _IdRg));

            try
            {
                _Result = (DataSet)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteDataSet);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
        public int TaskModifyProcessGegistroGeral(string _XML, string _TipoModificacao)
        {
            int _Result = 0;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Rg_ModificaProcessoRegistroGeral]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@XMLProcessoRegistroGeral", System.Data.DbType.Xml, _XML));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@ModifyType", System.Data.DbType.String, _TipoModificacao));

            try
            {
                _Result = Convert.ToInt32(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteScalar));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
Exemple #18
0
        public DataTable RetornaNoDeTiposDeProcessosNoMenuTask(int _CodigoAplicacao, int _CodigoEmpresa)
        {
            DataTable          _Result           = null;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Ge_RetornaNoDeTiposDeProcessosNoMenu]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoAplicacao", System.Data.DbType.Int32, _CodigoAplicacao));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoEmpresa", System.Data.DbType.Int32, _CodigoEmpresa));

            try
            {
                _Result = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteDataTable);
            }
            catch (Exception _Ex)
            {
                throw _Ex;
            }

            return(_Result);
        }
        public List <GeTipoProcesso> TaskGetCollectionTipoProcesso()
        {
            List <GeTipoProcesso> _Result    = new List <GeTipoProcesso>();
            DataTable             _DataTable = null;
            string _ConnectionString         = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string _ProviderName             = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string _TSQL = "[dbo].[Ge_RetornaTipoProcesso]";

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, null, ExecuteType.ExecuteDataTable);

                foreach (DataRow _Row in _DataTable.Rows)
                {
                    _Result.Add(new GeTipoProcesso(_Row));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
Exemple #20
0
        public GestaoProcessoLogin GetProcessoByIdTask(int _CodigoProcesso)
        {
            GestaoProcessoLogin _Result    = null;
            DataTable           _DataTable = new DataTable();
            string _ConnectionString       = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string _ProviderName           = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string _TSQL = " select cod_proc," +
                           " descr_proc," +
                           " cod_tipo_proc," +
                           " cod_aplic," +
                           " ativo," +
                           " form," +
                           " sequ_proc" +
                           " from ge_processo" +
                           " where cod_proc = " + _CodigoProcesso;

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.Text, null, ExecuteType.ExecuteDataTable);

                if (_DataTable.Rows.Count > 0)
                {
                    _Result = new GestaoProcessoLogin(_DataTable.Rows[0]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _DataTable.Dispose();
            }

            return(_Result);
        }
        public int TaskModifyProcessUsuarioGrupo(int _CodigoEmpresa, int _CodigoGrupo, string _Usuario, string _TipoModificacao)
        {
            int _Result = 0;
            List <DbParameter> _ParameterList    = new List <DbParameter>();
            string             _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string             _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string             _TSQL             = "[dbo].[Ge_ModificaProcessoUsuarioGrupo]";

            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoEmpresa", System.Data.DbType.Int32, _CodigoEmpresa));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@CodigoGrupo", System.Data.DbType.Int32, _CodigoGrupo));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@Usuario", System.Data.DbType.String, _Usuario));
            _ParameterList.Add(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).CreateParameter("@ModifyType", System.Data.DbType.String, _TipoModificacao));

            try
            {
                _Result = Convert.ToInt32(DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, CommandType.StoredProcedure, _ParameterList, ExecuteType.ExecuteScalar));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }
Exemple #22
0
        public List <ParametroGerenciador> TaskGetDataProcessesByFilter(int _CodigoParametroGerenciador, int _CodigoTipoProcessoEspecial, int _CodigoTipoProcessoInternet, string _TipoProcesso)
        {
            List <ParametroGerenciador> _Result = new List <ParametroGerenciador>();
            DataTable _DataTable        = new DataTable();
            string    _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string    _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string    _TSQL             = "DECLARE" +
                                          " @IdCodigoParametroGerenciador int = 0," +
                                          " @IdTipoProcessoEspecial int = 0," +
                                          " @IdTipoProcessoInternet int = 0," +
                                          " @IdTipoConsulta char(1) = '" + _TipoProcesso + "'" +

                                          " SET @IdCodigoParametroGerenciador = " + _CodigoParametroGerenciador +
                                          " SET @IdTipoProcessoEspecial = " + _CodigoTipoProcessoEspecial +
                                          " SET @IdTipoProcessoInternet = " + _CodigoTipoProcessoInternet +

                                          " IF @IdTipoConsulta = 'C'" +
                                          " BEGIN" +
                                          " SELECT" +
                                          " id_tabela," +
                                          " dir_logo_empresa," +
                                          " dir_pgm_relatorio," +
                                          " dir_relatorio," +
                                          " dir_backup," +
                                          " dir_script," +
                                          " dir_importacao," +
                                          " dir_exportacao_excel," +
                                          " cod_tipo_proc_esp," +
                                          " cod_tipo_proc_int," +
                                          " mostra_form_menu," +
                                          " dir_foto," +
                                          " dir_servidor" +
                                          " FROM" +
                                          " ge_parametro" +
                                          " where id_tabela = @IdCodigoParametroGerenciador" +
                                          " order by id_tabela" +
                                          " END" +

                                          " IF @IdTipoConsulta = 'E'" +
                                          " BEGIN" +
                                          " SELECT" +
                                          " id_tabela," +
                                          " dir_logo_empresa," +
                                          " dir_pgm_relatorio," +
                                          " dir_relatorio," +
                                          " dir_backup," +
                                          " dir_script," +
                                          " dir_importacao," +
                                          " dir_exportacao_excel," +
                                          " cod_tipo_proc_esp," +
                                          " cod_tipo_proc_int," +
                                          " mostra_form_menu," +
                                          " dir_foto," +
                                          " dir_servidor" +
                                          " FROM" +
                                          " ge_parametro" +
                                          " where cod_tipo_proc_esp = @IdTipoProcessoEspecial" +
                                          " order by id_tabela" +
                                          " END" +

                                          " IF @IdTipoConsulta = 'I'" +
                                          " BEGIN" +
                                          " SELECT" +
                                          " id_tabela," +
                                          " dir_logo_empresa," +
                                          " dir_pgm_relatorio," +
                                          " dir_relatorio," +
                                          " dir_backup," +
                                          " dir_script," +
                                          " dir_importacao," +
                                          " dir_exportacao_excel," +
                                          " cod_tipo_proc_esp," +
                                          " cod_tipo_proc_int," +
                                          " mostra_form_menu," +
                                          " dir_foto," +
                                          " dir_servidor" +
                                          " FROM" +
                                          " ge_parametro" +
                                          " where cod_tipo_proc_int = @IdTipoProcessoInternet" +
                                          " order by id_tabela" +
                                          " END" +

                                          " IF @IdTipoConsulta = 'N'" +
                                          " BEGIN" +
                                          " SELECT TOP 100" +
                                          " id_tabela," +
                                          " dir_logo_empresa," +
                                          " dir_pgm_relatorio," +
                                          " dir_relatorio," +
                                          " dir_backup," +
                                          " dir_script," +
                                          " dir_importacao," +
                                          " dir_exportacao_excel," +
                                          " cod_tipo_proc_esp," +
                                          " cod_tipo_proc_int," +
                                          " mostra_form_menu," +
                                          " dir_foto," +
                                          " dir_servidor" +
                                          " FROM" +
                                          " ge_parametro" +
                                          " order by id_tabela" +
                                          " END";

            try
            {
                _DataTable = (DataTable)DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.Text, null, ExecuteType.ExecuteDataTable);

                foreach (DataRow _Row in _DataTable.Rows)
                {
                    _Result.Add(new ParametroGerenciador(_Row));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _DataTable.Dispose();
            }

            return(_Result);
        }
Exemple #23
0
        public Object TaskModifyDataProcesses(int _IdTabela, string _DirLogoEmpresa, string _DirPgmRelatorio, string _DirRelatorio, string _DirBackup, string _DirScript, string _DirImportacao, string _DirExportacaoExcel, int _IdTipoProcEsp, int _IdTipoProcInt, string _MostraFormMenu, string _DirFoto, string _DirServidor, string _ModifyType)
        {
            Object _Result           = null;
            string _ConnectionString = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ConnectionString;
            string _ProviderName     = ConfigurationManager.ConnectionStrings["BrErpSindicatoV04"].ProviderName;
            string _TSQL             = "DECLARE" +
                                       " @IdTabela int = 0," +
                                       " @DirLogoEmpresa varchar(100) = ''," +
                                       " @DirPgmRelatorio varchar(100) = ''," +
                                       " @DirRelatorio varchar(100) = ''," +
                                       " @DirBackup varchar(100) = ''," +
                                       " @DirScript varchar(100) = ''," +
                                       " @DirImportacao varchar(100) = ''," +
                                       " @DirExportacaoExcel varchar(100) = ''," +
                                       " @IdTipoProcEsp int = 0," +
                                       " @IdTipoProcInt int = 0," +
                                       " @MostraFormMenu char(1) = ''," +
                                       " @DirFoto varchar(100) = ''," +
                                       " @DirServidor varchar(100) = ''," +
                                       " @ModifyType char(1) = 'N'" +

                                       " SET @IdTabela = " + _IdTabela +
                                       " SET @DirLogoEmpresa = '" + _DirLogoEmpresa + "'" +
                                       " SET @DirPgmRelatorio = '" + _DirPgmRelatorio + "'" +
                                       " SET @DirRelatorio = '" + _DirRelatorio + "'" +
                                       " SET @DirBackup = '" + _DirBackup + "'" +
                                       " SET @DirScript = '" + _DirScript + "'" +
                                       " SET @DirImportacao = '" + _DirImportacao + "'" +
                                       " SET @DirExportacaoExcel = '" + _DirExportacaoExcel + "'" +
                                       " SET @IdTipoProcEsp = " + _IdTipoProcEsp +
                                       " SET @IdTipoProcInt = " + _IdTipoProcInt +
                                       " SET @MostraFormMenu = '" + _MostraFormMenu + "'" +
                                       " SET @DirFoto = '" + _DirFoto + "'" +
                                       " SET @DirServidor = '" + _DirServidor + "'" +
                                       " SET @ModifyType = '" + _ModifyType + "'" +

                                       " IF @ModifyType = 'I'" +
                                       " BEGIN" +
                                       " INSERT INTO ge_parametro(dir_logo_empresa," +
                                       " dir_pgm_relatorio," +
                                       " dir_relatorio," +
                                       " dir_backup," +
                                       " dir_script," +
                                       " dir_importacao," +
                                       " dir_exportacao_excel," +
                                       " cod_tipo_proc_esp," +
                                       " cod_tipo_proc_int," +
                                       " mostra_form_menu," +
                                       " dir_foto," +
                                       " dir_servidor)" +
                                       " VALUES(@DirLogoEmpresa," +
                                       " @DirPgmRelatorio," +
                                       " @DirRelatorio," +
                                       " @DirBackup," +
                                       " @DirScript," +
                                       " @DirImportacao," +
                                       " @DirExportacaoExcel," +
                                       " @IdTipoProcEsp," +
                                       " @IdTipoProcInt," +
                                       " @MostraFormMenu," +
                                       " @DirFoto," +
                                       " @DirServidor)" +
                                       " SELECT SCOPE_IDENTITY()" +
                                       " END" +

                                       " IF @ModifyType = 'U'" +
                                       " BEGIN" +
                                       " UPDATE ge_parametro SET dir_logo_empresa = @DirLogoEmpresa," +
                                       " dir_pgm_relatorio = @DirPgmRelatorio," +
                                       " dir_relatorio = @DirRelatorio," +
                                       " dir_backup = @DirBackup," +
                                       " dir_script = @DirScript," +
                                       " dir_importacao = @DirImportacao," +
                                       " dir_exportacao_excel = @DirExportacaoExcel," +
                                       " cod_tipo_proc_esp = @IdTipoProcEsp," +
                                       " cod_tipo_proc_int = @IdTipoProcInt," +
                                       " mostra_form_menu = @MostraFormMenu," +
                                       " dir_foto = @DirFoto," +
                                       " dir_servidor = @DirServidor" +
                                       " WHERE id_tabela = @IdTabela" +
                                       " END" +

                                       " IF @ModifyType = 'D'" +
                                       " BEGIN" +
                                       " DELETE FROM ge_parametro WHERE id_tabela = @IdTabela" +
                                       " END";

            try
            {
                _Result = DatabasePersistence.CreateInstance(_ConnectionString, _ProviderName).ExecuteCommand(_TSQL, System.Data.CommandType.Text, null, ExecuteType.ExecuteScalar);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_Result);
        }