-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathingresoMedico.py
72 lines (58 loc) · 3.07 KB
/
ingresoMedico.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from tkinter import *
from errorMessage import ErrorMessage
from asignarMedico import AsignarMedico
import connection as con
import customtkinter as ct
class IngresoMedico:
def __init__(self, parent):
self.parent = parent
self.win = Toplevel(parent)
self.win.title("Ingreso Medico")
etiTitle = ct.CTkLabel(self.win, text="Ingreso medico", font=("Arial", 20, "bold"))
etiNum_col = ct.CTkLabel(self.win, text="Numero colegiado")
inputNum_col = ct.CTkEntry(self.win, width=200)
etiNombre = ct.CTkLabel(self.win, text="Nombre")
inputNombre = ct.CTkEntry(self.win, width=200)
etiApellido = ct.CTkLabel(self.win, text="Apellido")
inputApellido = ct.CTkEntry(self.win, width=200)
etiEspecialidad = ct.CTkLabel(self.win, text="Especialidad")
inputEspecialidad = ct.CTkEntry(self.win, width=200)
etiTelefono = ct.CTkLabel(self.win, text="Telefono")
inputTelefono = ct.CTkEntry(self.win, width=200)
etiDireccion = ct.CTkLabel(self.win, text="Direccion")
inputDireccion = ct.CTkEntry(self.win, width=200)
etiEmail = ct.CTkLabel(self.win, text="Email")
inputEmail = ct.CTkEntry(self.win, width=200)
buttonSignup = ct.CTkButton(self.win, text="Registrar", command= lambda: self.inputMedico(inputNum_col, inputNombre, inputApellido, inputEspecialidad, inputTelefono, inputDireccion, inputEmail), width=100)
buttonAsignar = ct.CTkButton(self.win, text="Asignar", command= lambda: AsignarMedico(self.win), width=100)
buttonClose = ct.CTkButton(self.win, text="Close", command= lambda: self.close(), width=100)
etiTitle.pack(pady=5)
etiNum_col.pack()
inputNum_col.pack(pady=5)
etiNombre.pack()
inputNombre.pack(pady=5)
etiApellido.pack()
inputApellido.pack(pady=5)
etiEspecialidad.pack()
inputEspecialidad.pack(pady=5)
etiTelefono.pack()
inputTelefono.pack(pady=5)
etiDireccion.pack()
inputDireccion.pack(pady=5)
etiEmail.pack()
inputEmail.pack(pady=5)
buttonSignup.pack(pady=5)
buttonAsignar.pack(pady=5)
buttonClose.pack(pady=5)
self.win.geometry("600x1000")
def inputMedico(self,inputNum_col, inputNombre, inputApellido, inputEspecialidad, inputTelefono, inputDireccion, inputEmail):
query = r"""insert into medico values('""" + inputNum_col.get() + r"""', '""" + inputNombre.get() + r"""', '""" + inputApellido.get() + r"""', '""" + inputEspecialidad.get() + r"""', '""" + inputTelefono.get() + r"""', '""" + inputDireccion.get() + r"""', '""" + inputEmail.get() + r"""');"""
results = con.connect(query)
if (results == ""):
mensaje = "Se ha registrado correctamente"
ErrorMessage(self.win, mensaje=mensaje)
else:
mensaje = "Ha ocurrido un error al registrar"
ErrorMessage(self.win, mensaje=mensaje)
def close(self):
self.win.destroy()