protected void CargarTrabajadores(int IDE_RESPONSABLE, string CENTRO) { BL_EQUIPO_TRABAJO obj = new BL_EQUIPO_TRABAJO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspINS_EQUIPO_TRABAJO_VARIOS(IDE_RESPONSABLE, CENTRO, Session["IDE_USUARIO"].ToString()); }
protected void Listar() { string NOMBRE = string.Empty; if (txtPersonal.Text.Trim() == "") { NOMBRE = string.Empty; } else { NOMBRE = txtPersonal.Text.Trim(); } BL_EQUIPO_TRABAJO obj = new BL_EQUIPO_TRABAJO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_EQUIPO_TRABAJO_LIBRE(NOMBRE); lblTotal.Text = " - " + dtResultado.Rows.Count.ToString(); if (dtResultado.Rows.Count > 0) { GridView1.Visible = true; GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { GridView1.Visible = false; GridView1.DataSource = dtResultado; GridView1.DataBind(); } }
protected void VerificarResposanble() { BL_EQUIPO_TRABAJO obj = new BL_EQUIPO_TRABAJO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_EQUIPO_TRABAJO_DNI(Session["IDE_USUARIO"].ToString()); if (dtResultado.Rows.Count > 0) { Boolean FLG_ESTADO = Convert.ToBoolean(dtResultado.Rows[0]["FLG_ESTADO"].ToString()); if (FLG_ESTADO == true) { btnviar.Visible = true; } else { btnviar.Visible = false; string cleanMessage = "Momentaneamente no puede generar solicitudes"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } else { btnviar.Visible = false; string cleanMessage = "Momentaneamente no puede generar solicitudes"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void Eliminar(object sender, ImageClickEventArgs e) { ImageButton btnEliminar = ((ImageButton)sender); GridViewRow row = btnEliminar.NamingContainer as GridViewRow; string pk = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); BL_EQUIPO_TRABAJO obj = new BL_EQUIPO_TRABAJO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspUPD_EQUIPO_TRABAJADOR(Convert.ToInt32(btnEliminar.CommandArgument), 0); equipo(); }
protected void btnEliminar_Click(object sender, EventArgs e) { BL_EQUIPO_TRABAJO obj = new BL_EQUIPO_TRABAJO(); DataTable dtResultado = new DataTable(); string cleanMessage = string.Empty; int intContador = 0; if (GridView1.Rows.Count == 0) { cleanMessage = "No existe Registros"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } foreach (GridViewRow Fila in GridView1.Rows) { CheckBox ChkBoxCell = ((CheckBox)Fila.FindControl("chkSelect")); if (ChkBoxCell.Checked == true) { intContador += 1; } } if (intContador == 0) { cleanMessage = "Debe seleccionar al menos un registro."; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } int Cod; foreach (GridViewRow row in GridView1.Rows) { CheckBox ChkBoxCell = ((CheckBox)row.FindControl("chkSelect")); if (ChkBoxCell.Checked) { Cod = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Values[0].ToString()); // extrae key dtResultado = obj.uspUPD_EQUIPO_TRABAJADOR(Cod, 0); } ChkBoxCell = null; } equipo(); }
protected void VerificarCC_asignado() { BL_EQUIPO_TRABAJO obj = new BL_EQUIPO_TRABAJO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_EQUIPO_TRABAJO_DNI(Session["IDE_USUARIO"].ToString()); if (dtResultado.Rows.Count > 0) { lblCentro.Text = dtResultado.Rows[0]["CC_SUPERVISOR"].ToString(); } else { lblCentro.Text = BL_Session.CENTRO_COSTO; } }
protected void equipo() { BL_EQUIPO_TRABAJO obj = new BL_EQUIPO_TRABAJO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_EQUIPO_TRABAJO_SUPERVISOR(Convert.ToInt32(Session["IDE_RESPONSABLE"].ToString())); if (dtResultado.Rows.Count > 0) { GridView1.Visible = true; GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { GridView1.Visible = false; GridView1.DataSource = dtResultado; GridView1.DataBind(); } }
private void cargarEmpleados() { DataTable dtResultado = new DataTable(); //BL_OPE_MINUTA obj = new BL_OPE_MINUTA(); //dtResultado = obj.uspSEL_RRHH_PERSONAL_POR_CENTRO(BL_Session.CENTRO_COSTO); BL_EQUIPO_TRABAJO obj = new BL_EQUIPO_TRABAJO(); dtResultado = obj.uspSEL_EQUIPO_TRABAJO_SUPERVISOR_DNI(Session["IDE_USUARIO"].ToString()); if (dtResultado.Rows.Count > 0) { ddlPersonalAcargo.DataSource = dtResultado; ddlPersonalAcargo.DataTextField = dtResultado.Columns["NOMBRE_COMPLETO"].ToString(); ddlPersonalAcargo.DataValueField = dtResultado.Columns["DNI_TRABAJADOR"].ToString(); ddlPersonalAcargo.DataBind(); } else { ddlPersonalAcargo.Items.Insert(0, new ListItem("--- Seleccionar personal ---", "")); } }
protected void Registrar() { string cleanMessage = string.Empty; BE_EQUIPO_TRABAJO oBESol = new BE_EQUIPO_TRABAJO(); oBESol.IDE_EQUIPO = 0; oBESol.FLG_ESTADO = 1; oBESol.USER_REGISTRA = Session["IDE_USUARIO"].ToString(); oBESol.IDE_RESPONSABLE = Convert.ToInt32(Session["IDE_RESPONSABLE"].ToString()); oBESol.FLG_ESTADO = 1; oBESol.DNI_TRABAJADOR = ddlPersonal.SelectedValue.ToString(); int dtrpta = 0; dtrpta = new BL_EQUIPO_TRABAJO().uspINS_EQUIPO_TRABAJO(oBESol); if (dtrpta > 0) { ddlPersonal.Text = string.Empty; cleanMessage = "Registro exitoso"; equipo(); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }