Exemple #1
0
        public AltaRol()
        {
            InitializeComponent();

            var materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme       = MaterialSkinManager.Themes.LIGHT;
            materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);


            DataGridViewCheckBoxColumn check_funcionalidad = new DataGridViewCheckBoxColumn();

            tabla_funcionalidades.Columns.Add("Nombre");
            tabla_funcionalidades.Columns.Add("Descripcion");
            data_listado_funcionalidades.Columns.Add(check_funcionalidad);
            List <Funcionalidad> funcionalidades = FuncionalidadesRepositorio.getFuncionalidades();

            foreach (Funcionalidad funcionalidad in funcionalidades)
            {
                String[] row = new String[] { funcionalidad.nombre, funcionalidad.detalle };
                tabla_funcionalidades.Rows.Add(row);
            }
            data_listado_funcionalidades.DataSource = tabla_funcionalidades;
        }
        public AltaRol()
        {
            InitializeComponent();

            var materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme       = MaterialSkinManager.Themes.LIGHT;
            materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
            this.funcionalidades            = FuncionalidadesRepositorio.getFuncionalidades();
            llenarLabels();
        }
Exemple #3
0
        public ModificacionRol(Rol seleccionado)
        {
            InitializeComponent();
            this.rol = seleccionado;
            var materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme       = MaterialSkinManager.Themes.LIGHT;
            materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
            this.funcionalidades            = FuncionalidadesRepositorio.getFuncionalidades();
            llenarLabels();
            llenarChecks();
            tx_nombre_rol.Text      = seleccionado.nombre;
            checkHabilitado.Checked = seleccionado.Habilitado;
        }
Exemple #4
0
        private void llenarChecks()
        {
            var checkboxs = group_alta_rol.Controls.OfType <CheckBox>();
            List <Funcionalidad> elegidas = FuncionalidadesRepositorio.getFuncionalidades(rol.id);

            foreach (CheckBox ch in checkboxs)
            {
                if (ch.Name != "checkHabilitado")
                {
                    int indexK = ch.Name.IndexOf('k');
                    int id     = Convert.ToInt32(ch.Name.Substring(indexK + 1, ch.Name.Length - (indexK + 1)));
                    if (elegidas.Any(x => x.id == id))
                    {
                        ch.Checked = true;
                    }
                }
            }
        }
Exemple #5
0
        public ModificacionRol(Rol rol_seleccionado, PagoAgilFrba.Login_e_Inicio.Menu menu)
        {
            this.menu = menu;
            InitializeComponent();
            var materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme       = MaterialSkinManager.Themes.LIGHT;
            materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);

            DataRow row;

            this.rol                   = rol_seleccionado;
            tx_nombre_rol.Text         = rol.nombre;
            check_inhabilitado.Checked = rol.inhabilitado;
            if (rol.inhabilitado)
            {
                check_inhabilitado.Enabled = true;
            }
            else
            {
                check_inhabilitado.Enabled = false;
            }
            tabla_funcionalidades.Columns.Add(new DataColumn("Prueba", typeof(bool)));
            tabla_funcionalidades.Columns.Add("Nombre");
            tabla_funcionalidades.Columns.Add("Descripcion");
            List <Funcionalidad> funcionalidades = FuncionalidadesRepositorio.getFuncionalidades();

            foreach (Funcionalidad funcionalidad in funcionalidades)
            {
                row                = tabla_funcionalidades.NewRow();
                row["Prueba"]      = RolesRepositorio.tieneFuncionalidad(rol.id, funcionalidad.nombre);
                row["Nombre"]      = funcionalidad.nombre;
                row["Descripcion"] = funcionalidad.detalle;
                tabla_funcionalidades.Rows.Add(row);
            }

            data_funcionalidades_rol.DataSource = tabla_funcionalidades;
        }