コード例 #1
0
        public List<Entidades.StreamComunicados> SP_CONSULTAR_COMUNICADOS(string sessionid, DateTime timerequest)
        {
            Database db = null;
            List<Entidades.StreamComunicados> retorno = new List<Entidades.StreamComunicados>();
            Queue<SqlParameter> qParameters = null;
            try
            {
                db = new Database();

                CreateParameters(ref qParameters,
                                    new Property() { NomeCampo = "sessionid", Value = sessionid },
                                    new Property() { NomeCampo = "timerequest", Value = timerequest }
                                    );
                retorno =
                    DAL.Mapping.Mapping<Entidades.StreamComunicados>.ConvertReaderToIEnumerable(
                        db.ExecuteDataReader("SP_CONSULTAR_COMUNICADOS", ref qParameters)).ToList();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (db != null)
                    db.Dispose();
            }
            return retorno;
        }
コード例 #2
0
ファイル: ClientePL.cs プロジェクト: gustt/BananasBroadCast
        public List<DAL.Entidades.Cliente> SP_CONSULTAR_CLIENTE(string NomeFantasia, string RazaoSocial)
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            List<DAL.Entidades.Cliente> retorno = new List<Entidades.Cliente>();
            try
            {
                db = new Database();

                CreateParameters(ref qParameters,
                            new Property() { NomeCampo = "NomeFantasia", Value = NomeFantasia },
                            new Property() { NomeCampo = "RazaoSocial", Value = RazaoSocial });

                retorno = Mapping.Mapping<DAL.Entidades.Cliente>.ConvertReaderToIEnumerable(
                                                        db.ExecuteDataReader("SP_CONSULTAR_CLIENTE", ref qParameters)).ToList();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (db != null)
                    db.Dispose();

                if (qParameters != null)
                {
                    GC.SuppressFinalize(qParameters);
                    qParameters = null;
                }
            }
            return retorno;
        }
コード例 #3
0
ファイル: ProgramaPL.cs プロジェクト: gustt/BananasBroadCast
        public DAL.Entidades.Programa SP_ABRIR_PROGRAMA_ENGATADO()
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            Entidades.Programa retorno = new Entidades.Programa();
            try
            {
                db = new Database();

                List<Entidades.Programa> rProcedure =
                    Mapping.Mapping<Entidades.Programa>.ConvertReaderToIEnumerable(
                        db.ExecuteDataReader("SP_ABRIR_PROGRAMA_ENGATADO")).ToList();

                if (rProcedure != null && rProcedure.Count > 0)
                    retorno = rProcedure.ElementAt(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (db != null)
                    db.Dispose();

                if (qParameters != null)
                {
                    GC.SuppressFinalize(qParameters);
                    qParameters = null;
                }
            }
            return retorno;
        }
コード例 #4
0
ファイル: ProgramaPL.cs プロジェクト: gustt/BananasBroadCast
        public List<Entidades.Programa> SP_CONSULTAR_PROGRAMA(string NomePrograma)
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            List<Entidades.Programa> retorno = new List<Entidades.Programa>();
            try
            {
                db = new Database();

                CreateParameters(ref qParameters,
                            new Property() { NomeCampo = "NomePrograma", Value = NomePrograma });

                retorno =
                    Mapping.Mapping<Entidades.Programa>.ConvertReaderToIEnumerable(
                        db.ExecuteDataReader("SP_CONSULTAR_PROGRAMA", ref qParameters)).ToList();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (db != null)
                    db.Dispose();

                if (qParameters != null)
                {
                    GC.SuppressFinalize(qParameters);
                    qParameters = null;
                }
            }

            return retorno;
        }
コード例 #5
0
ファイル: EventosPL.cs プロジェクト: gustt/JeitoCaipira
        public List<DAL.Entidades.Eventos> SP_CONSULTAR_EVENTOS()
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            List<DAL.Entidades.Eventos> retorno = new List<Entidades.Eventos>();
            try
            {
                db = new Database();

                retorno = Mapping.Mapping<DAL.Entidades.Eventos>.ConvertReaderToIEnumerable(
                                                        db.ExecuteDataReader("SP_CONSULTAR_EVENTOS", ref qParameters)).ToList();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (db != null)
                    db.Dispose();

                if (qParameters != null)
                {
                    GC.SuppressFinalize(qParameters);
                    qParameters = null;
                }
            }
            return retorno;
        }
コード例 #6
0
        public Entidades.ProgramaEngate SP_CONSULTAR_ULTIMO_PROGRAMAENGATE()
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            Entidades.ProgramaEngate retorno = new Entidades.ProgramaEngate();
            try
            {
                db = new Database();

                qParameters = new Queue<SqlParameter>();

                List<Entidades.ProgramaEngate> retornoproceudre = Mapping.Mapping<DAL.Entidades.ProgramaEngate>.ConvertReaderToIEnumerable(
                                    db.ExecuteDataReader("SP_CONSULTAR_ULTIMO_PROGRAMAENGATE", ref qParameters)).ToList();

                if (retornoproceudre != null && retornoproceudre.Count > 0)
                    retorno = retornoproceudre.ElementAt(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (db != null)
                    db.Dispose();

                if (qParameters != null)
                {
                    GC.SuppressFinalize(qParameters);
                    qParameters = null;
                }
            }

            return retorno;
        }
コード例 #7
0
ファイル: ClientePL.cs プロジェクト: gustt/BananasBroadCast
        public DAL.Entidades.Cliente SP_SELECIONAR_CLIENTE(int Codigo)
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            DAL.Entidades.Cliente retorno = new Entidades.Cliente();
            try
            {
                db = new Database();

                CreateParameters(ref qParameters,
                    new Property() { NomeCampo = "Codigo", Value = Codigo });

                List<DAL.Entidades.Cliente> rMapping =
                    Mapping.Mapping<DAL.Entidades.Cliente>.ConvertReaderToIEnumerable(
                            db.ExecuteDataReader("SP_SELECIONAR_CLIENTE", ref qParameters)).ToList();

                if (rMapping.Count > 0)
                    retorno = rMapping.ElementAt(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return retorno;
        }
コード例 #8
0
        public Entidades.ProgramaEngate SP_SELECIONAR_PROGRAMAENGATE(int Codigo)
        {
            Queue<SqlParameter> qParameters = null;
            Database db = null;
            Entidades.ProgramaEngate retorno = null;
            try
            {
                db = new Database();

                CreateParameters(ref qParameters,
                    new Property() { NomeCampo = "Codigo", Value = Codigo });

                List<Entidades.ProgramaEngate> retornoprocedure =
                    DAL.Mapping.Mapping<Entidades.ProgramaEngate>.ConvertReaderToIEnumerable(
                        db.ExecuteDataReader("SP_SELECIONAR_PROGRAMAENGATE", ref qParameters)).ToList();

                if (retornoprocedure != null && retornoprocedure.Count > 0)
                    retorno = retornoprocedure.ElementAt(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (qParameters != null)
                    GC.SuppressFinalize(qParameters);
                if (db != null)
                    db.Dispose();
            }
            return retorno;
        }
コード例 #9
0
        public Entidades.Administrador SP_SELECIONAR_ADMINISTRADOR(string UserID)
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            Entidades.Administrador retorno = new Entidades.Administrador();
            try
            {
                db = new Database();

                CreateParameters(ref qParameters,
                    new Property() { NomeCampo = "UserID", Value = UserID });

                List<Entidades.Administrador> rMapping =
                    Mapping.Mapping<Entidades.Administrador>.ConvertReaderToIEnumerable(
                        db.ExecuteDataReader("SP_SELECIONAR_ADMINISTRADOR", ref qParameters)).ToList();

                if (rMapping.Count > 0)
                    retorno = rMapping.ElementAt(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return retorno;
        }
コード例 #10
0
ファイル: UsuarioPL.cs プロジェクト: gustt/JeitoCaipira
        public Entidades.Usuario SP_VALIDA_USUARIO(string UserID, string Password)
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            Entidades.Usuario retorno = null;
            try
            {
                db = new Database();

                //Evita InnerScript
                Password = HttpUtility.HtmlEncode(Password);
                UserID = HttpUtility.HtmlEncode(UserID);

                string SenhaCriptografada = string.Empty;

                //Criptografando senha
                using (References.Security.Crypt cript = new References.Security.Crypt())
                {
                    SenhaCriptografada = cript.Codificar(Password);
                };

                CreateParameters(ref qParameters,
                    new Property() { NomeCampo = "UserID", Value = UserID },
                    new Property() { NomeCampo = "Password", Value = SenhaCriptografada }
                    );

                List<Entidades.Usuario> rMapping =
                    Mapping.Mapping<Entidades.Usuario>.ConvertReaderToIEnumerable(
                        db.ExecuteDataReader("SP_VALIDA_USUARIO", ref qParameters)).ToList();

                if (rMapping.Count > 0)
                    retorno = rMapping.ElementAt(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return retorno;
        }
コード例 #11
0
ファイル: UsuarioPL.cs プロジェクト: gustt/JeitoCaipira
        public Entidades.Usuario SP_SELECIONAR_USUARIO(string UserID, int CodigoCliente)
        {
            Database db = null;
            Queue<SqlParameter> qParameters = null;
            Entidades.Usuario retorno = null;
            try
            {
                db = new Database();

                CreateParameters(ref qParameters,
                    new Property() { NomeCampo = "UserID", Value = UserID },
                    new Property() { NomeCampo = "CodigoCliente", Value = CodigoCliente }
                    );

                List<Entidades.Usuario> rMapping =
                    Mapping.Mapping<Entidades.Usuario>.ConvertReaderToIEnumerable(
                        db.ExecuteDataReader("SP_SELECIONAR_USUARIO", ref qParameters)).ToList();

                if (rMapping.Count > 0)
                    retorno = rMapping.ElementAt(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return retorno;
        }