/// <summary> Modifica los datos del agraciado solicitados por la aseguradora. </summary> /// <param name="tobjSocio"> Un objeto del tipo persona a modificar.</param> /// <returns> Un string que indica si se ejecuto o no la operación. </returns> public string gmtdActualizarDato(personasaModificar tobjPersona) { String strResultado; try { using (dbExequial2010DataContext socio = new dbExequial2010DataContext()) { tblAgraciado agr_old = socio.tblAgraciados.SingleOrDefault(p => p.strCedulaAgra == tobjPersona.strCedula); agr_old.dtmFechaNac = tobjPersona.dtmFechaNacimeinto; agr_old.strApellido1Agra = tobjPersona.strApellido1; agr_old.strApellido2Agra = tobjPersona.strApellido2; agr_old.strCedulaAgra = tobjPersona.strCedula; agr_old.strDireccion = tobjPersona.strDireccion; agr_old.strNombreAgra = tobjPersona.strNombre; agr_old.strTelefono = tobjPersona.strTelefono; agr_old.bitActualizado = true; socio.tblLogdeActividades.InsertOnSubmit(tobjPersona.log); socio.SubmitChanges(); strResultado = "Registro Actualizado"; } } catch (Exception ex) { new dao().gmtdInsertarError(ex); strResultado = "- Ocurrió un error al Actualizar el registro"; } return(strResultado); }
public FrmActualizarDatos(personasaModificar tobjPersona) { InitializeComponent(); this.txtCodigo.Text = tobjPersona.intCodigoSoc.ToString(); this.txtCedula.Text = tobjPersona.strCedula; this.txtNombre.Text = tobjPersona.strNombre; this.txtApellido1.Text = tobjPersona.strApellido1; this.txtApellido2.Text = tobjPersona.strApellido2; this.txtTelefono.Text = tobjPersona.strTelefono; this.txtDireccion.Text = tobjPersona.strDireccion; this.dtpFechaNac.Value = tobjPersona.dtmFechaNacimeinto; this.txtProcedencia.Text = tobjPersona.strProcedencia; objPeronaaModificar = tobjPersona; }
private void btnAceptar_Click(object sender, EventArgs e) { personasaModificar objPersona = new personasaModificar(); objPersona.dtmFechaNacimeinto = this.dtpFechaNac.Value; objPersona.intCodigoSoc = Convert.ToInt32(this.txtCodigo.Text); objPersona.strApellido1 = this.txtApellido1.Text; objPersona.strApellido2 = this.txtApellido2.Text; objPersona.strCedula = this.txtCedula.Text; objPersona.strDireccion = this.txtDireccion.Text; objPersona.strNombre = this.txtNombre.Text; objPersona.strTelefono = this.txtTelefono.Text; if (this.txtCedula.Text.Trim() != objPeronaaModificar.strCedula) { if (new blSocio().gmtdConsultarCeduladeSocioAgraciadoFallecido(this.txtCedula.Text)) { MessageBox.Show("Este número de cédula ya aparece registrada como socio, agraciado o fallecido. ", "Ingreso.", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (this.txtProcedencia.Text.Trim() == "Socio") { MessageBox.Show(new blSocio().gmtdEditarCeduladeSocio(objPeronaaModificar.strCedula, this.txtCedula.Text), "Editar.", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(new blAgraciado().gmtdEditarCeduladeAgraciado(objPeronaaModificar.strCedula, this.txtCedula.Text), "Editar.", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (this.txtProcedencia.Text == "Socio") { this.pmtdMensaje(new blSocio().gmtdActualizarDato(objPersona), "Ingresos"); } else { this.pmtdMensaje(new blAgraciado().gmtdActualizarDato(objPersona), "Ingresos"); } this.Dispose(); }
/// <summary> Modifica los datos del socio solicitados por la aseguradora. </summary> /// <param name="tobjSocio"> Un objeto del tipo persona a modificar.</param> /// <returns> Un string que indica si se ejecuto o no la operación. </returns> public string gmtdActualizarDato(personasaModificar tobjPersona) { if (tobjPersona.dtmFechaNacimeinto == null || tobjPersona.dtmFechaNacimeinto == Convert.ToDateTime("1900-01-01")) { return("- Debe de ingresar la fecha de nacimiento. "); } if (tobjPersona.intCodigoSoc == 0) { return("- Debe de ingresar el código del socio."); } if (tobjPersona.strApellido1 == null) { return("- Debe de ingresar el apellido del socio. "); } if (tobjPersona.strCedula == null) { return("- Debe de ingresar la cédula del socio. "); } if (tobjPersona.strDireccion == null) { return("- Debe de ingresar la dirección del socio. "); } if (tobjPersona.strTelefono == null) { return("- Debe de ingresar el Teléfono del socio. "); } if (tobjPersona.strNombre == null) { return("- Debe de ingresar el nombre del socio. "); } tobjPersona.log = metodos.gmtdLog("Modifica el socio para aseguradora " + tobjPersona.intCodigoSoc, "FrmIngresos"); return(new daoSocio().gmtdActualizarDato(tobjPersona)); }
/// <summary> Modifica los datos del socio solicitados por la aseguradora. </summary> /// <param name="tobjSocio"> Un objeto del tipo persona a modificar.</param> /// <returns> Un string que indica si se ejecuto o no la operación. </returns> public string gmtdActualizarDato(personasaModificar tobjPersona) { return(new blSocio().gmtdActualizarDato(tobjPersona)); }