def SelectConsultasPorID(idd):
     cursorxd = DB().run("select * from Consulta where id_consulta =" +
                         str(idd) + ";")
     d = cursorxd.fetchall()
     consulta = Consulta()
     consulta.DeserializarConsultas(d[0])
     return consulta
Example #2
0
 def SeleccionarDuenosPorID(id):
     select_cursor = DB().run("Select * from Duenos where id_dueno = " +
                              str(id) + ";")
     d = select_cursor.fetchall()
     unDueno = Dueno()
     unDueno.DeserializarDueno(d[0])
     return unDueno
 def SeleccionarVeterinariosPorID(id):
     select_cursor = DB().run(
         "Select * from Veterinarios where id_veterinario = " + str(id) +
         ";")
     d = select_cursor.fetchall()
     veterinario = Veterinario()
     veterinario.DeserializarVeterinario(d[0])
     return veterinario
 def UpdateConsulta(self, idd):
     DB().run("Update Consulta set id_consulta = " + str(self.id) +
              ", precio = " + str(self.precio) + ", diagnostico = '" +
              self.diagnostico + "', Veterinarios_id_veterinario = " +
              str(self.veterinario.id) + ", Mascotas_id_mascota = " +
              str(self.mascota.id) + " where id_consulta = " + str(idd) +
              ";")
 def SelectConsultas():
     lista = []
     cursorpiola = DB().run("Select * from Consulta;")
     for itemm in cursorpiola:
         consul = Consulta()
         consul.DeserializarConsultas(itemm)
         lista.append(consul)
     return lista
 def SeleccionarVeterinarios():
     lista = []
     select_cursor = DB().run("Select * from Veterinarios;")
     for item in select_cursor:
         veterinariox = Veterinario()
         veterinariox.DeserializarVeterinario(item)
         lista.append(veterinariox)
     return lista
Example #7
0
 def SeleccionarDuenos():
     lista = []
     select_cursor = DB().run("Select * from Duenos;")
     for item in select_cursor:
         unDueno = Dueno()
         unDueno.DeserializarDueno(item)
         lista.append(unDueno)
     return lista
Example #8
0
 def SelectMascota():
     listam = []
     select_cursor = DB().run("Select * from Mascotas;")
     for item in select_cursor:
         mascota = Mascota()
         mascota.DeserializarMascota(item)
         listam.append(mascota)
     return listam
 def UpdateVeterinario(self, id):
     DB().run("Update Veterinarios set nombre = '" + self.nombre +
              "', apellido = '" + self.apellido + "', DNI = " +
              str(self.DNI) + ", sueldo = " + str(self.sueldo) +
              ", id_veterinario = " + str(self.id) +
              " where id_veterinario = " + str(id) + ";")
Example #10
0
 def InsertarDueno(self, nombre, apellido, Dni, telefono):
     self.SetDueno(nombre, apellido, Dni, telefono)
     DB().run("INSERT INTO Duenos values(null,'" + self.nombre + "','" +
              self.apellido + "'," + str(self.DNI) + ",'" + self.telefono +
              "');")
Example #11
0
 def DeleteMascota(id):
     DB().run("Delete from Mascotas where id_mascota = " + str(id) + ";")
Example #12
0
 def UpdateMascota(self, id):
     DB().run("Update Mascotas set id_mascota = " + str(self.id) + ", nombre = '" + self.nombre + "', tipo = '" + self.tipo + "', Duenos_id_duenos = " + self.dueno + " where id_mascota = " + str(id) + ";")
Example #13
0
 def InsertarMascota(self, nombre, tipo, dueno):
     self.SetMascota(nombre, tipo, dueno)
     DB().run("insert into Mascotas values(NULL,'" + self.nombre + "','" + self.tipo + "'," + self.dueno + ");")
Example #14
0
 def SelectMascotaporID(idd):
     select_cursor = DB().run("Select * from Mascotas where id_mascota = " + str(idd) + ";")
     d = select_cursor.fetchall()
     unamascota = Mascota()
     unamascota.DeserializarMascota(d[0])
     return unamascota
 def InsertarConsulta(self, precio, diagnostico, mascota, vet):
     self.SetConsulta(precio, diagnostico, mascota, vet)
     DB().run("insert into Consulta values(NULL," + str(self.precio) +
              ",'" + self.diagnostico + "'," + str(self.veterinario.id) +
              "," + str(self.mascota.id) + ");")
Example #16
0
 def UpdateDueno(self, id):
     DB().run("Update Duenos set nombre = '" + self.nombre +
              "', apellido = '" + self.apellido + "', DNI = " +
              str(self.DNI) + ", telefono = '" + self.telefono +
              "', id_dueno = " + str(self.id) + " where id_dueno = " +
              str(id) + ";")
 def DeleteConsulta(id):
     DB().run("Delete from Consulta where id_consulta = " + str(id) + ";")
 def InsertarVeterinario(self, nombre, apellido, Dni, sueldo):
     self.SetVeterinario(nombre, apellido, Dni, sueldo)
     DB().run("INSERT INTO Veterinarios values(null,'" + self.nombre +
              "','" + self.apellido + "'," + str(self.DNI) + "," +
              str(self.sueldo) + ");")
Example #19
0
# -*- coding: utf-8 -*-

#CAMBIAR BASE DE DATOS DE DUEÑOS A DUENOS

from Clase_Menu import Menu
from Clase_Dueno import Dueno
from Clase_Veterinario import Veterinario
from Clase_Macota import Mascota
from Clase_DB import DB
from Clase_Consulta import Consulta

DB().SetConection('127.0.0.1', 'root', 'alumno', 'TP2')

# charset = "utf8", autocommit = True)

loop = True
while (loop):
    print("MENU")
    Menu.MenuPrincipal()
    opcion = input("Elija una opcion: ")
    if opcion == "1":
        while (loop):
            print("DUENOS")
            Menu.MenuFunciones()
            opcion_duenos = input("Elija la funcion")

            if opcion_duenos == "1":
                # INSERT DUENOS
                while (1):
                    print("INSERT DUENOS")
                    dueno = Dueno()
Example #20
0
 def DeleteDueno(id):
     DB().run("Delete from Duenos where id_dueno = " + str(id) + ";")
 def DeleteVeterinario(id):
     DB().run("Delete from Veterinarios where id_veterinario = " + str(id) +
              ";")