Exemplo n.º 1
0
        public DataTable Buscar_cantidad_secciones(string u)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            DataTable         x   = con.Execute_Query("call Pr_cargar_cantidad_secciones (" + u + ")");

            return(x);
        }
Exemplo n.º 2
0
        public DataTable Selecccionar(List <Filtro> pFiltros)
        {
            DataTable dtResultado = new DataTable("Datos");
            string    vSQL        = string.Empty;
            Filtro    vFiltros    = new Filtro();

            Conexion.Conexion vConnexion = new Conexion.Conexion();
            try
            {
                vSQL += "SELECT ";
                vSQL += "Nombre ";
                vSQL += ",PrimerApellido ";
                vSQL += ",SegundoApellido ";
                vSQL += ",FechaNacimiento ";
                vSQL += ",IdPersona ";
                vSQL += ",IdTipoPersona ";
                vSQL += "FROM dbo.PERSONA_EXTRANJERA";
                if (pFiltros != null && pFiltros.Count != 0)
                {
                    vSQL += vFiltros.CrearWhere(pFiltros);
                }
                dtResultado = vConnexion.Seleccionar(vSQL, "BASEDATOS");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(dtResultado);
        }
Exemplo n.º 3
0
        public bool Registrar_examen_automatico(Contenido_practico obj, string uni)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            int x = con.Execute_Operation("call Pr_registrar_examen_automatico ('" + obj.nombre_contenido + "', '" + uni + "')");

            return(x > 0 ? true : false);
        }
Exemplo n.º 4
0
        public bool Actualizar_saludo(string curso, string usuario)
        {
            conexion = new Conexion.Conexion();
            int x = conexion.Execute_Operation("call Pr_actualizar_saludo ('" + curso + "','" + usuario + "')");

            return(x > 0 ? true : false);
        }
Exemplo n.º 5
0
        public bool subir_archivo(string url_archivo, string codigo_curso_usuario_unidad, string id_x)
        {
            conexion = new Conexion.Conexion();
            int x = conexion.Execute_Operation("call Pr_ingresar_subir_archivo ('" + url_archivo + "','" + codigo_curso_usuario_unidad + "','" + id_x + "')");

            return(x > 0 ? true : false);
        }
 public static List <Proveedor> GetProveedores()
 {
     using (var db = new  Conexion.Conexion())
     {
         return(db.Proveedores.ToList());
     }
 }
 public int DeleteProveedor(int proveedor)
 {
     using (var db = new Conexion.Conexion())
     {
         return(db.Proveedores.Where(p => p.id_proveedor.Equals(proveedor)).Delete());
     }
 }
Exemplo n.º 8
0
        public Actividades[] Consultar_contenido_actividad(string cn)
        {
            Conexion.Conexion con       = new Conexion.Conexion();
            DataTable         actividad = con.Execute_Query("call Pr_cargar_contenido(" + cn + ")");

            Actividades[] arreglo = new Actividades[actividad.Rows.Count];
            Actividades   inicio  = new Actividades();
            int           j       = 0;

            foreach (DataRow i in actividad.Rows)
            {
                arreglo[j] = new Actividades();
                arreglo[j].id_actividad       = i["id_actividad"].ToString();
                arreglo[j].Nombre_actividad   = i["Nombre_actividad"].ToString();
                arreglo[j].descripcion        = i["descripcion"].ToString();
                arreglo[j].edicion_estado     = i["estado_edicion_actividad"].ToString();
                arreglo[j].titulo_seccion     = i["titulo_seccion"].ToString();
                arreglo[j].contenido_seccion  = i["contenido_seccion"].ToString();
                arreglo[j].id_multimedia      = i["id_multimedia"].ToString();
                arreglo[j].url_multimedia     = i["url_multimedia"].ToString();
                arreglo[j].id_tipo_multimedia = i["tipo multimedia"].ToString();
                arreglo[j].tipo_seccion       = i["Tipo_seccion"].ToString();
                arreglo[j].arch            = i["Archivo"].ToString();
                arreglo[j].link_referencia = i["Link_apa"].ToString();
                j++;
            }
            return(arreglo);
        }
 public async Task <List <Producto> > GetProductosAsync(int saltar, int tomar)
 {
     using (var db = new Conexion.Conexion())
     {
         return(await db.Productos.OrderBy(p => p.id_producto).Skip(saltar).Take(tomar).ToListAsync());
     }
 }
Exemplo n.º 10
0
        public DataTable Buscar_porcentaje_seccion(string u, string usuario)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            DataTable         x   = con.Execute_Query("call Pr_cargar_porcentaje (" + u + "," + usuario + ")");

            return(x);
        }
Exemplo n.º 11
0
        public DataTable Buscar_seccion_actual(string u, string id_usuario)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            DataTable         x   = con.Execute_Query("call Pr_cargar_seccion_actual (" + u + ", " + id_usuario + ")");

            return(x);
        }
Exemplo n.º 12
0
        public bool Actualizar_porcentaje_estado(int codigo_actividad, int id_curso_actividd)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            int x = con.Execute_Operation("call Pr_actualizar_esatado_eactividad ('" + codigo_actividad + "', '" + id_curso_actividd + "')");

            return(x > 0 ? true : false);
        }
Exemplo n.º 13
0
        public bool Actualizar_porcentaje(double porcentaje, int codigo_actividad, int seccion, int id_curso_actividd)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            int x = con.Execute_Operation("call Pr_actualizar_porcentaje_actividad ('" + porcentaje + "', '" + codigo_actividad + "', '" + seccion + "', '" + id_curso_actividd + "')");

            return(x > 0 ? true : false);
        }
Exemplo n.º 14
0
        public bool Actualizar_estado(string codigo_actividad, string edicion)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            int x = con.Execute_Operation("call Pr_actualizar_act ('" + codigo_actividad + "','" + edicion + "')");

            return(x > 0 ? true : false);
        }
Exemplo n.º 15
0
        public DataTable Selecccionar(List <Filtro> pFiltros)
        {
            DataTable dtResultado = new DataTable("Datos");
            string    vSQL        = string.Empty;
            Filtro    vFiltros    = new Filtro();

            Conexion.Conexion vConnexion = new Conexion.Conexion();
            try
            {
                vSQL += "SELECT ";
                vSQL += "IdSala ";
                vSQL += ",CantidadAsientos ";
                vSQL += ",IdEstadoSala ";
                vSQL += ",IdTipoSala ";
                vSQL += ",IdTipoProyeccion ";
                vSQL += ",PrecioEntrada ";
                vSQL += "FROM dbo.SALA_CINE";
                if (pFiltros != null && pFiltros.Count != 0)
                {
                    vSQL += vFiltros.CrearWhere(pFiltros);
                }
                dtResultado = vConnexion.Seleccionar(vSQL, "BASEDATOS");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(dtResultado);
        }
 public async Task <int> DeleteProducto(int id)
 {
     using (var db = new Conexion.Conexion())
     {
         return(await db.Productos.Where(p => p.id_producto.Equals(id)).DeleteAsync());
     }
 }
Exemplo n.º 17
0
        public int SelecccionarId()
        {
            DataTable dtResultado = new DataTable("Datos");
            string    vSQL        = string.Empty;
            int       vResultado  = 0;

            Conexion.Conexion vConnexion = new Conexion.Conexion();
            try
            {
                vSQL += "SELECT ";
                vSQL += "MAX(IdSala) ";
                vSQL += "FROM dbo.SALA_CINE";

                dtResultado = vConnexion.Seleccionar(vSQL, "BASEDATOS");
                if (dtResultado.Rows.Count != 0)
                {
                    vResultado = Convert.ToInt32(dtResultado.Rows[0][0].ToString());
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(vResultado);
        }
Exemplo n.º 18
0
        public bool Registrar_seccion(contenido obj, int id_act, string archivo, string o, string archivo1)
        {
            conexion = new Conexion.Conexion();

            if (Convert.ToInt32(obj.tipo_multimedia) == 1)
            {
                if (Convert.ToInt32(obj.tipo_soporte) == 3)
                {
                    int x = conexion.Execute_Operation("call Pr_ingresar_seccion ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "', '" + id_act + "','" + o + "','" + obj.url_video + "', '" + 3 + "', '" + obj.tipo_multimedia + "','" + obj.tipo_soporte + "','" + obj.url_apoyo + "','" + obj.link_referencia + "')");
                    return(x == 0 ? true : false);
                }
                else
                {
                    int x = conexion.Execute_Operation("call Pr_ingresar_seccion ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "', '" + id_act + "','" + o + "','" + obj.url_video + "', '" + 3 + "', '" + obj.tipo_multimedia + "','" + obj.tipo_soporte + "','" + archivo1 + "','" + obj.link_referencia + "')");
                    return(x == 0 ? true : false);
                }
            }
            else
            {
                if (Convert.ToInt32(obj.tipo_soporte) == 3)
                {
                    int x = conexion.Execute_Operation("call Pr_ingresar_seccion ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "', '" + id_act + "','" + o + "','" + archivo + "', '" + 3 + "', '" + obj.tipo_multimedia + "','" + obj.tipo_soporte + "','" + obj.url_apoyo + "','" + obj.link_referencia + "')");
                    return(x == 0 ? true : false);
                }
                else
                {
                    int x = conexion.Execute_Operation("call Pr_ingresar_seccion ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "', '" + id_act + "','" + o + "','" + archivo + "', '" + 3 + "', '" + obj.tipo_multimedia + "','" + obj.tipo_soporte + "','" + archivo1 + "','" + obj.link_referencia + "')");
                    return(x == 0 ? true : false);
                }
            }
        }
Exemplo n.º 19
0
        public DataTable Selecccionar(List <Filtro> pFiltros)
        {
            DataTable dtResultado = new DataTable("Datos");
            string    vSQL        = string.Empty;
            Filtro    vFiltros    = new Filtro();

            Conexion.Conexion vConnexion = new Conexion.Conexion();
            try
            {
                vSQL += "SELECT ";
                vSQL += "IdCartelera ";
                vSQL += ",IdPelicula ";
                vSQL += ",IdDetallle ";
                vSQL += ",FechaPelicula ";
                vSQL += ",HoraPelicula ";
                vSQL += ",FechaEstreno ";
                vSQL += ",FechaFinalizacion ";
                vSQL += "FROM dbo.CARTELERA_DETALLE";
                if (pFiltros != null && pFiltros.Count != 0)
                {
                    vSQL += vFiltros.CrearWhere(pFiltros);
                }
                dtResultado = dtResultado = vConnexion.Seleccionar(vSQL, "BASEDATOS");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(dtResultado);
        }
Exemplo n.º 20
0
 public DataTable Registrar_Contenido(contenido obj, string unidad, string archivo, string o, string archivo1)
 {
     conexion = new Conexion.Conexion();
     if (Convert.ToInt32(obj.tipo_multimedia) == 1)
     {
         if (Convert.ToInt32(obj.tipo_soporte) == 3)
         {
             DataTable x = conexion.Execute_Query("call Pr_ingresar_titulo_actividad_inicial ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "','" + unidad + "','" + o + "','" + obj.url_video + "', '" + 3 + "', '" + obj.tipo_multimedia + "','" + obj.url_apoyo + "','" + obj.tipo_soporte + "','" + obj.link_referencia + "','" + obj.tipo_acti + "')");
             return(x);
         }
         else
         {
             DataTable x = conexion.Execute_Query("call Pr_ingresar_titulo_actividad_inicial ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "','" + unidad + "','" + o + "','" + obj.url_video + "', '" + 3 + "', '" + obj.tipo_multimedia + "','" + archivo1 + "','" + obj.tipo_soporte + "','" + obj.link_referencia + "','" + obj.tipo_acti + "')");
             return(x);
         }
     }
     else
     {
         if (Convert.ToInt32(obj.tipo_soporte) == 3)
         {
             DataTable x = conexion.Execute_Query("call Pr_ingresar_titulo_actividad_inicial ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "','" + unidad + "','" + o + "','" + archivo + "', '" + 3 + "', '" + obj.tipo_multimedia + "','" + obj.url_apoyo + "','" + obj.tipo_soporte + "','" + obj.link_referencia + "','" + obj.tipo_acti + "')");
             return(x);
         }
         else
         {
             DataTable x = conexion.Execute_Query("call Pr_ingresar_titulo_actividad_inicial ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "','" + unidad + "','" + o + "','" + archivo + "', '" + 3 + "', '" + obj.tipo_multimedia + "','" + archivo1 + "','" + obj.tipo_soporte + "','" + obj.link_referencia + "','" + obj.tipo_acti + "')");
             return(x);
         }
     }
 }
Exemplo n.º 21
0
        public principalP[] Buscar_Cursos_Diplomados_Estudiante(string cc)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            DataTable         diplomado_modulo = con.Execute_Query("call Pr_cargar_diplomados_modulos_estudiante(" + cc + ")");

            principalP[] arreglo = new principalP[diplomado_modulo.Rows.Count];
            int          j       = 0;

            foreach (DataRow i in diplomado_modulo.Rows)
            {
                arreglo[j] = new principalP();
                arreglo[j].nombre_curso         = i["curso"].ToString();
                arreglo[j].codigo_curso         = i["codigo curso"].ToString();
                arreglo[j].porcentaje_diplomado = i["porcentaje"].ToString();
                arreglo[j].url                    = i["Url_imagen_curso"].ToString();
                arreglo[j].fecha_cierre           = Convert.ToDateTime(i["fecha_cierre"].ToString());
                arreglo[j].codigo_curso_usaurio   = i["Id_curso_usuario"].ToString();
                arreglo[j].nombre_unidad          = i["Nombre Unidad"].ToString();
                arreglo[j].codigo_unidad          = i["Codigo unidad"].ToString();
                arreglo[j].codigo_curso_nivel     = i["Codigo Curso nivel"].ToString();
                arreglo[j].porcentaje_modulo      = i["porcentaje unidad"].ToString();
                arreglo[j].presentacion           = i["presentacion"].ToString();
                arreglo[j].imagen                 = i["url imagen"].ToString();
                arreglo[j].Url_video_presentacion = i["Url_video"].ToString();

                j++;
            }
            return(arreglo);
        }
Exemplo n.º 22
0
        public bool Registrar_actividad_automatico(string obj, string uni)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            int x = con.Execute_Operation("call Pr_registrar_actividad_automatico ('" + obj + "', '" + uni + "')");

            return(x > 0 ? true : false);
        }
Exemplo n.º 23
0
        public bool Actualizar_curso_usaurio(string curso_usuario)
        {
            conexion = new Conexion.Conexion();
            int x = conexion.Execute_Operation("call Pr_actualizar_estado_curso_usuario ('" + curso_usuario + "')");

            return(x > 0 ? true : false);
        }
Exemplo n.º 24
0
        public DataTable Selecccionar(List <Filtro> pFiltros)
        {
            DataTable dtResultado = new DataTable("Datos");
            string    vSQL        = string.Empty;
            Filtro    vFiltros    = new Filtro();

            Conexion.Conexion vConnexion = new Conexion.Conexion();
            try
            {
                vSQL += "SELECT ";
                vSQL += "IdReservacion ";
                vSQL += ",IdPersona ";
                vSQL += ",IdTipoPersona ";
                vSQL += ",Saldo ";
                vSQL += ",IdTipoPago ";
                vSQL += ",IdEstadoReservacion ";
                vSQL += ",FechaReservacion ";
                vSQL += ",Total ";
                vSQL += "FROM dbo.RESERVACION";
                if (pFiltros != null && pFiltros.Count != 0)
                {
                    vSQL += vFiltros.CrearWhere(pFiltros);
                }
                dtResultado = vConnexion.Seleccionar(vSQL, "BASEDATOS");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(dtResultado);
        }
Exemplo n.º 25
0
        public DataTable Selecccionar(List <Filtro> pFiltros)
        {
            DataTable dtResultado = new DataTable("Datos");
            string    vSQL        = string.Empty;
            Filtro    vFiltros    = new Filtro();

            Conexion.Conexion vConnexion = new Conexion.Conexion();
            try
            {
                vSQL += "SELECT ";
                vSQL += "IdPelicula ";
                vSQL += ",NombrePelicula ";
                vSQL += ",TituloPelicula ";
                vSQL += ",IdSubtitulo ";
                vSQL += ",IdIdioma ";
                vSQL += "FROM dbo.PELICULAS";
                if (pFiltros != null && pFiltros.Count != 0)
                {
                    vSQL += vFiltros.CrearWhere(pFiltros);
                }
                dtResultado = vConnexion.Seleccionar(vSQL, "BASEDATOS");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(dtResultado);
        }
Exemplo n.º 26
0
        public DataTable Selecccionar(List <Filtro> pFiltros)
        {
            DataTable dtResultado = new DataTable("Datos");
            string    vSQL        = string.Empty;
            Filtro    vFiltros    = new Filtro();

            Conexion.Conexion vConnexion = new Conexion.Conexion();
            try
            {
                vSQL += "SELECT ";
                vSQL += "IdPersona ";
                vSQL += ",IdTipoPersona ";
                vSQL += ",IdArea ";
                vSQL += "FROM dbo.PERSONAL_ADMINISTRATIVO";
                if (pFiltros != null && pFiltros.Count != 0)
                {
                    vSQL += vFiltros.CrearWhere(pFiltros);
                }
                dtResultado = vConnexion.Seleccionar(vSQL, "BASEDATOS");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(dtResultado);
        }
Exemplo n.º 27
0
        public DataTable Registrar_Titulo_practica(Contenido_practico obj, string unidad)
        {
            conexion = new Conexion.Conexion();
            DataTable x = conexion.Execute_Query("call Pr_ingresar_examen ('" + obj.nombre_contenido + "', '" + obj.descripcion_contenido + "','" + obj.tipo_e + "','" + unidad + "')");

            return(x);
        }
Exemplo n.º 28
0
        public DataTable Selecccionar(List <Filtro> pFiltros)
        {
            DataTable dtResultado = new DataTable("Datos");
            string    vSQL        = string.Empty;
            Filtro    vFiltros    = new Filtro();

            Conexion.Conexion vConnexion = new Conexion.Conexion();
            try
            {
                vSQL += "SELECT ";
                vSQL += "IdTipoCliente ";
                vSQL += ",DescripcionTipoCliente ";
                vSQL += "FROM dbo.TIPO_CLIENTE";
                if (pFiltros != null && pFiltros.Count != 0)
                {
                    vSQL += vFiltros.CrearWhere(pFiltros);
                }
                dtResultado = vConnexion.Seleccionar(vSQL, "BASEDATOS");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(dtResultado);
        }
Exemplo n.º 29
0
        public DataTable Registrar_pregunta(Contenido_practico obj, int fk_examen, string url, string nombre, string url2, string nombre2)
        {
            conexion = new Conexion.Conexion();
            DataTable x = conexion.Execute_Query("call Pr_ingresar_pregunta ('" + obj.nombre_pregunta + "', '" + obj.descripcion_pregunta + "','" + fk_examen + "','" + obj.tipo_pregunta + "','" + nombre + "','" + url + "','" + obj.tipo_clasificacion + "','" + obj.tipo_multimedia + "', '" + obj.link_apa + "', '" + obj.url_multimedia + "','" + nombre2 + "','" + url2 + "', '" + obj.link_apoyo + "')");

            return(x);
        }
Exemplo n.º 30
0
        public DataTable i_actividad(string u)
        {
            Conexion.Conexion con = new Conexion.Conexion();
            DataTable         x   = con.Execute_Query("call Pr_id_actividad (" + u + ")");

            return(x);
        }