Exemplo n.º 1
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            Usuario       oUsuario = oLogin.GetUsuario(txtUsuario.Text.TrimEnd(), txtClave.Text.TrimEnd());
            List <Acceso> lAccesos = oAcceso.GetAccesos(oUsuario.idPerfil);

            if (oUsuario != null)
            {
                Form frm = new frmPrincipal(lAccesos);
                frm.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Usuario no existe",
                                "SLIM",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
            }
        }
Exemplo n.º 2
0
        public frmPerfil(int idPerfil)
        {
            InitializeComponent();
            dgvAccesos.DataSource = oAcceso.GetAccesos(idPerfil);
            //  DataGridViewCheckBoxColumn checkColumn = new DataGridViewCheckBoxColumn();
            //  checkColumn.Name = "estado";
            //  checkColumn.HeaderText = "X";
            //  checkColumn.Width = 50;
            //  checkColumn.ReadOnly = false;
            // // checkColumn.ValueType = int;
            ////  checkColumn.FillWeight = 10; //if the datagridview is resized (on form resize) the checkbox won't take up too much; value is relative to the other columns' fill values
            //  dgvAccesos.Columns.Add(checkColumn);
            //foreach (DataGridViewRow row in dgvAccesos.Rows)
            //{

            //    //If checked then highlight row
            //    if (int.Parse(row.Cells["estado"].Value.ToString()) == 1) {
            //        row.Selected = true;
            //    }

            //}
        }