protected void CentroCostos() { string centro = string.Empty; if (ddlEvaluador.SelectedIndex == 0) { centro = string.Empty; } else { centro = ddlEvaluador.SelectedValue.ToString(); } BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.USP_ESTRELLA_CC_EVALUADOR(centro, ""); if (dtResultado.Rows.Count > 0) { ddlCentro.DataSource = dtResultado; ddlCentro.DataTextField = "CC"; ddlCentro.DataValueField = "CC_EVALUAR"; ddlCentro.DataBind(); ddlCentro.Items.Insert(0, new ListItem("--- TODOS ---", "")); } else { ddlCentro.Items.Clear(); ddlCentro.Items.Insert(0, new ListItem("--- Seleccionar ---", "")); } Listar(); }
protected void Reconocimiento() { String datosItem = string.Empty; lblCodigos.Text = string.Empty; if (CheckCompetencia.SelectedIndex > -1) { foreach (ListItem li in CheckCompetencia.Items) { if (li.Selected) { datosItem += li.Value + ","; } } lblCodigos.Text = datosItem; BE_RRHH_ESTRELLA_NOMINACION oBESol = new BE_RRHH_ESTRELLA_NOMINACION(); oBESol.IDE_NOMINACION = 0; oBESol.DNI_EVALUADO = ddlPersonal.SelectedValue.ToString(); oBESol.DNI_SUPERVISOR = Session["IDE_USUARIO"].ToString(); oBESol.FACTORES = datosItem; int dtrpta = 0; dtrpta = new BL_RRHH_ESTRELLA_NOMINACION().uspINS_RRHH_ESTRELLA_NOMINACION_VARIOS(oBESol); if (dtrpta > 0) { ListarCompetenciaAsignadas(); } } else { string cleanMessage = "Debe seleccionar alguna competencia"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void ProcesarReconocimiento(object sender, ImageClickEventArgs e) { ImageButton btnProcesar = ((ImageButton)sender); GridViewRow row = btnProcesar.NamingContainer as GridViewRow; string pk = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); RadioButtonList rb = (RadioButtonList)row.FindControl("rdoOpcion"); //string z= pk + " - " + rb.SelectedValue; BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dt = new DataTable(); if (rb.SelectedValue == "R") { ModalRegistro.Show(); lblCodigo.Text = pk.ToString(); } else if (rb.SelectedValue == "A") { dt = obj.uspSEL_RRHH_NOMINACION_PROCESAR(Convert.ToInt32(pk), rb.SelectedValue, 0, ""); string cleanMessage = "Registro procesado"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); Listar(); } }
protected void EliminarNominacion(object sender, EventArgs e) { string cleanMessage = string.Empty; ImageButton btnEliminarFase = ((ImageButton)sender); BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RRHH_ESTRELLA_NOMINACION_POR_ID(Convert.ToInt32(btnEliminarFase.CommandArgument)); if (Convert.ToInt32(dtResultado.Rows[0]["ID"].ToString()) > 0) { try { Nominaciones(); } catch (Exception ex) { cleanMessage = "Existen problemas con la eliminación de nominaciones"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } else { cleanMessage = "No se puede eliminar nominación, en proceso de atención"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void Personal() { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.USP_ESTRELLA_CC_PERSONAL(Session["IDE_USUARIO"].ToString(), ddlCentro.SelectedValue.ToString()); if (dtResultado.Rows.Count > 0) { ddlPersonal.DataSource = dtResultado; ddlPersonal.DataTextField = "NOMBRE_COMPLETO"; ddlPersonal.DataValueField = "ID_DNI"; ddlPersonal.DataBind(); ddlPersonal.Items.Insert(0, new ListItem("--- Seleccionar ---", "")); //btnIngresar.Visible = true; } else { ddlPersonal.Items.Clear(); ddlPersonal.Items.Insert(0, new ListItem("--- Seleccionar ---", "")); //btnIngresar.Visible = false; string cleanMessage = "No existe personal a reconocer"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void LISTAR_EVALUADOR() { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); ddlEvaluador.DataSource = obj.USP_ESTRELLA_LISTAR_EVALUADOR(); ddlEvaluador.DataTextField = "NOMBRE_COMPLETO"; ddlEvaluador.DataValueField = "DNI_PERSONAL"; ddlEvaluador.DataBind(); ddlEvaluador.Items.Insert(0, new ListItem("--- TODOS ---", "")); //Listar(); }
protected void Listar() { string estado = string.Empty; if (ddlEstados.SelectedIndex == 0) { estado = string.Empty; } else { estado = ddlEstados.SelectedValue.ToString(); } string evaluador = string.Empty; if (ddlEvaluador.SelectedIndex == 0) { evaluador = string.Empty; } else { evaluador = ddlEvaluador.SelectedValue.ToString(); } string centro = string.Empty; if (ddlCentro.SelectedIndex == 0) { centro = string.Empty; } else { centro = ddlCentro.SelectedValue.ToString(); } BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RRHH_ESTRELLA_NOMINACION_POR_ESTADOS(estado, centro, evaluador); if (dtResultado.Rows.Count > 0) { GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { GridView1.DataSource = dtResultado; GridView1.DataBind(); } }
protected void btnEnviar_Click(object sender, EventArgs e) { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_TIPO_EVALUACION_ESTRELLA(Session["IDE_USUARIO"].ToString()); if (dtResultado.Rows[0]["EVALUACION"].ToString() == "0") { Registro(); } else { Registro_obra(); } }
protected void Nominaciones() { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RRHH_ESTRELLA_NOMINACIONES(Session["IDE_USUARIO"].ToString()); if (dtResultado.Rows.Count > 0) { ListView1.DataSource = dtResultado; ListView1.DataBind(); } else { ListView1.DataSource = dtResultado; ListView1.DataBind(); } }
protected void Actualizar_Sustento(object sender, ImageClickEventArgs e) { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); ImageButton btnEditar = ((ImageButton)sender); GridViewRow row = btnEditar.NamingContainer as GridViewRow; string pk = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); TextBox txtSustento = (TextBox)row.FindControl("txtSustento"); obj.uspUPD_RRHH_NOMINACION_SUSTENTO(Convert.ToInt32(pk), txtSustento.Text); string cleanMessage = "Sustento actualizado"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); Listar(); }
protected void CentroCostos() { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.USP_ESTRELLA_CC_EVALUADOR(Session["IDE_USUARIO"].ToString(), BL_Session.CENTRO_COSTO); if (dtResultado.Rows.Count > 0) { ddlCentro.DataSource = dtResultado; ddlCentro.DataTextField = "CC"; ddlCentro.DataValueField = "CC_EVALUAR"; ddlCentro.DataBind(); ddlCentro.Items.Insert(0, new ListItem("--- TODOS ---", "")); } else { ddlCentro.Items.Insert(0, new ListItem("--- Seleccionar ---", "")); } }
protected void ListarCompetenciaAsignadas() { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RRHH_ESTRELLA_EVAL_EVALUADO(ddlPersonal.SelectedValue.ToString(), Session["IDE_USUARIO"].ToString()); if (dtResultado.Rows.Count > 0) { ListView1.DataSource = dtResultado; ListView1.DataBind(); btnEnviar.Visible = true; } else { btnEnviar.Visible = false; ListView1.DataSource = dtResultado; ListView1.DataBind(); } }
protected void btnGuardar_Click(object sender, EventArgs e) { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dt = new DataTable(); if (txtSustento.Text != string.Empty) { dt = obj.uspSEL_RRHH_NOMINACION_PROCESAR(Convert.ToInt32(lblCodigo.Text), "R", 100, txtSustento.Text.Trim()); string cleanMessage = "Registro procesado"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); Listar(); } else { string cleanMessage = "ingresar sustento de rechazo"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void estado() { { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.USP_ESTRELLA_CC_EVALUADOR(Session["IDE_USUARIO"].ToString(), BL_Session.CENTRO_COSTO); if (dtResultado.Rows.Count > 0) { btnReconocer.Visible = true; } else { btnReconocer.Visible = false; string cleanMessage = "No tiene acceso al proceso de nominación : Estrella SSK"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }
protected void Registro() { string cleanMessage = string.Empty; foreach (ListViewDataItem FilaFactor in ListView1.Items) { TextBox txtsustento = ((TextBox)FilaFactor.FindControl("txtSustento")); Label lblIDE_NOMINACION = ((Label)FilaFactor.FindControl("lblIDE_NOMINACION")); Label lblDNI_EVALUADO = ((Label)FilaFactor.FindControl("lblDNI_EVALUADO")); Label lblIDE_FACTOR = ((Label)FilaFactor.FindControl("lblIDE_FACTOR")); if (txtsustento.Text != string.Empty) { BE_RRHH_ESTRELLA_NOMINACION oBESol = new BE_RRHH_ESTRELLA_NOMINACION(); oBESol.IDE_NOMINACION = Convert.ToInt32(lblIDE_NOMINACION.Text); oBESol.DNI_EVALUADO = lblDNI_EVALUADO.Text; oBESol.DNI_SUPERVISOR = Session["IDE_USUARIO"].ToString(); oBESol.IDE_FACTOR = Convert.ToInt32(lblIDE_FACTOR.Text); oBESol.SUSTENTO = txtsustento.Text.Trim(); int dtrpta = 0; dtrpta = new BL_RRHH_ESTRELLA_NOMINACION().uspINS_RRHH_ESTRELLA_NOMINACION(oBESol); if (dtrpta > 0) { BL_RRHH_ESTRELLA_NOMINACION ob = new BL_RRHH_ESTRELLA_NOMINACION(); ob.CORREO_NOMINACION(dtrpta); ob.SP_CORREO_NOMINACION_IDE(dtrpta); //cleanMessage = "Registro exitoso, en poco tiempo estaremos informando sobre la situación de esta nominación, gracias"; //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); ModalRegistro.Show(); } } else { cleanMessage = "Ingresar sustento de nominación"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }
protected void btnSustentar_Click(object sender, EventArgs e) { if (ddlPersonal.SelectedValue == string.Empty) { string cleanMessage = "Falta seleccionar personal"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { BL_RRHH_ESTRELLA_NOMINACION obj = new BL_RRHH_ESTRELLA_NOMINACION(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_TIPO_EVALUACION_ESTRELLA(Session["IDE_USUARIO"].ToString()); if (dtResultado.Rows[0]["EVALUACION"].ToString() == "0") { Reconocimiento(); } else { Reconocimiento_Obra(); } } }