protected void btnNuevo_Click(object sender, EventArgs e) { MarcarTodosPermisos(); lblValidar.Text = string.Empty; ViewState["Accion"] = "Guardar"; LimpiarCampos(); DesbloquearCampos(); btnCerrar.Visible = false; btnCancelar.Visible = true; btnGuardar.Visible = true; btnEditar.Visible = false; lblTituloModal.Text = "Registro del Acceso"; btnGuardar.Text = "<i class=" + "material-icons>" + "check </i> Guardar"; listPermisosPrincipal.Clear(); listDenegarPermisos.Clear(); permisosServices.CargarModulosPermisos(Guid.Parse("17BB8F08-9D5F-425C-9B9B-1CA230C07C7F")); foreach (var item in permisosServices.lsModulosPermisos) { listPermisosPrincipal.Add(item.UidPermiso.ToString()); } foreach (ListItem item in cblPermisosPrincipal.Items) { item.Selected = true; } foreach (ListItem item in cblPermisosFranquicias.Items) { item.Selected = true; } ScriptManager.RegisterStartupScript(this, this.GetType(), "FormScript", "showModal()", true); }
private void ManejoDatos(Guid dataKeys) { listPermisosPrincipal.Clear(); listDenegarPermisos.Clear(); //==================FRANQUICIATARIO============================ perfilesServices.ObtenerPerfil(dataKeys); txtNombre.Text = perfilesServices.perfilesRepository.perfilesGridViewModel.VchNombre; ddlTipoPerfil.SelectedIndex = ddlTipoPerfil.Items.IndexOf(ddlTipoPerfil.Items.FindByValue(perfilesServices.perfilesRepository.perfilesGridViewModel.UidTipoPerfilFranquicia.ToString())); ddlTipoPerfil_SelectedIndexChanged(null, null); ddlModuloInicial.SelectedIndex = ddlModuloInicial.Items.IndexOf(ddlModuloInicial.Items.FindByValue(perfilesServices.perfilesRepository.perfilesGridViewModel.UidModuloInicial.ToString())); ddlEstatus.SelectedIndex = ddlEstatus.Items.IndexOf(ddlEstatus.Items.FindByValue(perfilesServices.perfilesRepository.perfilesGridViewModel.UidEstatus.ToString())); //==================PermisosAccesos============================ DesmarcarTodosPermisos(); permisosServices.CargarModulosPermisos(Guid.Parse("ED9F4B98-EA8F-4D8F-8248-6BA42EC87B4E")); /*REVISAR*/ permisosServices.CargarAccesosModulosPermisos(dataKeys); foreach (var item in permisosServices.lsAccesosModulosPermisos) { listPermisosPrincipal.Add(item.UidPermiso.ToString()); } foreach (ListItem item in cblPermisosFranquicias.Items) { for (int i = 0; i < listPermisosPrincipal.Count; i++) { if (item.Value == listPermisosPrincipal[i]) { item.Selected = true; } } } }