Changeset 183


Ignore:
Timestamp:
14/08/09 17:41:14 (4 years ago)
Author:
riverplatense
Message:

legajo social ya adosado

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/legajosocial.py

    r181 r183  
    1717        kwds["style"] = wx.DEFAULT_FRAME_STYLE 
    1818        wx.Frame.__init__(self, *args, **kwds) 
     19        f = open('idLegajo', 'r') 
     20        id = f.readline() 
     21        f.close() 
    1922        self.db = MySQLdb.connect('localhost', 'javier', 'javier', 'escuela', charset='UTF8') 
     23        c = self.db.cursor() 
     24        c.execute ('''select apellidos, nombres, fecha_nac, calle_dom, num_dom, localidad_dom, 
     25        tel_dom, estudios, hasta_est, trat_medico, jefe, empleo, observaciones from alumnos where id_alumno = %s''' % id) 
     26        q = c.fetchone() 
     27        c.close() 
     28        print q 
    2029        self.panel = wx.Panel(self, -1) 
    2130        self.lblLegajo = wx.StaticText(self.panel, -1, "Legajo Social") 
  • trunk/sancabase.py

    r174 r183  
    6565        alta_autoridades = submenuAltas.Append(-1, u'Ad&ministrativos', u'Alta de administrativo') 
    6666        alta_auxiliares = submenuAltas.Append(-1, u'Au&xiliares', u'Alta de auxiliar') 
     67        alta_legajoSocial = submenuAltas.Append(-1, u'&Legajo social', u'Alta de alumno en legajo social') 
    6768        menuABM.AppendMenu(-1, u'Altas', submenuAltas) 
    6869        submenuModificaciones = wx.Menu() 
     
    143144        self.Bind(wx.EVT_MENU, self.OnAltaAdministrativos, alta_autoridades) 
    144145        self.Bind(wx.EVT_MENU, self.OnAltaAuxiliares, alta_auxiliares) 
     146        self.Bind(wx.EVT_MENU, self.OnAltaLegajoSocial, alta_legajoSocial) 
    145147        self.Bind(wx.EVT_MENU, self.OnModAlumnos, mod_alumnos) 
    146148        self.Bind(wx.EVT_MENU, self.OnModCursos,mod_cursos) 
     
    10631065        c.close() 
    10641066        self.frame.Close() 
     1067 
     1068 
     1069# Alta de legajo social 
     1070 
     1071    def OnAltaLegajoSocial(self, evt): 
     1072        try: 
     1073            self.frame.Close() 
     1074        finally: 
     1075            # Creo el diálogo para entrar el apellido del alumno a ingresar 
     1076            self.dialog = wx.TextEntryDialog(None, u'Ingrese el Apellido del alumno', u'Legajo social de alumnos', u'', style=wx.OK|wx.CANCEL) 
     1077            if self.dialog.ShowModal() == wx.ID_OK: 
     1078                self.apellido = self.dialog.GetValue() 
     1079            else: 
     1080                self.dialog.Destroy() 
     1081                return 
     1082            self.dialog.Destroy() 
     1083            # Creo el diálogo para seleccionar entre todos los que tienen el mismo apellido 
     1084            c = self.db.cursor() 
     1085            c.execute('''SELECT id_alumno, apellidos, nombres, num_doc FROM alumnos WHERE apellidos = %s''', (self.apellido)) 
     1086            q = c.fetchall() 
     1087            c.close() 
     1088            StrAlum = [("%d %s %s %s" % tuple(a)) for a in q] 
     1089            dlg = wx.SingleChoiceDialog(self, u'Alumnos que cumplen el criterio de búsqueda:', u'Legajo social de alumno', StrAlum) 
     1090            if (dlg.ShowModal() == wx.ID_OK): 
     1091                selections = dlg.GetSelection() 
     1092                self.alumnoAingresar = q[selections][0] 
     1093                f = open('idLegajo', 'w') 
     1094                f.write('%s\n' % self.alumnoAingresar) 
     1095                f.close() 
     1096                from legajosocial import LegajoSocial 
     1097                ventana = LegajoSocial(self, -1, u'Legajo Social', style = wx.DEFAULT_FRAME_STYLE) 
     1098                ventana.CenterOnScreen() 
     1099                ventana.Show(True) 
     1100                 
     1101             
    10651102 
    10661103 
Note: See TracChangeset for help on using the changeset viewer.