Ejemplo n.º 1
0
        public void Actualizar()
        {
            string SQL = "UPDATE Pacientes SET Nombre = '"
                         + NombrePaciente + "', Apellido = '"
                         + Apellido + "', FechaNacimiento = '"
                         + FechaNacimiento + "', Sexo = '"
                         + Sexo + "', Domicilio = '"
                         + Domicilio + "', Telefono = '"
                         + Telefono
                         + "' WHERE Nombre = '" + NombrePaciente + "' AND Apellido = '" + Apellido + "';";

            AccesoBaseDatos bd = new AccesoBaseDatos();

            try
            {
                if (bd.EjecutaComando(SQL) == 0)
                {
                    throw new Exception("No se afectaron registros de pacientes.");
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 2
0
        public void Consultar(System.Data.DataTable dt)
        {
            string          SQL = "SELECT * FROM Pacientes ORDER BY IdPaciente ASC;";
            AccesoBaseDatos bd  = new AccesoBaseDatos();

            try
            {
                bd.EjecutaConsulta(SQL, dt);
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 3
0
        //metodos
        public void Consultar(System.Data.DataTable dt)
        {
            string          SQL = "SELECT * FROM Cobros, Pacientes WHERE Cobros.NombrePaciente = concat(Pacientes.Nombre , ' ' , Pacientes.Apellido);";
            AccesoBaseDatos bd  = new AccesoBaseDatos();

            try
            {
                bd.EjecutaConsulta(SQL, dt);
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 4
0
        public void Eliminar()
        {
            string SQL = "DELETE FROM Pacientes WHERE Nombre = '" + NombrePaciente + "' AND Apellido = '" + Apellido + "';";

            AccesoBaseDatos bd = new AccesoBaseDatos();

            try
            {
                if (bd.EjecutaComando(SQL) == 0)
                {
                    throw new Exception("No se afectaron registros de pacientes.");
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 5
0
        public void Eliminar()
        {
            string SQL = "DELETE FROM Servicios WHERE NombreServicio = '" + NombreServicio + "';";

            AccesoBaseDatos bd = new AccesoBaseDatos();

            try
            {
                if (bd.EjecutaComando(SQL) == 0)
                {
                    throw new Exception("No se afectaron registros.");
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 6
0
        //metodos
        public void Guardar()
        {
            string SQL = "insert into Citas (NombrePaciente, Fecha) VALUES ('"
                         + NombrePaciente + "', '"
                         + Fecha + "');";
            AccesoBaseDatos bd = new AccesoBaseDatos();

            try
            {
                if (bd.EjecutaComando(SQL) == 0)
                {
                    throw new Exception("No se afectaron registros de citas.");
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 7
0
        public void Actualizar()
        {
            string SQL = "UPDATE Citas SET NombrePaciente = '"
                         + NombrePaciente + "', Fecha = '"
                         + Fecha + "' WHERE NombrePaciente = '" + NombrePaciente + "';";

            AccesoBaseDatos bd = new AccesoBaseDatos();

            try
            {
                if (bd.EjecutaComando(SQL) == 0)
                {
                    throw new Exception("No se afectaron registros de citas.");
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 8
0
        public void Actualizar()
        {
            string SQL = "UPDATE Servicios SET NombreServicio = '"
                         + NombreServicio + "', Descripcion = '"
                         + Descripcion + "', Precio = '"
                         + Precio + "' WHERE NombreServicio = '" + NombreServicio + "';";

            AccesoBaseDatos bd = new AccesoBaseDatos();

            try
            {
                if (bd.EjecutaComando(SQL) == 0)
                {
                    throw new Exception("No se afectaron registros.");
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 9
0
        //metodos
        public void Guardar()
        {
            string SQL = "insert into Servicios (NombreServicio, Descripcion, Precio) VALUES ('"
                         + NombreServicio + "','"
                         + Descripcion + "','"
                         + Precio + "');";

            AccesoBaseDatos bd = new AccesoBaseDatos();

            try
            {
                if (bd.EjecutaComando(SQL) == 0)
                {
                    throw new Exception("No se afectaron registros");
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Ejemplo n.º 10
0
        //metodos
        public void Guardar()
        {
            string SQL = "insert into Pacientes (Nombre, Apellido, FechaNacimiento, Sexo, Domicilio, Telefono) VALUES ('"
                         + NombrePaciente + "', '"
                         + Apellido + "', '"
                         + FechaNacimiento + "', '"
                         + Sexo + "', '"
                         + Domicilio + "', '"
                         + Telefono + "');";

            AccesoBaseDatos bd = new AccesoBaseDatos();

            try
            {
                if (bd.EjecutaComando(SQL) == 0)
                {
                    throw new Exception("No se afectaron registros de pacientes.");
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }