예제 #1
0
        private void LlenarGridView()
        {
            int IdEmpresa  = Mgr_Empresa.Set_IdEmpresa(ObjUsuario, Convert.ToInt32(ViewState["empresa"]));
            int IdSucursal = Mgr_Sucursal.Set_IdSucursal(ObjUsuario, Convert.ToInt32(ViewState["sucursal"]));

            Mgr_Alarma.Grid_Alarma(
                GridView1,
                string.Empty + ViewState["prioridad"],
                string.Empty + ViewState["categorias"],
                string.Empty + ViewState["FechaInicio"],
                string.Empty + ViewState["FechaFin"],
                string.Empty + ViewState["search"],
                IdEmpresa,
                IdSucursal);
        }
예제 #2
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);
            }
        }