Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/01/2016, 07:45
Avatar de BlueSkull
BlueSkull
 
Fecha de Ingreso: noviembre-2008
Ubicación: Chile
Mensajes: 504
Antigüedad: 15 años, 5 meses
Puntos: 4
Respuesta: Necesito saber el por que sale este error

Estimado la clase PacienteDAL si esta, dejo codigo:

Capa diseño:
Código Python:
Ver original
  1. def Btn_guardarClick(self, sender, e):
  2.     r = str(self._txt_rut.Text)
  3.     n = str(self._txt_nombre.Text)
  4.     ap = str(self._txt_paterno.Text)
  5.     am = str(self._txt_materno.Text)       
  6.     dia = str(self._numericUpDown1.Value)
  7.     mes = str(self._comboBox1.Text)
  8.     year = str(self._txt_year.Text)
  9.  
  10.     from PacienteBLL import PacienteBLL
  11.     paciente1 = PacienteBLL(r, n, ap, am, dia, mes, year)
  12.     self._lbl_mensaje.Text = str(paciente1.IngresarPacienteBLL())

Capa negocio:
Código Python:
Ver original
  1. class PacienteBLL(object):
  2.     """"""
  3.     def __init__(self, rut, nombres, paterno, materno, dia, mes, year):
  4.         self.rut = rut
  5.         self.nombres = nombres
  6.         self.paterno = paterno
  7.         self.materno = materno
  8.         self.dia = dia
  9.         self.mes = mes
  10.         self.year = year
  11.        
  12.     def rut(self):
  13.         return self.rut
  14.    
  15.     def nombres(self):
  16.         return self.nombres
  17.    
  18.     def paterno(self):
  19.         return self.paterno
  20.    
  21.     def materno(self):
  22.         return self.materno
  23.    
  24.     def dia(self):
  25.         return self.dia
  26.    
  27.     def mes(self):
  28.         return self.mes
  29.    
  30.     def year(self):
  31.         return self.year
  32.    
  33.     def IngresarPacienteBLL(self):
  34.         r = str(self.rut)
  35.         n = str(self.nombres)
  36.         a = str(self.paterno+" "+self.materno)
  37.         f = str(self.dia+"-"+self.mes+"-"+self.year)
  38.        
  39.         from PacienteDAL import PacienteDAL
  40.         paciente2 = PacienteDAL(r, n, a, f)
  41.         msg = srt(paciente2.IngresarPacienteDAL())
  42.         return msg

Capa datos:
Código Python:
Ver original
  1. class PacienteDAL(object):
  2.     """"""
  3.     def __init__(self, rut, nombre, apellido, fecha):
  4.         self.rut = rut
  5.         self.nombre = nombre
  6.         self.apellido = apellido
  7.         self.fecha = fecha
  8.        
  9.     def rut(self):
  10.         return self.rut
  11.    
  12.     def nombre(self):
  13.         return self.nombre
  14.    
  15.     def apellido(self):
  16.         return self.apellido
  17.    
  18.     def fecha(self):
  19.         return self.fecha
  20.    
  21.     def IngresarPacienteDAL(self):
  22.         fecha = str(self.fecha)
  23.         info = str("Rut: "+ self.rut +"- Nombres: "+ self.nombre +" -Apellidos"+ self.apellido)
  24.         msg = "Fecha: "+self.fecha+" - Paciente: "+info
  25.        
  26.         # query = "INSERT INTO paciente (rut, nombres, apellidos, fnacimiento) VALUES ('%s','%s','%s','%s')" % self.rut, self.nombre, self.apellido, self.fecha
  27.         # from Conexion import *
  28.         # conn = Conexion()
  29.         # conn.run_query(query)
  30.         # msg = "Ingresado"
  31.         return msg
__________________
"Incluso las torres más altas empiezan en el suelo."
"Sé Ágil..."
StreamWriter