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); }
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); }
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); }
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); }
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()); } }
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()); } }
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); }
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); }
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); }
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); }
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); }
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()); } }
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); }
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); } } }
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); }
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); } } }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public DataTable i_actividad(string u) { Conexion.Conexion con = new Conexion.Conexion(); DataTable x = con.Execute_Query("call Pr_id_actividad (" + u + ")"); return(x); }