Example #1
0
        public static List <Notas> TodasLasNotasExmenEscrM(Int32 pMatricula, string fechaExamen)
        {
            List <Notas> Lista = new List <Notas>();

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand    comando = new SqlCommand(string.Format("Select * from NotasExamenEscrito where Matricula like '{0}%'", pMatricula), conexion);
                SqlDataReader reader  = comando.ExecuteReader();
                while (reader.Read())
                {
                    Notas pNotas = new Notas();
                    pNotas.ID           = reader.GetInt32(0);
                    pNotas.Matricula    = reader.GetInt32(1);
                    pNotas.Nombre       = reader.GetString(2);
                    pNotas.N1           = reader.GetInt32(3);
                    pNotas.N2           = reader.GetInt32(4);
                    pNotas.N3           = reader.GetInt32(5);
                    pNotas.NF           = reader.GetInt32(6);
                    pNotas.Fecha_Examen = reader.GetDateTime(7).ToString();
                    Lista.Add(pNotas);
                }
                conexion.Close();
            }
            return(Lista);
        }
Example #2
0
        public static List <Grupos> TodosLosGrupos()
        {
            List <Grupos> List = new List <Grupos>();

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand    comando = new SqlCommand("Select Grupos.ID as CodigoGrupo, Nivel, Profesor, Aula, Fecha_Inicio, Total_Inscritos, Horarios.Dias + ' ' + Horarios.Hora as Horario from Grupos inner join Horarios on Horarios.ID = Grupos.Codigo_Horario", conexion);
                SqlDataReader reader  = comando.ExecuteReader();

                while (reader.Read())
                {
                    Grupos pG = new Grupos();

                    pG.ID              = int.Parse(reader["CodigoGrupo"].ToString());
                    pG.Nivel           = reader["Nivel"].ToString();
                    pG.Profesor        = reader["Profesor"].ToString();
                    pG.Aula            = reader["Aula"].ToString();
                    pG.Horario         = reader["Horario"].ToString();
                    pG.Fecha_Inicio    = Convert.ToDateTime(reader["Fecha_Inicio"]).ToString("dd-MM-yyyy");
                    pG.Total_Inscritos = int.Parse(reader["Total_Inscritos"].ToString());

                    List.Add(pG);
                }
                conexion.Close();
            }
            return(List);
        }
Example #3
0
        public static List <Facturacion> BuscarFacturas1(string Matricula, string NombreApellido, string Precio, string FechaFa, string CodigoFa, string notas)
        {
            List <Facturacion> Factura = new List <Facturacion>();

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("select * from Facturacion where IDCLiente like '{0}%' and NombreCLiente like '{1}%' and Precio like '{2}%' and FechaFactura like '{3}%' and Notas like '{4}%' and CodigoFacturacion like '{5}%'",
                                                                  Matricula, NombreApellido, Precio, FechaFa, notas, CodigoFa), conexion);
                SqlDataReader reader = comando.ExecuteReader();

                while (reader.Read())
                {
                    Facturacion pFactura = new Facturacion();
                    pFactura.Matricula_Estudiante = reader.GetInt32(0);
                    pFactura.Nombre_Estudiante    = reader.GetString(1);
                    pFactura.Precio           = Convert.ToDouble(reader.GetValue(2));
                    pFactura.Fecha_Factura    = reader.GetDateTime(3).ToString();
                    pFactura.Razon_Pago       = reader.GetString(4);
                    pFactura.Cancelacion_Pago = reader.GetString(5);
                    pFactura.Codigo_Factura   = reader.GetInt32(6);

                    Factura.Add(pFactura);
                }
                conexion.Close();
            }
            return(Factura);
        }
Example #4
0
        public static Calificaciones ObtenerCalificaciones(Int32 ID)
        {
            Calificaciones pC = new Calificaciones();

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Select * from calificacones where ID = {0}", ID), conexion);

                SqlDataReader reader = comando.ExecuteReader();


                while (reader.Read())
                {
                    pC.ID = reader.GetInt32(0);
                    pC.Codigo_Estudiante = reader.GetInt32(1);
                    pC.Nombre_Estudiante = reader.GetString(2);
                    pC.Primer_Parcial    = reader.GetInt32(3);
                    pC.Sengundo_Parcial  = reader.GetInt32(4);
                    pC.Tercer_Parcial    = reader.GetInt32(5);
                    pC.Asistencia        = reader.GetInt32(6);
                    pC.Fecha_Parcial     = reader.GetDateTime(7).ToString();
                    pC.Codigo_Grupo      = reader.GetInt32(8);
                }
                conexion.Close();
            }
            return(pC);
        }
Example #5
0
        public static List <Facturacion> TodasLasFacturasND()
        {
            List <Facturacion> Factura = new List <Facturacion>();

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Select * from Facturacion"), conexion);

                SqlDataReader reader = comando.ExecuteReader();

                while (reader.Read())
                {
                    Facturacion pFactura = new Facturacion();

                    pFactura.Matricula_Estudiante = reader.GetInt32(0);
                    pFactura.Nombre_Estudiante    = reader.GetString(1);
                    pFactura.Precio           = Convert.ToDouble(reader.GetValue(2));
                    pFactura.Fecha_Factura    = reader.GetDateTime(3).ToString();
                    pFactura.Razon_Pago       = reader.GetString(4);
                    pFactura.Cancelacion_Pago = reader.GetString(5);
                    pFactura.Codigo_Factura   = reader.GetInt32(6);

                    Factura.Add(pFactura);
                }
                conexion.Close();
            }
            return(Factura);
        }
Example #6
0
        public static List <Estudiante> BuscarEstudiantePorMatrc(int Matricula)
        {
            List <Estudiante> list = new List <Estudiante>();

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                conexion.Open();
                SqlCommand    comando = new SqlCommand(string.Format("select * from Estudiantes where ID={0}", Matricula), conexion);
                SqlDataReader reader  = comando.ExecuteReader();
                while (reader.Read())
                {
                    Estudiante E = new Estudiante();
                    E.ID           = reader.GetInt32(0);
                    E.Nombre       = reader.GetString(1);
                    E.Apellido     = reader.GetString(2);
                    E.Fecha_N      = reader.GetDateTime(3).ToString();
                    E.Edad         = reader.GetString(4);
                    E.Telefono     = reader.GetString(5);
                    E.Fecha_Ins    = reader.GetDateTime(6).ToString();
                    E.E_Mail       = reader.GetString(7);
                    E.Direccion    = reader.GetString(8);
                    E.Sector       = reader.GetString(9);
                    E.Ocupacion    = reader.GetString(10);
                    E.N_Academico  = reader.GetString(11);
                    E.D_Idioma     = reader.GetString(12);
                    E.NivelA       = reader.GetString(13);
                    E.Codigo_Grupo = reader.GetInt32(15);
                    E.Modo_Pago    = reader.GetString(16);
                    E.VIP          = reader["VIP"].ToString();
                    list.Add(E);
                }
                conexion.Close();
            }
            return(list);
        }
Example #7
0
        public static Estudiante SeleccionarEstudiante(Int64 pID)
        {
            Estudiante pEstudiante = new Estudiante();

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("select * from Estudiantes where ID = {0}", pID), conexion);

                SqlDataReader reader = comando.ExecuteReader();

                while (reader.Read())
                {
                    pEstudiante.ID           = reader.GetInt32(0);
                    pEstudiante.Nombre       = reader.GetString(1);
                    pEstudiante.Apellido     = reader.GetString(2);
                    pEstudiante.Fecha_N      = reader.GetDateTime(3).ToString();
                    pEstudiante.Edad         = reader.GetString(4);
                    pEstudiante.Telefono     = reader.GetString(5);
                    pEstudiante.Fecha_Ins    = reader.GetDateTime(6).ToString();
                    pEstudiante.E_Mail       = reader.GetString(7);
                    pEstudiante.Direccion    = reader.GetString(8);
                    pEstudiante.Sector       = reader.GetString(9);
                    pEstudiante.Ocupacion    = reader.GetString(10);
                    pEstudiante.N_Academico  = reader.GetString(11);
                    pEstudiante.D_Idioma     = reader.GetString(12);
                    pEstudiante.NivelA       = reader.GetString(13);
                    pEstudiante.Codigo_Grupo = reader.GetInt32(15);
                    pEstudiante.Modo_Pago    = reader.GetString(16);
                    pEstudiante.VIP          = reader["VIP"].ToString();
                }
                conexion.Close();
                return(pEstudiante);
            }
        }
Example #8
0
        public static int ModificarCalificacionesExposicion(Notas pNotas)
        {
            int retorno;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(String.Format("update NotasExposicion set N1 = {0}, N2 = {1}, N3 = {2}, NF = {3}, Fecha_Examen = '{4}' where ID = {5}", pNotas.N1, pNotas.N2, pNotas.N3, pNotas.NF, pNotas.Fecha_Examen, pNotas.ID), conexion);
                retorno = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(retorno);
        }
Example #9
0
        public static int Registrar(Mora pMora)
        {
            int R = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("insert into Mora (Mora_Mensual, Mora_Semanal) values ({0}, {1})", pMora.Mora_Mensual, pMora.Mora_Semanal), conexion);
                R = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(R);
        }
Example #10
0
        public static string ObtenerMoraSemanal()
        {
            string R = null;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Select Mora_Semanal from Mora where ID = 1"), conexion);
                R = comando.ExecuteScalar().ToString();
                conexion.Close();
            }
            return(R);
        }
Example #11
0
        public static int Modificar(Mora pMora)
        {
            int R = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Update Mora set Mora_Mensual = {0}, Mora_Semanal = {1} where ID = 1 update CantidadPago set Pago_Mensual = {2}, Pago_Semanal = {3} where CantidadPago.ID = 1", pMora.Mora_Mensual, pMora.Mora_Semanal, pMora.Pago_Mensual, pMora.Pago_Semanal), conexion);
                R = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(R);
        }
Example #12
0
        public static string ONivel(string NombreUsuario)
        {
            string Nivel = null;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Select Nivel from Usuarios where Nombre = '{0}'", NombreUsuario), conexion);
                Nivel = comando.ExecuteScalar().ToString();
                conexion.Close();
            }
            return(Nivel);
        }
Example #13
0
        public static string ObtenerTotalAsistencia(Int32 pMatricula)
        {
            string retorno = null;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Select Asistencia from Asistencia where MAtricula = {0}", pMatricula), conexion);
                retorno = comando.ExecuteScalar().ToString();
                conexion.Close();
            }
            return(retorno);
        }
Example #14
0
        public static string ObtenerFechaPagoAnterior(int pID)
        {
            string FPA = null;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Select Fecha_Pago_Anterior from Facturacion where CodigoFacturacion = {0}", pID), conexion);
                FPA = comando.ExecuteScalar().ToString();
                conexion.Close();
            }
            return(FPA);
        }
Example #15
0
        public static int CancelarPago(int pID, string pCP)
        {
            int R = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("update Facturacion set CancelacionPago = '{0}' where CodigoFacturacion = {1}", pCP, pID), conexion);
                R = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(R);
        }
Example #16
0
        public static int UpdateVIPstatus(string vipS, string ID)
        {
            int r = -1;

            using (SqlConnection con = DBcomun.ObetenerConexion())
            {
                SqlCommand comand = new SqlCommand(string.Format("update Estudiantes set VIP= '{0}' where ID = {1}", vipS, ID), con);
                r = comand.ExecuteNonQuery();
                con.Close();
            }
            return(r);
        }
Example #17
0
        public static string ObtenerCodigoNivel(Int64 pMatricula)
        {
            string R = null;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Select Codigo_Grupo from Estudiantes where ID = {0}", pMatricula), conexion);
                R = comando.ExecuteScalar().ToString();
                conexion.Close();
            }
            return(R);
        }
Example #18
0
        public static int ActualizarProximoPago(Int32 pID, string pFecha)
        {
            int R;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("update Estudiantes set FechaProximoPago = '{0}' where ID = {1}", pFecha, pID), conexion);
                R = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(R);
        }
Example #19
0
        public static string ObtenerModoPago(Int32 pID)
        {
            string MP = null;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Select Modo_Pago from Estudiantes where ID = {0}", pID), conexion);
                MP = comando.ExecuteScalar().ToString();
                conexion.Close();
            }
            return(MP);
        }
Example #20
0
        public static DateTime ObtenerFechaProximoPago(Int32 pID)
        {
            DateTime fecha = DateTime.Today;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("select FechaProximoPago from Estudiantes where ID = {0}", pID), conexion);
                fecha = Convert.ToDateTime(comando.ExecuteScalar());
                conexion.Close();
            }
            return(fecha);
        }
Example #21
0
        public static int ActualizarFechaPAgoAnterior(int pID, string pFecha)
        {
            int R = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Update Facturacion set Fecha_Pago_Anterior = '{0}' where CodigoFacturacion = {1}", pFecha, pID), conexion);
                R = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(R);
        }
Example #22
0
        public static int EliminarNotaExposicion(int pID)
        {
            int R = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Delete NotasExposicion where ID = {0}", pID), conexion);
                R = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(R);
        }
Example #23
0
        public static string ObtenerCancelacionPago(int pID)
        {
            string r = null;

            using (SqlConnection con = DBcomun.ObetenerConexion())
            {
                SqlCommand comand = new SqlCommand(string.Format("select CancelacionPago from Facturacion where CodigoFacturacion = {0}", pID), con);
                r = comand.ExecuteScalar().ToString();
                con.Close();
            }
            return(r);
        }
Example #24
0
        public static int RegistrarNotaExposicion(Notas pNotas, string nivelID)
        {
            int retorno = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Insert into NotasExposicion (Matricula, Nombre, N1, N2, N3, NF, Fecha_Examen, NivelID) values ({0}, '{1}', {2}, {3}, {4}, {5}, '{6}', '{7}')", pNotas.Matricula, pNotas.Nombre, pNotas.N1, pNotas.N2, pNotas.N3, pNotas.NF, pNotas.Fecha_Examen, nivelID), conexion);
                retorno = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(retorno);
        }
Example #25
0
        public static int RegistrarAsistencia(Asistencia pA)
        {
            int retorno = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Insert into Asistencia (Matricula, Nombre, Asistencia, Mes_Inicio, Ultima_Asistencia) values ('{0}', '{1}', {2}, '{3}', '{4}')", pA.Matricula, pA.Nombre, pA.CAsistencia, pA.Fecha_Inicio, pA.Ultima_Asistencia), conexion);
                retorno = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(retorno);
        }
Example #26
0
        public static int ModificarAsistencia(Asistencia pA)
        {
            int retorno = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("Update Asistencia set Nombre = '{0}', Asistencia = {1}, Mes_Inicio = '{2}', Ultima_Asistencia = '{3}' where Matricula = {4}", pA.Nombre, pA.CAsistencia, pA.Fecha_Inicio, pA.Ultima_Asistencia, pA.Matricula), conexion);
                retorno = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(retorno);
        }
Example #27
0
        public static int ActualizarUltimaAsistencia(int pMatricula, string pFechaUA)
        {
            int retorno = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("update Asistencia set Ultima_Asistencia = '{0}' where Matricula = {1}", pFechaUA, pMatricula), conexion);
                retorno = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(retorno);
        }
Example #28
0
        public static int Eliminar(int Codigo)
        {
            int R = -1;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand(string.Format("delete usuarios where ID = {0}", Codigo), conexion);
                R = comando.ExecuteNonQuery();
                conexion.Close();
            }
            return(R);
        }
Example #29
0
        public static double ObtenerPagoSemanal()
        {
            double P = 0;

            using (SqlConnection conexion = DBcomun.ObetenerConexion())
            {
                SqlCommand comando = new SqlCommand("Select Pago_Semanal from CantidadPago where ID = 1", conexion);
                P = Convert.ToDouble(comando.ExecuteScalar());
                conexion.Close();
            }
            return(P);
        }
Example #30
0
        public static int ModificarVIP(Mora pM)
        {
            int r = -1;

            using (SqlConnection con = DBcomun.ObetenerConexion())
            {
                SqlCommand comand = new SqlCommand(string.Format("update CantidadPagoVIP set Pago_VIP = {0}, Pago_Semanal = {1}, Mora_Semanal = {2}, Mora_Mensual = {3} where ID = 1", pM.Pago_Mensual, pM.Pago_Semanal, pM.Mora_Semanal, pM.Mora_Mensual), con);
                r = comand.ExecuteNonQuery();
                con.Close();
            }
            return(r);
        }