Example #1
0
        public bool getValidarUsuario(UsuarioBE usuarioBE)
        {
            DataSet dsConsulta = new DataSet();

            try
            {
                using (SqlConnection cnx = new SqlConnection(ConexionDL.Conexion(ConexionDL.EConexion.north)))
                {
                    using (SqlCommand cmd = new SqlCommand("uspConsultarUsuario", cnx)
                    {
                        CommandType = CommandType.StoredProcedure
                    })
                    {
                        cmd.Parameters.Add(new SqlParameter("@pLogin", SqlDbType.NVarChar, 15)).Value    = usuarioBE.login;
                        cmd.Parameters.Add(new SqlParameter("@pPassword", SqlDbType.NVarChar, 15)).Value = usuarioBE.password;

                        cnx.Open();
                        cmd.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(true);
        }
Example #2
0
        public DataTable ConsultarProductos()
        {
            DataTable wConsulta = new DataTable();

            try
            {
                using (SqlConnection cnx = new SqlConnection(ConexionDL.Conexion(ConexionDL.EConexion.north)))
                {
                    using (SqlCommand cmd = new SqlCommand("uspProductListar", cnx)
                    {
                        CommandType = CommandType.StoredProcedure
                    })
                    {
                        cnx.Open();
                        wConsulta.Load(cmd.ExecuteReader());
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(wConsulta);
        }