Example #1
0
        protected void gvEmpleados_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Quitar")
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow gvr   = gvEmpleados.Rows[index];
                AccesoLogica.EliminaEmpleado(Convert.ToInt32(gvr.Cells[4].Text));
                RecargaTabla();
            }
            else if (e.CommandName == "Actualizar")
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow gvr   = gvEmpleados.Rows[index];

                Response.Redirect("ActualizarEmpleado.aspx?Nombre=" +
                                  Server.UrlEncode(gvr.Cells[5].Text) +
                                  "&Apellidos=" + Server.UrlEncode(gvr.Cells[6].Text) +
                                  "&Telefono=" + Server.UrlEncode(gvr.Cells[7].Text) +
                                  "&Direccion=" + Server.UrlEncode(gvr.Cells[8].Text) +
                                  "&FechaIngreso=" + Server.UrlEncode(gvr.Cells[9].Text) +
                                  "&SueldoBase=" + Server.UrlEncode(gvr.Cells[10].Text) +
                                  "&idDepartamento=" + Server.UrlEncode(gvr.Cells[11].Text) +
                                  "&idEmpleado=" + Server.UrlEncode(gvr.Cells[4].Text));
            }
            else if (e.CommandName == "Tabulador")
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow gvr   = gvEmpleados.Rows[index];

                Response.Redirect("Tabulador.aspx?Nombre=" +
                                  Server.UrlEncode(gvr.Cells[5].Text) +
                                  "&Apellidos=" + Server.UrlEncode(gvr.Cells[6].Text) +
                                  "&Telefono=" + Server.UrlEncode(gvr.Cells[7].Text) +
                                  "&Direccion=" + Server.UrlEncode(gvr.Cells[8].Text) +
                                  "&FechaIngreso=" + Server.UrlEncode(gvr.Cells[9].Text) +
                                  "&SueldoBase=" + Server.UrlEncode(gvr.Cells[10].Text) +
                                  "&idDepartamento=" + Server.UrlEncode(gvr.Cells[11].Text) +
                                  "&idEmpleado=" + Server.UrlEncode(gvr.Cells[4].Text));
            }
            else if (e.CommandName == "Pagar")
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow gvr   = gvEmpleados.Rows[index];

                Response.Redirect("Nomina.aspx?Nombre=" +
                                  Server.UrlEncode(gvr.Cells[5].Text) +
                                  "&Apellidos=" + Server.UrlEncode(gvr.Cells[6].Text) +
                                  "&Telefono=" + Server.UrlEncode(gvr.Cells[7].Text) +
                                  "&Direccion=" + Server.UrlEncode(gvr.Cells[8].Text) +
                                  "&FechaIngreso=" + Server.UrlEncode(gvr.Cells[9].Text) +
                                  "&SueldoBase=" + Server.UrlEncode(gvr.Cells[10].Text) +
                                  "&idDepartamento=" + Server.UrlEncode(gvr.Cells[11].Text) +
                                  "&idEmpleado=" + Server.UrlEncode(gvr.Cells[4].Text));
            }
        }