private void CargarPersona() { Nom = txtNom.Text; DNI = Convert.ToInt64(txtDNI.Text); FeNac = dtFechaNac.Value; Sex = 'N'; if (rbFem.Checked == true) { Sex = 'F'; } else if (rbMas.Checked == true) { Sex = 'M'; } else if (rbOtro.Checked == true) { Sex = 'O'; } if (txtCarA.Text == "" || txtLegA.Text == "" || txtCarD.Text == "" || txtLegD.Text == "") { DialogResult avisopersona = MessageBox.Show("¿Quiere cargar los datos de un Alumno o Docente?", "Advertencia", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (avisopersona == DialogResult.No) { pers.Nombre = Nom; pers.DNI = DNI; pers.FechaNac = FeNac; pers.Sexo = Sex; string accion = "Alta"; datper.ABMPer(accion, pers); //dgv.Rows.Add(pers.Nombre, pers.DNI, pers.FechaNac, pers.Sexo); MessageBox.Show("Datos cargados con exito"); DGVPersona(); txtNom.Text = ""; txtDNI.Text = ""; } else if (avisopersona == DialogResult.Yes) { pers.Nombre = Nom; pers.DNI = DNI; pers.FechaNac = FeNac; pers.Sexo = Sex; } } }
public int ABMPer(string accion, Persona objPer) { return(objdatper.ABMPer(accion, objPer)); }