private void actualizaSecundario(h_sestse obj) { dbaseORM orm = new dbaseORM(); bool actualizado = orm.update <h_sestse>(obj); if (actualizado) { globales.MessageBoxSuccess("Registro actualizado correctamente", "Aviso", globales.menuPrincipal); } }
private void guardarSecundario(object sender, EventArgs e) { calculadiferencias(); string query = $"select expediente from datos.h_sestse where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'"; List <Dictionary <string, object> > resultado = globales.consulta(query); h_sestse ses = new h_sestse(); ses.expediente = globales.convertInt(txtExpediente.Text); ses.sec = this.secuencia; ses = rellenaSecundarioObj(ses); if (resultado.Count != 0) { actualizaSecundario(ses); } else { insertaSecundario(ses); } }
private void rellenarSecundario(h_sestse obj) { this.secundario.txtA_Condic.Text = obj.a_condic; this.secundario.txtA_Ncuartos.Text = obj.a_ncuartos.ToString(); this.secundario.txtA_pisos.Text = obj.a_pisos; this.secundario.txtA_Ilumin.Text = obj.a_ilumin; this.secundario.txtA_Ventil.Text = obj.a_ventil; this.secundario.txtA_Pared.Text = obj.a_pared; this.secundario.txtF_Elab.Text = globales.parseDateTime(obj.f_elab); this.secundario.txtA_Techo.Text = obj.a_techo; this.secundario.txtA_Servsanit.Text = obj.a_servsanit; this.secundario.txtA_Patio.Text = obj.a_patio; this.secundario.chkB_estufa.Checked = obj.b_estufa == "S" ? true :false; this.secundario.chkB_Refri.Checked = obj.b_refri == "S" ? true : false; this.secundario.chkB_Comedor.Checked = obj.b_comedor == "S" ? true : false; this.secundario.chkB_Sala.Checked = obj.b_sala == "S" ? true : false; this.secundario.chkB_Gabinete.Checked = obj.b_gabinete == "S" ? true : false; this.secundario.chkB_Roperos.Checked = obj.b_roperos == "S" ? true : false; this.secundario.chkB_Camas.Checked = obj.b_camas == "S" ? true : false; this.secundario.chkB_Licuad.Checked = obj.b_licuad == "S" ? true : false; this.secundario.chkB_Tv.Checked = obj.b_tv == "S" ? true : false; this.secundario.chkB_Radio.Checked = obj.b_radio == "S" ? true : false; this.secundario.chkB_Lavad.Checked = obj.b_lavad == "S" ? true : false; this.secundario.chkB_Videoc.Checked = obj.b_videoc == "S" ? true : false; this.secundario.chkB_Ventil.Checked = obj.b_ventil == "S" ? true : false; this.secundario.chk_Maqcoser.Checked = obj.b_maqcoser == "S" ? true : false; this.secundario.chkB_Vehic.Checked = obj.b_vehic == "S" ? true : false; this.secundario.txtB_Otros.Text = obj.b_otros; this.secundario.txtI_Sueldo.Text = string.Format("{0:C}", obj.i_sueldo).Replace("$", ""); this.secundario.txtI_Ayudas.Text = string.Format("{0:C}", obj.i_ayuda).Replace("$", ""); this.secundario.txtI_Quinq.Text = string.Format("{0:C}", obj.i_quinq).Replace("$", ""); this.secundario.txtI_Otros.Text = string.Format("{0:C}", obj.i_otros).Replace("$", ""); this.secundario.txtI_Conyu.Text = string.Format("{0:C}", obj.i_conyu).Replace("$", ""); this.secundario.txtI_Hijos.Text = string.Format("{0:C}", obj.i_hijos).Replace("$", ""); this.secundario.txtI_OtrosF.Text = string.Format("{0:C}", obj.i_otrosf).Replace("$", ""); this.secundario.txtI_Total.Text = string.Format("{0:C}", obj.i_total).Replace("$", ""); this.secundario.txtE_Quiro.Text = string.Format("{0:C}", obj.e_quiro).Replace("$", ""); this.secundario.txtE_Hipo.Text = string.Format("{0:C}", obj.e_hipo).Replace("$", ""); this.secundario.txtE_Direc.Text = string.Format("{0:C}", obj.e_direc).Replace("$", ""); this.secundario.txtE_Lbca.Text = string.Format("{0:C}", obj.e_lbca).Replace("$", ""); this.secundario.txtE_Fpens.Text = string.Format("{0:C}", obj.e_fpens).Replace("$", ""); this.secundario.txtE_Ss.Text = string.Format("{0:C}", obj.e_ss).Replace("$", ""); this.secundario.txtE_Csindic.Text = string.Format("{0:C}", obj.e_csindic).Replace("$", ""); this.secundario.txtE_Ispt.Text = string.Format("{0:C}", obj.e_ispt).Replace("$", ""); this.secundario.txtE_Otros.Text = string.Format("{0:C}", obj.e_otros).Replace("$", ""); this.secundario.txtE_Alim.Text = string.Format("{0:C}", obj.e_alim).Replace("$", ""); this.secundario.txtE_Vestu.Text = string.Format("{0:C}", obj.e_vestu).Replace("$", ""); this.secundario.txtE_Transp.Text = string.Format("{0:C}", obj.e_transp).Replace("$", ""); this.secundario.txtE_Renta.Text = string.Format("{0:C}", obj.e_renta).Replace("$", ""); this.secundario.txtE_Agua.Text = string.Format("{0:C}", obj.e_agua).Replace("$", ""); this.secundario.txtE_Luz.Text = string.Format("{0:C}", obj.e_luz).Replace("$", ""); this.secundario.txtE_Gas.Text = string.Format("{0:C}", obj.e_gas).Replace("$", ""); this.secundario.txtE_Tel.Text = string.Format("{0:C}", obj.e_tel).Replace("$", ""); this.secundario.txtE_Coleg.Text = string.Format("{0:C}", obj.e_coleg).Replace("$", ""); this.secundario.txtE_Servid.Text = string.Format("{0:C}", obj.e_servid).Replace("$", ""); this.secundario.txtE_OtrosF.Text = string.Format("{0:C}", obj.e_otrosf).Replace("$", ""); this.secundario.txtE_Total.Text = string.Format("{0:C}", obj.e_total).Replace("$", ""); this.secundario.txtObserv.Text = obj.observ; this.secundario.txtConclus.Text = string.Format("{0:C}", obj.conclus).Replace("$", ""); this.secundario.txtDifer_I_E.Text = string.Format("{0:C}", obj.difer_i_e).Replace("$", ""); }
private h_sestse rellenaSecundarioObj(h_sestse obj) { obj.a_condic = this.secundario.txtA_Condic.Text; obj.a_ncuartos = globales.convertInt(this.secundario.txtA_Ncuartos.Text); obj.a_pisos = this.secundario.txtA_pisos.Text; obj.a_ilumin = this.secundario.txtA_Ilumin.Text; obj.a_ventil = this.secundario.txtA_Ventil.Text; obj.a_pared = this.secundario.txtA_Pared.Text; obj.a_techo = this.secundario.txtA_Techo.Text; obj.a_servsanit = this.secundario.txtA_Servsanit.Text; obj.a_patio = this.secundario.txtA_Patio.Text; obj.f_elab = globales.convertDatetime(this.secundario.txtF_Elab.Text); obj.b_estufa = this.secundario.chkB_estufa.Checked ? "S" : "N"; obj.b_refri = this.secundario.chkB_Refri.Checked ? "S" : "N"; obj.b_sala = this.secundario.chkB_Sala.Checked ? "S" : "N"; obj.b_gabinete = this.secundario.chkB_Gabinete.Checked ? "S" : "N"; obj.b_roperos = this.secundario.chkB_Roperos.Checked ? "S" : "N"; obj.b_camas = this.secundario.chkB_Camas.Checked ? "S" : "N"; obj.b_licuad = this.secundario.chkB_Licuad.Checked ? "S" : "N"; obj.b_tv = this.secundario.chkB_Tv.Checked ? "S" : "N"; obj.b_radio = this.secundario.chkB_Radio.Checked ? "S" : "N"; obj.b_lavad = this.secundario.chkB_Lavad.Checked ? "S" : "N"; obj.b_videoc = this.secundario.chkB_Videoc.Checked ? "S" : "N"; obj.b_ventil = this.secundario.chkB_Ventil.Checked ? "S" : "N"; obj.b_maqcoser = this.secundario.chk_Maqcoser.Checked ? "S" : "N"; obj.b_vehic = this.secundario.chkB_Vehic.Checked ? "S" : "N"; obj.b_comedor = this.secundario.chkB_Comedor.Checked ? "S" : "N"; obj.b_otros = this.secundario.txtB_Otros.Text; obj.i_sueldo = globales.convertDouble(this.secundario.txtI_Sueldo.Text); obj.i_ayuda = globales.convertDouble(this.secundario.txtI_Ayudas.Text); obj.i_quinq = globales.convertDouble(this.secundario.txtI_Quinq.Text); obj.i_otros = globales.convertDouble(this.secundario.txtI_Otros.Text); obj.i_conyu = globales.convertDouble(this.secundario.txtI_Conyu.Text); obj.i_hijos = globales.convertDouble(this.secundario.txtI_Hijos.Text); obj.i_otrosf = globales.convertDouble(this.secundario.txtI_OtrosF.Text); obj.i_total = globales.convertDouble(this.secundario.txtI_Total.Text); obj.e_quiro = globales.convertDouble(this.secundario.txtE_Quiro.Text); obj.e_hipo = globales.convertDouble(this.secundario.txtE_Hipo.Text); obj.e_direc = globales.convertDouble(this.secundario.txtE_Direc.Text); obj.e_lbca = globales.convertDouble(this.secundario.txtE_Lbca.Text); obj.e_fpens = globales.convertDouble(this.secundario.txtE_Fpens.Text); obj.e_ss = globales.convertDouble(this.secundario.txtE_Ss.Text); obj.e_csindic = globales.convertDouble(this.secundario.txtE_Csindic.Text); obj.e_ispt = globales.convertDouble(this.secundario.txtE_Ispt.Text); obj.e_otros = globales.convertDouble(this.secundario.txtE_Otros.Text); obj.e_alim = globales.convertDouble(this.secundario.txtE_Alim.Text); obj.e_vestu = globales.convertDouble(this.secundario.txtE_Vestu.Text); obj.e_transp = globales.convertDouble(this.secundario.txtE_Transp.Text); obj.e_renta = globales.convertDouble(this.secundario.txtE_Renta.Text); obj.e_agua = globales.convertDouble(this.secundario.txtE_Agua.Text); obj.e_luz = globales.convertDouble(this.secundario.txtE_Luz.Text); obj.e_gas = globales.convertDouble(this.secundario.txtE_Gas.Text); obj.e_tel = globales.convertDouble(this.secundario.txtE_Tel.Text); obj.e_coleg = globales.convertDouble(this.secundario.txtE_Coleg.Text); obj.e_servid = globales.convertDouble(this.secundario.txtE_Servid.Text); obj.e_otrosf = globales.convertDouble(this.secundario.txtE_OtrosF.Text); obj.e_total = globales.convertDouble(this.secundario.txtE_Total.Text); obj.observ = this.secundario.txtObserv.Text; obj.conclus = this.secundario.txtConclus.Text; obj.difer_i_e = globales.convertDouble(this.secundario.txtDifer_I_E.Text); return(obj); }