private void btn_agragarcertificaciones_Click(object sender, RoutedEventArgs e) { if (!(string.IsNullOrEmpty(txt_TitutloCertificacion.Text) | string.IsNullOrEmpty(txt_InstCertiicacion.Text) | cb_añoFinCertificacion.SelectedIndex == -1)) { if (nuevoCerti == false) { tablaCerti.Rows.Remove(RowPivotInfoAca); RowPivotInfoAca = null; string nombre, institutucion; int anio; nombre = txt_TitutloCertificacion.Text; institutucion = txt_InstCertiicacion.Text; anio = Convert.ToInt32(cb_añoFinCertificacion.Text); CertificacionesE certiObj = new CertificacionesE(); certiObj.id_candidato = (int.Parse(idCandidato)); certiObj.id_certificaciones = int.Parse(idUpdateCertifi); certiObj.institucion = institutucion; certiObj.nombre = nombre; certiObj.anio = anio; bool agregar = true; foreach (DataRowView dr in DataGrid_Certificaciones.Items) { if ((dr.Row.ItemArray[1].ToString().ToLower()) == nombre.ToLower() && dr.Row.ItemArray[2].ToString().ToLower() == institutucion.ToLower() && dr.Row.ItemArray[3].ToString().ToLower() == anio.ToString().ToLower()) { agregar = false; } } if (agregar) { tablaCerti.Rows.Remove(RowPivotInfoAca); RowPivotInfoAca = null; CertificacionesBLL certiBll = new CertificacionesBLL(); certiBll.ActualizarCertificacionesLAB(certiObj, certiObj.id_candidato, ref oerro); tablaCerti.Rows.Add(certiObj.id_certificaciones, nombre, institutucion, anio); } else { MessageBox.Show("Esa informacion ya ha sido ingresada, por favor revisar los datos."); agregar = true; } txt_TitutloCertificacion.Text = string.Empty; txt_InstCertiicacion.Text = string.Empty; cb_añoFinCertificacion.SelectedIndex = 0; nuevoCerti = true; } else { //falta metodo agregar certificacion agregarCertificacion(); } } else { MessageBox.Show("Inserte todos los datos solicitados"); } }
private DataTable datosCertificaciones(int idCandidato) { CertificacionesBLL certi = new CertificacionesBLL(); return certi.selectCertifi(idCandidato, ref oerro); }