protected void limpiar_experiencia() { txtActiv.Text = string.Empty; //txtDuracion.Text = string.Empty; //dlRango.SelectedIndex = 0; txtCertif.Text = string.Empty; dlDepAct.DataSource = Ubigeo.listar_dept(); dlDepAct.DataBind(); dlDepAct_SelectedIndexChanged(null, null); dlProvAct_SelectedIndexChanged(null, null); dlActiv.DataSource = Actividad.listar_Actividad(); dlActiv.DataBind(); dlActiv.Enabled = true; chbOtraActiv.Checked = false; txtActiv.Enabled = false; dlOrg.DataSource = OrgAtendida.listar_OrgAtendida(); dlOrg.DataBind(); dlOrg.Enabled = true; chbOtraOrg.Checked = false; txtOrg.Enabled = false; txtActiv.Text = string.Empty; txtOrg.Text = string.Empty; txtRefer.Text = string.Empty; txtRecon.Text = string.Empty; txtInicio.Text = string.Empty; txtFin.Text = string.Empty; rbCertNo.Checked = true; rbCertSi.Checked = false; txtCertif.Enabled = false; txtCertif.Text = "No cuenta con uno"; chbTodosDist.Checked = false; dlDistAct.Enabled = true; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //------------------------------------ dlDep.DataSource = Ubigeo.listar_dept(); dlDep.DataBind(); dlDep_SelectedIndexChanged(null, null); dlProv_SelectedIndexChanged(null, null); //------------------------------------ dlDepAct.DataSource = Ubigeo.listar_dept(); dlDepAct.DataBind(); dlDepAct_SelectedIndexChanged(null, null); dlProvAct_SelectedIndexChanged(null, null); txtUbigeo.Text = string.Empty; txtLugarActv.Text = string.Empty; txtDNI.Text = string.Empty; txtActividad.Text = string.Empty; dlActividad.DataSource = Actividad.listar_Actividad(); dlActividad.DataBind(); dlOrganizacion.DataSource = OrgAtendida.listar_OrgAtendida(); dlOrganizacion.DataBind(); rvReporteTalento.LocalReport.ReportPath = "Reportes/ReporteTalento.rdlc"; rvReportExp.LocalReport.ReportPath = "Reportes/ReportExp.rdlc"; rvGrafico.LocalReport.ReportPath = "Reportes/Graficos.rdlc"; rvTalentoporActiv.LocalReport.ReportPath = "Reportes/TalentoporActiv.rdlc"; rvTalentoporOrg.LocalReport.ReportPath = "Reportes/TalentoporOrg.rdlc"; rvActivporOrg.LocalReport.ReportPath = "Reportes/ActivporOrg.rdlc"; rvActivporAnio.LocalReport.ReportPath = "Reportes/ActivporAnio.rdlc"; rvOrgporAnio.LocalReport.ReportPath = "Reportes/OrgporAnio.rdlc"; rvDeptporAnio.LocalReport.ReportPath = "Reportes/DeptporAnio.rdlc"; refrescarInformes(); //Oferentes.WEB.dsDirectorioTableAdapters.sp_Talento_search_ubigeoTableAdapter da = new Oferentes.WEB.dsDirectorioTableAdapters.sp_Talento_search_ubigeoTableAdapter(); //DataTable dt = new DataTable(); //da.Fill("tablita",dt); //txtPruebaDNI.Text = dt.Rows[0][1].ToString(); } }
protected void btnInsertarExp_Click(object sender, EventArgs e) { try { int codActiv, codOrg; Experiencia exp = new Experiencia(); DataSet ds = new DataSet(); Actividad act = new Actividad(); OrgAtendida org = new OrgAtendida(); exp._num_dni = Convert.ToInt32(txtDNI.Text); if (chbOtraActiv.Checked) { act._nombre = txtActiv.Text; Actividad.insertar_Actividad(act); codActiv = Convert.ToInt16((Actividad.buscar_Actividad_nombre(act)).Tables[0].Rows[0][0]); exp._actividad = codActiv; } else { exp._actividad = Convert.ToInt16(dlActiv.SelectedValue); } exp._duracion = txtInicio.Text + " - " + txtFin.Text; exp._certificado = txtCertif.Text; exp._lugar_activ = dlDistAct.SelectedValue; if (chbOtraOrg.Checked) { org._nombre = txtOrg.Text; OrgAtendida.insertar_OrgAtendida(org); codOrg = Convert.ToInt16((OrgAtendida.buscar_OrgAtendida_nombre(org)).Tables[0].Rows[0][0]); exp._organizacion_atendida = codOrg; } else { exp._organizacion_atendida = Convert.ToInt16(dlOrg.SelectedValue); } exp._referente = txtRefer.Text; exp._reconocimientos = txtRecon.Text; Experiencia.insertar_Experiencia(exp); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", "alert('Se insertó la experiencia correctamente')", true); cargarExperiencia(); //dlActiv.DataSource = Actividad.listar_Actividad(); //dlActiv.DataBind(); //dlActiv.Enabled = true; //chbOtraActiv.Checked = false; //txtActiv.Enabled = false; //dlOrg.DataSource = OrgAtendida.listar_OrgAtendida(); //dlOrg.DataBind(); //dlOrg.Enabled = true; //chbOtraOrg.Checked = false; //txtOrg.Enabled = false; //txtActiv.Text = string.Empty; //txtOrg.Text = string.Empty; //txtRefer.Text = string.Empty; //txtRecon.Text = string.Empty; limpiar_experiencia(); } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //------------------------------------ dlDep.DataSource = Ubigeo.listar_dept(); dlDep.DataBind(); dlDep_SelectedIndexChanged(null, null); dlProv_SelectedIndexChanged(null, null); //------------------------------------ dlEstCivil.DataSource = Estado_Civil.listar_estcivil(); dlEstCivil.DataBind(); dlResid.DataSource = Residencia.listar_residencia(); dlResid.DataBind(); //------------------------------------ dlDepRes.DataSource = Ubigeo.listar_dept(); dlDepRes.DataBind(); dlDepRes_SelectedIndexChanged(null, null); dlProvRes_SelectedIndexChanged(null, null); //------------------------------------ dlNivel.DataSource = Estudio.listar_nivel(); dlNivel.DataBind(); dlNivel_SelectedIndexChanged(null, null); dlGrado_SelectedIndexChanged(null, null); //------------------------------------ dlIdioma.DataSource = Idioma.listar_idioma(); dlIdioma.DataBind(); //------------------------------------ dlDepAct.DataSource = Ubigeo.listar_dept(); dlDepAct.DataBind(); dlDepAct_SelectedIndexChanged(null, null); dlProvAct_SelectedIndexChanged(null, null); //------------------------------------ dlActiv.DataSource = Actividad.listar_Actividad(); dlActiv.DataBind(); //------------------------------------ dlOrg.DataSource = OrgAtendida.listar_OrgAtendida(); dlOrg.DataBind(); //------------------------------------ ddlDNI.DataSource = Talento.listar_Talento_combo_mant(); ddlDNI.DataBind(); string popupScript = "Javascript: return " + "window.open('" + "../Admin/CV.aspx" + "', 'CustomPopUp', " + "'width=1000, height=600, menubar=no, resizable=no');"; btnCV.Attributes.Add("onclick", popupScript); } }
protected void btnGrabar_Click(object sender, EventArgs e) { try { Talento tal = new Talento(); Experiencia exp = new Experiencia(); tal._nombres = txtNomb.Text; tal._apellidos = txtApell.Text; tal._num_dni = Convert.ToInt32(txtDNI.Text); tal._fecha_nac = Convert.ToDateTime(txtFechanac.Text); tal._lugar_nac = dlDist.SelectedValue; if (rbtnMale.Checked) { tal._sexo = rbtnMale.Text; } else { tal._sexo = rbtnFemale.Text; } tal._estado_civil = Convert.ToInt16(dlEstCivil.SelectedValue); tal._residencia = Convert.ToInt16(dlResid.SelectedValue); tal._direccion = txtDir.Text; tal._ubigeo = dlDistRes.SelectedValue; tal._telefono_fijo = Convert.ToInt32(txtFijo.Text); tal._telefono_celular = Convert.ToInt32(txtCell.Text); tal._correo = txtCorreo.Text; if (dlNivel.SelectedItem.ToString() == "Ninguno") { tal._estudio = "00"; if (rbLectura.Checked) { tal._lect_esc = rbLectura.Text; } else { if (rbEscritura.Checked) { tal._lect_esc = rbEscritura.Text; } else { tal._lect_esc = rbAmbos.Text; } } } else { tal._estudio = dlGrado.SelectedValue; tal._lect_esc = ""; } tal._idioma = Convert.ToInt16(dlIdioma.SelectedValue); Talento.insertar_Talento(tal); DataTable dt = Session["datos"] as DataTable; DataSet ds = new DataSet(); Actividad act = new Actividad(); OrgAtendida org = new OrgAtendida(); int codActiv, codOrg; for (int i = 0; i < dt.Rows.Count; i++) { exp._num_dni = Convert.ToInt32(txtDNI.Text); if (dt.Rows[i][0].ToString() == "0") { act._nombre = dt.Rows[i][1].ToString(); ds = Actividad.buscar_Actividad_nombre(act); if (ds.Tables[0].Rows.Count == 0) { Actividad.insertar_Actividad(act); codActiv = Convert.ToInt16((Actividad.buscar_Actividad_nombre(act)).Tables[0].Rows[0][0]); } else { codActiv = Convert.ToInt16(ds.Tables[0].Rows[0][0]); } exp._actividad = codActiv; } else { exp._actividad = Convert.ToInt16(dt.Rows[i][0].ToString()); } exp._duracion = dt.Rows[i][4].ToString(); exp._certificado = dt.Rows[i][7].ToString(); exp._lugar_activ = dt.Rows[i][2].ToString(); if (dt.Rows[i][5].ToString() == "0") { org._nombre = dt.Rows[i][6].ToString(); ds = OrgAtendida.buscar_OrgAtendida_nombre(org); if (ds.Tables[0].Rows.Count == 0) { OrgAtendida.insertar_OrgAtendida(org); codOrg = Convert.ToInt16((OrgAtendida.buscar_OrgAtendida_nombre(org)).Tables[0].Rows[0][0]); } else { codOrg = Convert.ToInt16(ds.Tables[0].Rows[0][0]); } exp._organizacion_atendida = codOrg; } else { exp._organizacion_atendida = Convert.ToInt16(dt.Rows[i][5].ToString()); } exp._referente = dt.Rows[i][8].ToString(); exp._reconocimientos = dt.Rows[i][9].ToString(); Experiencia.insertar_Experiencia(exp); } btnCV_Click(null, null); limpiar_talento(); limpiar_experiencia(); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", "alert('Grabó correctamente')", true); } catch (Exception ex) { //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", "alert('"+ex.Message+"')", true); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", "alert('Este Talento ya existe')", true); } }