Changeset 181


Ignore:
Timestamp:
14/08/09 14:39:49 (4 years ago)
Author:
riverplatense
Message:

legajo social

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/legajosocial.py

    r180 r181  
    55import wx 
    66import wx.grid 
     7import MySQLdb 
    78 
    89# begin wxGlade: extracode 
     
    1617        kwds["style"] = wx.DEFAULT_FRAME_STYLE 
    1718        wx.Frame.__init__(self, *args, **kwds) 
     19        self.db = MySQLdb.connect('localhost', 'javier', 'javier', 'escuela', charset='UTF8') 
    1820        self.panel = wx.Panel(self, -1) 
    1921        self.lblLegajo = wx.StaticText(self.panel, -1, "Legajo Social") 
     
    2224        self.nombres = wx.TextCtrl(self.panel, -1, "") 
    2325        self.labelApellidos = wx.StaticText(self.panel, -1, "Fecha nac.:") 
    24         self.datepickerFechaNac = wx.DatePickerCtrl(self.panel, -1) 
     26        self.fechaNac = wx.DatePickerCtrl(self.panel, -1) 
    2527        self.labelLugarNac = wx.StaticText(self.panel, -1, "Lugar Nac. :") 
    2628        self.lugarNac = wx.TextCtrl(self.panel, -1, "") 
    2729        self.labelEstadoCivil = wx.StaticText(self.panel, -1, "Estado Civil:") 
    28         self.comboEstadoCivil = wx.ComboBox(self.panel, -1, choices=["Soltero/a", "Casado/a", "En pareja (conviviendo)", "En pareja (sin convivir)", "Separado/a", "Divorciado/a", "Viudo/a"], style=wx.CB_DROPDOWN|wx.CB_READONLY) 
     30        self.estadoCivil = wx.ComboBox(self.panel, -1, choices=["Soltero/a", "Casado/a", "En pareja (conviviendo)", "En pareja (sin convivir)", "Separado/a", "Divorciado/a", "Viudo/a"], style=wx.CB_DROPDOWN|wx.CB_READONLY) 
    2931        self.labelDomicilio = wx.StaticText(self.panel, -1, "Domicilio:") 
    3032        self.domicilio = wx.TextCtrl(self.panel, -1, "") 
     
    3234        self.telefono = wx.TextCtrl(self.panel, -1, "") 
    3335        self.checkPlan = wx.CheckBox(self.panel, -1, "Plan Social") 
    34         self.comboPlanSocial = wx.ComboBox(self.panel, -1, choices=["Plan Trabajar", "Plan Jefas y jefes", "Fines"], style=wx.CB_DROPDOWN) 
     36        self.planSocial = wx.ComboBox(self.panel, -1, choices=["Plan Trabajar", "Plan Jefas y jefes", "Fines"], style=wx.CB_DROPDOWN) 
    3537        self.checkPlanFamiliar = wx.CheckBox(self.panel, -1, "Familiar") 
    36         self.comboPlanFamiliar = wx.ComboBox(self.panel, -1, choices=["Plan Trabajar", "Plan Jefas y jefes", "Fines"], style=wx.CB_DROPDOWN) 
     38        self.planFamiliar = wx.ComboBox(self.panel, -1, choices=["Plan Trabajar", "Plan Jefas y jefes", "Fines"], style=wx.CB_DROPDOWN) 
    3739        self.labelEmpleo = wx.StaticText(self.panel, -1, "Empleo:") 
    38         self.combo_box_1 = wx.ComboBox(self.panel, -1, choices=["Empleado/a  (Rel. dependencia)", u"Empleado/a (Contrato a término)", "Empleado/a  (Informal)", u"Changarín", "Cuentapropista/a", "Empresario/a", "Comerciante", "Empleado/a casa de familia", "Desocupado/a"], style=wx.CB_DROPDOWN) 
     40        self.empleo = wx.ComboBox(self.panel, -1, choices=["Empleado/a  (Rel. dependencia)", u"Empleado/a (Contrato a término)", "Empleado/a  (Informal)", u"Changarín", "Cuentapropista/a", "Empresario/a", "Comerciante", "Empleado/a casa de familia", "Desocupado/a"], style=wx.CB_DROPDOWN) 
    3941        self.labelEmpresa = wx.StaticText(self.panel, -1, u"Ubicación:") 
    4042        self.empresa = wx.TextCtrl(self.panel, -1, "") 
     
    5052        self.labelFamilia = wx.StaticText(self.panel, -1, "Grupo Familiar -->") 
    5153        self.checkDeporte = wx.CheckBox(self.panel, -1, "Deportes") 
    52         self.deportes = wx.TextCtrl(self.panel, -1, u"Qué deporte y en qué lugar...") 
     54        self.deportesdonde = wx.TextCtrl(self.panel, -1, u"Qué deporte y en qué lugar...") 
    5355        self.labelTiempoLibre = wx.StaticText(self.panel, -1, "Tiempo libre:") 
    5456        self.hobbyes = wx.TextCtrl(self.panel, -1, "") 
     
    8385        self.SetTitle("Sancabase - Legajo Social") 
    8486        self.SetSize((800, 600)) 
     87        self.CenterOnScreen() 
    8588        self.lblLegajo.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD, 0, "")) 
    8689        self.nombres.SetFocus() 
    87         self.comboEstadoCivil.SetSelection(-1) 
    88         self.comboPlanSocial.Enable(False) 
    89         self.comboPlanSocial.SetSelection(0) 
    90         self.comboPlanFamiliar.Enable(False) 
    91         self.comboPlanFamiliar.SetSelection(0) 
    92         self.combo_box_1.SetSelection(0) 
     90        self.estadoCivil.SetSelection(-1) 
     91        self.planSocial.Enable(False) 
     92        self.planSocial.SetSelection(0) 
     93        self.planFamiliar.Enable(False) 
     94        self.planFamiliar.SetSelection(0) 
     95        self.empleo.SetSelection(0) 
    9396        self.motivoAbandono.Enable(False) 
    9497        self.escuelaActual.Enable(False) 
    9598        self.cursosFP.Enable(False) 
    96         self.deportes.Enable(False) 
     99        self.deportesdonde.Enable(False) 
    97100        self.judiciales.Enable(False) 
    98101        self.gridFamilia.CreateGrid(10, 5) 
     
    127130        gridDatosPersonales.Add(self.nombres, 0, wx.EXPAND, 0) 
    128131        gridDatosPersonales.Add(self.labelApellidos, 0, wx.ALL, 1) 
    129         gridDatosPersonales.Add(self.datepickerFechaNac, 0, wx.ALL|wx.EXPAND, 1) 
     132        gridDatosPersonales.Add(self.fechaNac, 0, wx.ALL|wx.EXPAND, 1) 
    130133        gridDatosPersonales.Add(self.labelLugarNac, 0, wx.ALL, 1) 
    131134        gridDatosPersonales.Add(self.lugarNac, 0, wx.ALL|wx.EXPAND, 1) 
    132135        gridDatosPersonales.Add(self.labelEstadoCivil, 0, wx.ALL, 1) 
    133         gridDatosPersonales.Add(self.comboEstadoCivil, 0, wx.ALL|wx.EXPAND, 1) 
     136        gridDatosPersonales.Add(self.estadoCivil, 0, wx.ALL|wx.EXPAND, 1) 
    134137        gridDatosPersonales.Add(self.labelDomicilio, 0, wx.ALL, 1) 
    135138        gridDatosPersonales.Add(self.domicilio, 0, wx.ALL|wx.EXPAND, 1) 
     
    137140        gridDatosPersonales.Add(self.telefono, 0, wx.ALL|wx.EXPAND, 1) 
    138141        gridDatosPersonales.Add(self.checkPlan, 0, wx.ALL, 1) 
    139         gridDatosPersonales.Add(self.comboPlanSocial, 0, wx.ALL|wx.EXPAND, 1) 
     142        gridDatosPersonales.Add(self.planSocial, 0, wx.ALL|wx.EXPAND, 1) 
    140143        gridDatosPersonales.Add(self.checkPlanFamiliar, 0, wx.ALL, 1) 
    141         gridDatosPersonales.Add(self.comboPlanFamiliar, 0, wx.ALL|wx.EXPAND, 1) 
     144        gridDatosPersonales.Add(self.planFamiliar, 0, wx.ALL|wx.EXPAND, 1) 
    142145        gridDatosPersonales.Add(self.labelEmpleo, 0, wx.ALL, 1) 
    143         gridDatosPersonales.Add(self.combo_box_1, 0, wx.ALL|wx.EXPAND, 1) 
     146        gridDatosPersonales.Add(self.empleo, 0, wx.ALL|wx.EXPAND, 1) 
    144147        gridDatosPersonales.Add(self.labelEmpresa, 0, wx.ALL, 1) 
    145148        gridDatosPersonales.Add(self.empresa, 0, wx.ALL|wx.EXPAND, 1) 
     
    157160        sizerMedio.Add(gridDatosPersonales, 1, wx.RIGHT|wx.EXPAND, 14) 
    158161        grid_sizer_1.Add(self.checkDeporte, 0, wx.ALL, 1) 
    159         grid_sizer_1.Add(self.deportes, 0, wx.ALL|wx.EXPAND, 1) 
     162        grid_sizer_1.Add(self.deportesdonde, 0, wx.ALL|wx.EXPAND, 1) 
    160163        grid_sizer_1.Add(self.labelTiempoLibre, 0, wx.ALL, 1) 
    161164        grid_sizer_1.Add(self.hobbyes, 0, wx.ALL|wx.EXPAND, 1) 
     
    206209 
    207210    def OnAceptar(self, event): # wxGlade: LegajoSocial.<event_handler> 
    208         print "Event handler `OnAceptar' not implemented!" 
    209         event.Skip() 
    210  
     211        id_alumno = 1 
     212        nombre = self.nombres.GetValue() 
     213        fechanac = self.fechaNac.GetValue() 
     214        lugarNac = self.lugarNac.GetValue() 
     215        estcivil = self.estadoCivil.GetValue() 
     216        domicilio = self.domicilio.GetValue() 
     217        telefono = self.telefono.GetValue() 
     218        if self.checkPlan.IsChecked(): 
     219            plan = 1 
     220        else: 
     221            plan = 0 
     222        planSocial = self.planSocial.GetValue() 
     223        if self.checkPlanFamiliar.IsChecked(): 
     224            planFamiliar = 1 
     225        else: 
     226            planFamiliar = 0 
     227        planFamiliar = self.planFamiliar.GetValue()     
     228        empleo = self.empleo.GetValue() 
     229        empresa = self.empresa.GetValue() 
     230        educacion = self.educacion.GetValue() 
     231        if self.checkAbandono.IsChecked(): 
     232            abandono = 1 
     233        else: 
     234            abandono = 0 
     235        motivoAbandono = self.motivoAbandono.GetValue() 
     236        if self.checkCursando.IsChecked(): 
     237            cursando = 1 
     238        else: 
     239            cursando = 0 
     240        escuelaActual = self.escuelaActual.GetValue() 
     241        if self.checkFP.IsChecked(): 
     242            otroscursosfp = 1 
     243        else: 
     244            otroscursosfp = 0 
     245        otroscursosfpcuales = self.cursosFP.GetValue() 
     246        if self.checkJefeFam.IsChecked(): 
     247            jefefamilia = 1 
     248        else: 
     249            jefefamilia = 0 
     250        if self.checkDeporte.IsChecked(): 
     251            deportes = 1 
     252        else: 
     253            deportes = 1 
     254        deportesdonde = self.deportesdonde.GetValue() 
     255        tiempolibre = self.hobbyes.GetValue() 
     256        eligioelcentro = self.pQCentro.GetValue() 
     257        eligioelcurso = self.pQCurso.GetValue() 
     258        if self.checkJudiciales.IsChecked(): 
     259            antecedentes = 1 
     260        else: 
     261            antecedentes = 0 
     262        causas = self.judiciales.GetValue() 
     263        tratmedico = self.tratMed.GetValue() 
     264        obs = self.obs.GetValue() 
     265        #c = self.db.cursor() 
     266        #c.execute('''''') 
     267         
    211268    def OnCancelar(self, event): # wxGlade: LegajoSocial.<event_handler> 
    212         print "Event handler `OnCancelar' not implemented!" 
    213         event.Skip() 
     269        self.Close() 
    214270 
    215271# end of class LegajoSocial 
Note: See TracChangeset for help on using the changeset viewer.