示例#1
0
        public override bool Buscar(int IdBuscado)
        {
            DataTable dt          = new DataTable();
            DataTable dtTelefonos = new DataTable();

            dt = conexion.ObtenerDatos(String.Format("select  PersonaId,Nombres,Apellidos,EstadoCivil, from Personas where PersonaId='{0}'", IdBuscado));
            if (dt.Rows.Count > 0)
            {
                this.PersonaId   = (int)dt.Rows[0]["PersonaId"];
                this.Nombres     = dt.Rows[0]["Nombres"].ToString();
                this.Apellidos   = dt.Rows[0]["Apellidos"].ToString();
                this.EstadoCivil = (int)dt.Rows[0]["EstadoCivil"];


                dtTelefonos = conexion.ObtenerDatos("Select p.TelefonoId,a.Numero " +
                                                    "From PersonasTelefonos p " +
                                                    "Inner Join Actores a On p.TelefonoId=a.TelefonoId" +
                                                    "Where p.PersonaId=" + this.PersonaId);

                foreach (DataRow row in dtTelefonos.Rows)
                {
                    this.AgregarTelefono((int)row["TelefonoId"], row["Numero"].ToString());
                }
            }

            return(dt.Rows.Count > 0);
        }
示例#2
0
        public override bool Buscar(int idBuscado)
        {
            Conexion  conexion  = new Conexion();
            DataTable dt        = new DataTable();
            DataTable dtActores = new DataTable();
            DataTable dtGeneros = new DataTable();


            dt = conexion.ObtenerDatos(String.Format("Select PeliculaId,Titulo,Descripcion,Ano,Calificacion,Imagen,Video,Estudio from Peliculas where PeliculaId = '{0}'", idBuscado));
            if (dt.Rows.Count > 0)
            {
                this.PeliculaId   = (int)dt.Rows[0]["PeliculaId"];
                this.Titulo       = dt.Rows[0]["Titulo"].ToString();
                this.Descripcion  = dt.Rows[0]["Descripcion"].ToString();
                this.Ano          = (int)dt.Rows[0]["Ano"];
                this.Calificacion = (int)dt.Rows[0]["Calificacion"];
                this.Imagen       = dt.Rows[0]["Imagen"].ToString();
                this.Video        = dt.Rows[0]["Video"].ToString();
                this.Estudio      = dt.Rows[0]["Estudio"].ToString();



                dtActores = conexion.ObtenerDatos("Select p.ActorId,a.Nombre from PeliculasActores p Inner join Actores a on p.ActorId = a.ActorId where p.PeliculaId= " + this.PeliculaId);

                dtGeneros = conexion.ObtenerDatos("Select pg.GeneroId,g.Descripcion from PeliculasGeneros pg Inner join Generos g on pg.GeneroId = g.GeneroId Where pg.PeliculaId= " + this.PeliculaId);
                this.Actor.Clear();
                foreach (DataRow row in dtActores.Rows)
                {
                    this.AgregarActores((int)row["ActorId"], row["Nombre"].ToString());
                }
                this.Genero.Clear();
                foreach (DataRow row in dtGeneros.Rows)
                {
                    this.AgregarGeneros((int)row["GeneroId"], row["Descripcion"].ToString());
                }
            }



            return(dt.Rows.Count > 0);
        }
        public override bool Buscar(int idBuscado)
        {
            DataTable dataTable = new DataTable();
            Conexion  conexion  = new Conexion();

            dataTable = conexion.ObtenerDatos(string.Format("Select *from Generos where GeneroId = '{0}'", this.GeneroId));
            if (dataTable.Rows.Count > 0)
            {
                this.GeneroId    = (int)dataTable.Rows[0]["GeneroId"];
                this.Descripcion = dataTable.Rows[0]["Descripcion"].ToString();
            }


            return(dataTable.Rows.Count > 0);
        }
        public DataTable GetIdGenero(string cadena)
        {
            Conexion conexion = new Conexion();

            return(conexion.ObtenerDatos(string.Format("select GeneroId from Generos where Descripcion = '{0}'", cadena)));
        }
        public override DataTable Listado(string campos, string condicion)
        {
            Conexion conexion = new Conexion();

            return(conexion.ObtenerDatos("Select " + campos + " from Generos where " + condicion));
        }
示例#6
0
        public DataTable GetId(string cadena)
        {
            Conexion conexion = new Conexion();

            return(conexion.ObtenerDatos(string.Format("select ActorId from Actores where Nombre = '{0}'", cadena)));
        }
示例#7
0
 public int GetGeneroId()
 {
     return(generoVar.GeneroId = (int)conexion.ObtenerDatos("Select GeneroId from Generos").Rows[0]["GeneroId"]);
 }
示例#8
0
        public DataTable Consultar(int id)
        {
            Conexion conexion = new Conexion();

            return(conexion.ObtenerDatos("Select PeliculaId,Titulo,p.Descripcion,Ano,Calificacion,IMDB,c.Descripcion as Categoria,Imagen,Video from Peliculas as p join Categorias as c on p.CategoriaId = c.CategoriaId where PeliculaId= " + id));
        }