Пример #1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfHorarioIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfHorarioID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                var _Horario = Mgr_Horario.Get_Horario(Convert.ToInt32(hdfHorarioID.Value));

                txtNombreEdit.Text   = _Horario.nombre;
                txtFechaIniEdit.Text = _Horario.fecha_inicio;
                txtFechaFinEdit.Text = _Horario.fecha_fin;

                Modal.registrarModal("editModal", "EditModalScript", this);
            }
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Consultar.Value))
            {
                string id_EvaRiesgo = Utilidades_GridView.DevolverIdRow(e, GridView1);

                id_EvaRiesgo = objUtilidades.cifrarCadena(id_EvaRiesgo);

                Response.Redirect(Paginas.View_EvaluacionPuesto.Value + "?id=" + id_EvaRiesgo);
            }
            else if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Imprimir.Value))
            {
                hImprimir.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                ViewState["Imprimir"] = string.Empty + hImprimir.Value;

                Modal.registrarModal("PrintListaModal", "PrintListaModalScript", this);
            }
        }
Пример #3
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                string      idPuesto = Utilidades_GridView.DevolverIdRow(e, GridView1);

                idPuesto = objUtilidades.cifrarCadena(Convert.ToString(idPuesto));
                Response.Redirect(Paginas.Update_PuestoTrabajo.Value + "?id=" + idPuesto);
            }
            else if (e.CommandName.Equals(ComandosGrid.Consultar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                string      idPuesto = Utilidades_GridView.DevolverIdRow(e, GridView1);

                idPuesto = objUtilidades.cifrarCadena(Convert.ToString(idPuesto));
                Response.Redirect(Paginas.View_PuestoTrabajo.Value + "?id=" + idPuesto);
            }
            else if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
Пример #4
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfEditID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                var _Categoria = Mgr_Categoria.Get_Categoria(Convert.ToInt32(hdfEditID.Value));

                txtNombreEdit.Text           = _Categoria.nombre;
                txtDescripcionEdit.Text      = _Categoria.descripcion;
                ddlEmpresaEdit.SelectedValue = Convert.ToString(_Categoria.id_empresa);

                Modal.registrarModal("editModal", "EditModalScript", this);
            }
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
Пример #5
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfIDEppDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfIdEppEdit.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                txtNombreEdit.Text           = (gvrow.FindControl("nombre") as Label).Text;
                txtNombreSenalEdit.Text      = (gvrow.FindControl("nombre_senal") as Label).Text;
                imgSenal.ImageUrl            = (gvrow.FindControl("url_senal") as Label).Text;
                ddlEmpresaEdit.SelectedValue = (gvrow.FindControl("id_empresa") as Label).Text;
                Modal.registrarModal("editModal", "EditModalScript", this);
            }
            else if (e.CommandName.Equals("verImagen"))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];

                imgVer.ImageUrl = (gvrow.FindControl("url_senal") as Label).Text;
                Modal.registrarModal("verImagen", "ViewModalScript", this);
            }
        }
Пример #6
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Consultar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfIdTrabajadorView.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                ConsultarTrabajador(hdfIdTrabajadorView.Value);
                Modal.registrarModal("viewModal", "ViewModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex     = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow        = GridView1.Rows[RowIndex];
                string      TrabajadorID = Utilidades_GridView.DevolverIdRow(e, GridView1);

                TrabajadorID = objUtilidades.cifrarCadena(Convert.ToString(TrabajadorID));
                Response.Redirect(Paginas.Update_Trabajador.Value + "?id=" + TrabajadorID);
            }
            else if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfTrabajadorIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.AddReposo.Value))
            {
                hdfTrabajadorEstID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                Modal.registrarModal("agregarReposo", "EstatusModalScript", this);
            }
        }
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
     {
         hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
         Modal.registrarModal("deleteModal", "DeleteModalScript", this);
     }
 }
 protected void GridView4_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("verDetalle"))
     {
         string id    = Utilidades_GridView.DevolverIdRow(e, GridView1);
         string _open = "window.open('../IncidentesLaborales/ConsultarIncidente.aspx?id=" + id + "', '_blank');";
         ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), _open, true);
     }
 }
Пример #9
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];

                hdfEditID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                List <plan_trabajo> ListaPlanTrabajo = new List <plan_trabajo>();
                ListaPlanTrabajo = Mgr_PlanTrabajo.Get_Plan_Trabajo(0, 0, Convert.ToInt32(hdfEditID.Value));

                foreach (var item in ListaPlanTrabajo)
                {
                    txtActividadEdit.Text = item.nombre;

                    txtObjetivosEdit.Text = item.objetivos;

                    ddlEmpresaEdit.SelectedValue = Convert.ToString(item.usuario.trabajador.puesto_trabajo.area.sucursal.id_empresa);

                    Mgr_Sucursal.Lista_Sucursal(ddlSucursalEdit, Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.sucursal.id_empresa));
                    ddlSucursalEdit.SelectedValue = Convert.ToString(item.usuario.trabajador.puesto_trabajo.area.id_sucursal);

                    string formatoIni = DateTime.Now.Year + "-W";
                    string formatoFin = DateTime.Now.Year + "-W";

                    if (item.semana_ini < 10)
                    {
                        formatoIni = DateTime.Now.Year + "-W0";
                    }
                    if (item.semana_fin < 10)
                    {
                        formatoFin = DateTime.Now.Year + "-W0";
                    }

                    TxtSemanaIniEdit.Text = formatoIni + Convert.ToString(item.semana_ini);
                    TxtSemanaFinEdit.Text = formatoFin + Convert.ToString(item.semana_fin);

                    txtRecursosEdit.Text = Convert.ToString(item.recursos_aprobados);

                    Mgr_Usuario.Lista_UsuarioBySucursal(ddlResponsableEdit, Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.id_sucursal));
                    ddlResponsableEdit.SelectedValue = Convert.ToString(item.id_responsable);
                }

                Modal.registrarModal("editModal", "EditModalScript", this);
                LlenarGridView();
            }
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];

                hdfIDDel.Value = (gvrow.FindControl("id_plan_trabajo") as Label).Text;
                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
Пример #10
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfExtintorIDEdit.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);


                List <extintor> ListaExtintor = new List <extintor>();
                ListaExtintor = Mgr_Area.Get_Extintor(Convert.ToInt32(hdfExtintorIDEdit.Value));

                foreach (var item in ListaExtintor)
                {
                    int IdEmpresa  = Convert.ToInt32(item.area.sucursal.id_empresa);
                    int IdSucursal = Convert.ToInt32(item.area.sucursal.id_sucursal);

                    Mgr_Empresa.Lista_Empresa(ddlEmpresaEdit);
                    ddlEmpresaEdit.SelectedValue = string.Empty + IdEmpresa;

                    Mgr_Sucursal.Lista_Sucursal(ddlSucursalEdit, IdEmpresa);
                    ddlSucursalEdit.SelectedValue = string.Empty + IdSucursal;

                    Mgr_Area.List_Area_Sucursal(ddlAreasEdit, IdSucursal);
                    ddlAreasEdit.SelectedValue = string.Empty + item.id_area;

                    txtSerialEdit.Text = item.serial_extintor.ToString();

                    string   fecha1 = item.fecha_ultima_recarga.ToString();
                    DateTime date1  = Convert.ToDateTime(fecha1).Date;
                    txtFechaUltRecEdit.Text = date1.ToString("yyyy-MM-dd");

                    fecha1 = item.fecha_proxima_recarga.ToString();
                    date1  = Convert.ToDateTime(fecha1).Date;
                    txtFechaProxRecEdit.Text = date1.ToString("yyyy-MM-dd");

                    txtPesoEdit.Text          = item.peso;
                    txtPresionEdit.Text       = item.presion;
                    txtNombreEmpresaEdit.Text = item.nombre_empresa;

                    ddlTipoExtEdit.SelectedValue = item.tipo_extintor;
                }

                Modal.registrarModal("editModal", "EditModalScript", this);
            }
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfExtintorIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Consultar.Value))
            {
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                hdfIDDel.Value = objUtilidades.cifrarCadena(Convert.ToString(hdfIDDel.Value));

                Response.Redirect(Paginas.View_Accidente.Value + "?id=" + hdfIDDel.Value);
            }
            else if (e.CommandName.Equals(ComandosGrid.Imprimir.Value))
            {
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                hdfIDDel.Value = objUtilidades.cifrarCadena(Convert.ToString(hdfIDDel.Value));
                Response.Redirect(Paginas.View_Accidente.Value + "?id=" + hdfIDDel.Value + "&Print=si");
            }
            else if (e.CommandName.Equals(ComandosGrid.Comunicado.Value))
            {
                hImprimir.Value       = Utilidades_GridView.DevolverIdRow(e, GridView1);
                ViewState["Imprimir"] = string.Empty + hImprimir.Value;
                Modal.registrarModal("PrintListaModal", "PrintListaModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Upload.Value))
            {
                hdfIDEsc.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                Modal.registrarModal("EscaneadoModal", "EscaneadoModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Scan.Value))
            {
                int RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                hplComunicado.NavigateUrl = (GridView1.Rows[RowIndex].FindControl("lbComunicado") as Label).Text;
                hplReporte.NavigateUrl    = (GridView1.Rows[RowIndex].FindControl("lbreporte_accidente") as Label).Text;

                Modal.registrarModal("VerDocModal", "VerDocModalModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.ConsultaMedica.Value))
            {
                hdfAsigCon.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                cargarValoresIniciales();
                Modal.registrarModal("AsigConModal", "AsigConModalModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                string id = Utilidades_GridView.DevolverIdRow(e, GridView1);
                id = objUtilidades.cifrarCadena(id);
                Response.Redirect(Paginas.Update_Accidentes.Value + "?id=" + id);
            }
        }
Пример #12
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfUsuarioID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                List <usuario> ListaUsuarios = new List <usuario>();
                ListaUsuarios = Mgr_Usuario.Get_Usuario(Convert.ToInt32(hdfUsuarioID.Value));

                foreach (var itemUsuarios in ListaUsuarios)
                {
                    ViewState["txtLogin"]        = string.Empty + itemUsuarios.login;
                    txtLoginEdit.Text            = itemUsuarios.login;
                    ddlRolEdit.SelectedValue     = Convert.ToString(itemUsuarios.id_rol);
                    ddlEmpresaEdit.SelectedValue = Convert.ToString(itemUsuarios.trabajador.puesto_trabajo.area.sucursal.id_empresa);
                    string claveA = objUtilidades.descifrarCadena2(itemUsuarios.clave);

                    txtClaveActual.Attributes["value"] = claveA;
                    txtClaveConf.Attributes["value"]   = claveA;
                    Mgr_Sucursal.Lista_Sucursal(ddlSucursalEdit, Convert.ToInt32(ddlEmpresaEdit.SelectedValue));
                    ddlSucursalEdit.SelectedValue = Convert.ToString(itemUsuarios.trabajador.puesto_trabajo.area.id_sucursal);

                    IdSucursalEsp = Convert.ToInt32(ddlSucursalEdit.SelectedValue);
                    Mgr_Trabajador.Lista_Trabajadores_Sucursal(ddlTrabajadorEsp, IdSucursalEsp);
                    IdTrabajadorEsp = Convert.ToInt32(itemUsuarios.id_trabajador);
                    ddlTrabajadorEsp.SelectedValue = IdTrabajadorEsp.ToString();
                }

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append("$('#txtClaveActual').hidePassword(true);");
                sb.Append("$('#txtClaveEdit').hidePassword(true);");
                sb.Append("$('#txtClaveEditConf').hidePassword(true);");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "claveActual", sb.ToString(), false);

                Modal.registrarModal("editModal", "EditModalScript", this);
            }
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfUsuarioIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
Пример #13
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];

                hdfAreaID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                phSeleccion.Visible = false;
                Mgr_Empresa.Lista_Empresa(ddlEmpresaEdit);

                List <area> ListaArea = new List <area>();
                ListaArea = Mgr_Area.Get_Area(0, Convert.ToInt32(hdfAreaID.Value), "");

                foreach (var item in ListaArea)
                {
                    ddlEmpresaEdit.SelectedValue = Convert.ToString(item.sucursal.id_empresa);
                    txtNombreEdit.Text           = item.nombre;

                    Mgr_Sucursal.Lista_Sucursal(ddlSucursalEdit, Convert.ToInt32(item.sucursal.id_empresa));
                    ddlSucursalEdit.SelectedValue = Convert.ToString(item.id_sucursal);

                    string areaSuperior = (gvrow.FindControl("nombreSup") as Label).Text;

                    if (areaSuperior != "Ninguno")
                    {
                        Mgr_Area.List_Area_Sucursal(ddlAreasEdit, Convert.ToInt32(ddlSucursalEdit.SelectedValue));
                        ddlAreasEdit.SelectedValue = Convert.ToString(item.id_area_padre);
                        phSeleccion.Visible        = true;
                    }
                    else
                    {
                        phAreasEditChk.Visible = true;
                    }

                    ddlTipoAreaEdit.SelectedValue = item.tipo;
                }

                Modal.registrarModal("editModal", "EditModalScript", this);
            }
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                hdfAreaIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
Пример #14
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            if (e.CommandName.Equals("soporte"))
            {
                hdSoporte.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                int contadorArchivos = 0;

                List <soporte> ListSopRec = new List <soporte>();
                ListSopRec = Mgr_Documento.Get_Soporte(Convert.ToInt32(hdSoporte.Value), "RecursosEconomicos");

                ControlesDinamicos.CrearLiteral("<ul class='list-group'>", pAnexo);

                HyperLink HyperLink1;
                foreach (var item1 in ListSopRec)
                {
                    contadorArchivos++;
                    if (contadorArchivos % 2 == 0)
                    {
                        ControlesDinamicos.CrearLiteral("<li class='list-group-item'>", pAnexo);
                    }
                    else
                    {
                        ControlesDinamicos.CrearLiteral("<li class='list-group-item list-group-item-info'>", pAnexo);
                    }
                    HyperLink1             = new HyperLink();
                    HyperLink1.NavigateUrl = item1.url;
                    HyperLink1.Target      = "_blank";
                    HyperLink1.Text        = "Ver Archivo " + contadorArchivos;
                    pAnexo.Controls.Add(HyperLink1);
                    ControlesDinamicos.CrearLiteral("</ li >", pAnexo);
                }
                ControlesDinamicos.CrearLiteral("</ ul > ", pAnexo);

                Modal.registrarModal("soporteModal", "SoporteModalScript", this);
            }
        }
Пример #15
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];

                string idPerfil = Utilidades_GridView.DevolverIdRow(e, GridView1);
                idPerfil = objUtilidades.cifrarCadena(Convert.ToString(idPerfil));
                Response.Redirect("Update_PerfilCargo.aspx?id=" + idPerfil);
            }
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];

                hdfIDDel.Value = (gvrow.FindControl("id") as Label).Text;
                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
Пример #16
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                hdfEditID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                List <alarma> ListaAlarma = new List <alarma>();
                ListaAlarma = Mgr_Alarma.Get_Alarma(Convert.ToInt32(hdfEditID.Value));
                int IDUsuario   = 0;
                int IDEmpresa   = 0;
                int IDSucursal  = 0;
                int IDCategoria = 0;

                foreach (var item in ListaAlarma)
                {
                    IDUsuario                      = Convert.ToInt32(item.id_usuario);
                    IDEmpresa                      = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.sucursal.id_empresa);
                    IDSucursal                     = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.id_sucursal);
                    IDCategoria                    = Convert.ToInt32(item.id_categorias);
                    txtDescripcionEdit.Text        = item.descripcion;
                    ddlPrioridadEdit.SelectedValue = item.prioridad;
                    txtFechaEdit.Text              = item.fecha.Value.ToString("yyyy-MM-dd");
                }
                Capa_Datos.Manager.Usuario.Mgr_Usuario.Lista_UsuarioBySucursal(ddlUsuEdit, IDSucursal);
                Mgr_Categoria.List_Categorias(ddlCategoriaEdit, IDEmpresa);
                ddlEmpEdit.SelectedValue       = IDEmpresa.ToString();
                ddlSucEdit.SelectedValue       = IDSucursal.ToString();
                ddlCategoriaEdit.SelectedValue = IDCategoria.ToString();
                ddlUsuEdit.SelectedValue       = IDUsuario.ToString();

                Modal.registrarModal("editModal", "EditModalScript", this);
            }
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
Пример #17
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                string id_trabajador = Utilidades_GridView.DevolverIdRow(e, GridView1);

                id_trabajador = objUtilidades.cifrarCadena(Convert.ToString(id_trabajador));
                Response.Redirect(Paginas.Update_DescripcionSocioDemografica.Value + "?id=" + id_trabajador);
            }
            if (e.CommandName.Equals(ComandosGrid.Consultar.Value))
            {
                string id_trabajador = Utilidades_GridView.DevolverIdRow(e, GridView1);
                id_trabajador = objUtilidades.cifrarCadena(Convert.ToString(id_trabajador));

                Response.Redirect(Paginas.View_DescripcionSocioDemografica.Value + "?id=" + id_trabajador);
            }
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                hdfPerfilIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
        }
Пример #18
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfSucursalEditID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);


                List <sucursal> ListaSucursal = new List <sucursal>();
                ListaSucursal = Mgr_Sucursal.Get_Sucursal(Convert.ToInt32(hdfSucursalEditID.Value), 0, "");

                foreach (var item in ListaSucursal)
                {
                    txtNombreEdit.Text           = item.nombre;
                    txtDireccionEdit.Text        = item.direccion;
                    txtFijoEdit.Text             = item.fijo;
                    txtMovilEdit.Text            = item.movil;
                    txtRepresentanteEdit.Text    = item.representante;
                    ddlEmpresaEdit.SelectedValue = Convert.ToString(item.id_empresa);

                    ddlRegionEdit.SelectedValue = Convert.ToString(item.municipio.departamento.id_region);

                    Mgr_Gobierno.Get_Reg_Dpto_Mcpio(ddlDptoEdit, "RegionDpto", Convert.ToInt32(item.municipio.departamento.id_region));
                    ddlDptoEdit.SelectedValue = Convert.ToString(item.municipio.id_departamento);

                    Mgr_Gobierno.Get_Reg_Dpto_Mcpio(ddlMcpioEdit, "McpioDpto", Convert.ToInt32(item.municipio.id_departamento));
                    ddlMcpioEdit.SelectedValue = Convert.ToString(item.id_municpio);
                }
                Modal.registrarModal("editModal", "EditModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfSucursalIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Consultar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfSucursalID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                List <sucursal> ListaSucursal = new List <sucursal>();
                ListaSucursal = Mgr_Sucursal.Get_Sucursal(Convert.ToInt32(hdfSucursalID.Value), 0, "");
                foreach (var item in ListaSucursal)
                {
                    lblNombreView.Text   = item.nombre;
                    lbRegionView.Text    = item.municipio.departamento.Region.nombre;
                    lbDptoView.Text      = item.municipio.departamento.nombre;
                    lbMcpioView.Text     = item.municipio.nombre;
                    lbDireccionView.Text = item.direccion;
                    lblRepreView.Text    = item.representante;
                    lblFijoView.Text     = item.fijo;
                    lblMovilView.Text    = item.movil;
                }
                Modal.registrarModal("viewModal", "ViewModalScript", this);
            }
        }
Пример #19
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                string      tipo     = (gvrow.FindControl("tipo") as Label).Text;

                foreach (ListItem item in chkTrabajadores.Items)
                {
                    item.Selected = false;
                }

                if (tipo == "1")
                {
                    hdfEditEntregaID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                    List <gestion_laboral> EditCapacitacion = new List <gestion_laboral>();
                    EditCapacitacion = Mgr_GestionLaboral.Get_GestionLaboral(Convert.ToInt32(hdfEditEntregaID.Value));

                    foreach (var item in EditCapacitacion)
                    {
                        int idEmpresa  = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.sucursal.id_empresa);
                        int idSucursal = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.id_sucursal);
                        int idUsuario  = Convert.ToInt32(item.id_usuario);
                        ddlEmpEditEnt.SelectedValue = idEmpresa.ToString();

                        Mgr_Sucursal.Lista_Sucursal(ddlSucEditEnt, idEmpresa);
                        ddlSucEditEnt.SelectedValue = idSucursal.ToString();

                        chkTrabajadores.Items.Clear();
                        Cargartrabajadores(idSucursal);
                        Mgr_Usuario.Lista_UsuarioBySucursal(ddlUsuEditEnt, idSucursal);
                        ddlUsuEditEnt.SelectedValue = idUsuario.ToString();

                        DateTime fechaGestion = Convert.ToDateTime(Convert.ToString(item.fecha));
                        txtFechaEditEntrega.Text = fechaGestion.ToString("yyyy-MM-dd");

                        txtDescEditEntrega.Text = item.descripcion;

                        List <trabajador_gestion> _listatrab = Mgr_Trabajador.Get_TrabajadorInGestion(0, Convert.ToInt32(hdfEditEntregaID.Value));

                        foreach (var trab in _listatrab)
                        {
                            if (chkTrabajadores.Items.FindByValue(trab.id_trabajador.ToString()) != null)
                            {
                                chkTrabajadores.Items.FindByValue(trab.id_trabajador.ToString()).Selected = true;
                            }
                        }
                    }

                    Modal.registrarModal("EditEntrega", "EditModalScript", this);
                }
                else if (tipo == "3")
                {
                    hdfEditJornadaID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                    List <gestion_laboral> EditJornada = new List <gestion_laboral>();
                    EditJornada = Mgr_GestionLaboral.Get_GestionLaboral(Convert.ToInt32(hdfEditJornadaID.Value));

                    foreach (var item in EditJornada)
                    {
                        int idEmpresa  = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.sucursal.id_empresa);
                        int idSucursal = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.id_sucursal);
                        int idUsuario  = Convert.ToInt32(item.id_usuario);
                        ddlEmpEditJor.SelectedValue = idEmpresa.ToString();

                        Mgr_Sucursal.Lista_Sucursal(ddlSucEditJor, idEmpresa);
                        ddlSucEditJor.SelectedValue = idSucursal.ToString();

                        chkTrabajadores.Items.Clear();
                        Cargartrabajadores(idSucursal);
                        Mgr_Usuario.Lista_UsuarioBySucursal(ddlUsuEditJor, idSucursal);
                        ddlUsuEditJor.SelectedValue = idUsuario.ToString();

                        DateTime fechaGestion = Convert.ToDateTime(Convert.ToString(item.fecha));
                        txtFechaEditJornada.Text = fechaGestion.ToString("yyyy-MM-dd");

                        txtDescEditJornada.Text = item.descripcion;

                        List <trabajador_gestion> _listatrab = Mgr_Trabajador.Get_TrabajadorInGestion(0, Convert.ToInt32(hdfEditJornadaID.Value));

                        foreach (var trab in _listatrab)
                        {
                            if (chkTrabajadores.Items.FindByValue(trab.id_trabajador.ToString()) != null)
                            {
                                chkTrabajadores.Items.FindByValue(trab.id_trabajador.ToString()).Selected = true;
                            }
                        }
                    }

                    Modal.registrarModal("EditJornada", "EditModalScript", this);
                }
                else if (tipo == "4")
                {
                    hdfEditActividadID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                    List <gestion_laboral> EditActividad = new List <gestion_laboral>();
                    EditActividad = Mgr_GestionLaboral.Get_GestionLaboral(Convert.ToInt32(hdfEditActividadID.Value));

                    foreach (var item in EditActividad)
                    {
                        int idEmpresa  = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.sucursal.id_empresa);
                        int idSucursal = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.id_sucursal);
                        int idUsuario  = Convert.ToInt32(item.id_usuario);
                        ddlEmpEditAct.SelectedValue = idEmpresa.ToString();

                        Mgr_Sucursal.Lista_Sucursal(ddlSucEditAct, idEmpresa);
                        ddlSucEditAct.SelectedValue = idSucursal.ToString();

                        chkTrabajadores.Items.Clear();
                        Cargartrabajadores(idSucursal);
                        Mgr_Usuario.Lista_UsuarioBySucursal(ddlUsuEditAct, idSucursal);
                        ddlUsuEditAct.SelectedValue = idUsuario.ToString();

                        DateTime fechaGestion = Convert.ToDateTime(Convert.ToString(item.fecha));
                        txtFechaEditActividad.Text = fechaGestion.ToString("yyyy-MM-dd");

                        txtDescEditActividad.Text = item.descripcion;

                        List <trabajador_gestion> _listatrab = Mgr_Trabajador.Get_TrabajadorInGestion(0, Convert.ToInt32(hdfEditActividadID.Value));

                        foreach (var trab in _listatrab)
                        {
                            if (chkTrabajadores.Items.FindByValue(trab.id_trabajador.ToString()) != null)
                            {
                                chkTrabajadores.Items.FindByValue(trab.id_trabajador.ToString()).Selected = true;
                            }
                        }
                    }
                    Modal.registrarModal("EditActividad", "EditModalScript", this);
                }
                else if (tipo == "2")
                {
                    hdfEditCapacitacionID.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                    Modal.registrarModal("EditCapacitacion", "EditModalScript", this);


                    List <gestion_laboral> EditCapacitacion = new List <gestion_laboral>();
                    EditCapacitacion = Mgr_GestionLaboral.Get_GestionLaboral(Convert.ToInt32(hdfEditCapacitacionID.Value));

                    foreach (var item in EditCapacitacion)
                    {
                        int idEmpresa  = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.sucursal.id_empresa);
                        int idSucursal = Convert.ToInt32(item.usuario.trabajador.puesto_trabajo.area.id_sucursal);
                        int idUsuario  = Convert.ToInt32(item.id_usuario);
                        ddlEmpEditCap.SelectedValue = idEmpresa.ToString();

                        Mgr_Sucursal.Lista_Sucursal(ddlSucEditCap, idEmpresa);
                        ddlSucEditCap.SelectedValue = idSucursal.ToString();

                        chkTrabajadores.Items.Clear();
                        Cargartrabajadores(idSucursal);
                        Mgr_Usuario.Lista_UsuarioBySucursal(ddlUsuEditCap, idSucursal);
                        ddlUsuEditCap.SelectedValue = idUsuario.ToString();

                        DateTime fechaGestion = Convert.ToDateTime(Convert.ToString(item.fecha));
                        txtFechaEditCapacitacion.Text = fechaGestion.ToString("yyyy-MM-dd");

                        txtDesCapEdit.Text            = item.descripcion;
                        txtObjCapEdit.Text            = item.objetivos;
                        txtHorasEditCapacitacion.Text = item.cant_horas.ToString();

                        List <trabajador_gestion> _listatrab = Mgr_Trabajador.Get_TrabajadorInGestion(0, Convert.ToInt32(hdfEditCapacitacionID.Value));

                        foreach (var trab in _listatrab)
                        {
                            if (chkTrabajadores.Items.FindByValue(trab.id_trabajador.ToString()) != null)
                            {
                                chkTrabajadores.Items.FindByValue(trab.id_trabajador.ToString()).Selected = true;
                            }
                        }
                    }
                }
            }
            else if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Asistencia.Value))
            {
                string idGestion = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Response.Redirect(Paginas.Update_AsistenciaCapacitacion.Value + "?id=" + objUtilidades.cifrarCadena(idGestion));
            }
            else if (e.CommandName.Equals(ComandosGrid.Upload.Value))
            {
                hdfIDEsc.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                Modal.registrarModal("EscaneadoModal", "EscaneadoModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Imprimir.Value))
            {
                hImprimir.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                ViewState["Imprimir"] = string.Empty + hImprimir.Value;

                Modal.registrarModal("PrintListaModal", "PrintListaModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Consultar.Value))
            {
                hdfIDDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                hdfIDDel.Value = objUtilidades.cifrarCadena(Convert.ToString(hdfIDDel.Value));
                Response.Redirect(Paginas.View_GestionLaboral.Value + "?id=" + hdfIDDel.Value);
            }
        }