Example #1
0
 public void CargarPermisos()
 {
     if (conUsuarios.uAutentificado != null)
     {
         this.cmbAlmacenes.Enabled = true;
         foreach (object obj in this.groupBox1.Controls)
         {
             if (obj is Button)
             {
                 Button  btn        = (Button)obj;
                 int     idPermiso  = Convert.ToInt32(btn.Tag);
                 Boolean hayPemriso = true;
                 if (idPermiso > 0)
                 {
                     foreach (PermisoNegadoRol item in conUsuarios.uAutentificado.rol.PermisosNegados)
                     {
                         if (item.permiso.id == idPermiso)
                         {
                             hayPemriso = false;
                         }
                     }
                 }
                 btn.Enabled = hayPemriso;
             }
         }
     }
     else
     {
         this.cmbAlmacenes.Enabled = false;
         this.AcDeBotones(false);
         frmAutentificar nVentana = frmAutentificar.getIntancia(this);
         nVentana.ShowDialog();
         this.grdDatos.Rows.Clear();
     }
 }
Example #2
0
 public static frmAutentificar getIntancia(frmPanel padre)
 {
     if (instancia == null)
     {
         instancia = new frmAutentificar(padre);
     }
     return(instancia);
 }
Example #3
0
 protected override void Dispose(bool disposing)
 {
     if (disposing && (components != null))
     {
         components.Dispose();
     }
     base.Dispose(disposing);
     instancia = null;
 }
Example #4
0
        /*
         * grdPizarra.Rows.Insert(iRenglon, "");
         *  grdPizarra.Rows[iRenglon].Cells[1].Value = producto.CodigoProducto;
         *  grdPizarra.Rows[iRenglon].Cells[2].Value = producto.NombreProducto;
         *  grdPizarra.Rows[iRenglon].Cells[3].Value = producto.Stock.ToString();
         *
         *
         *
         *  grdPizarra.Rows.Insert(iRenglon, "");
         *  grdPizarra.Rows[iRenglon].Cells[0].Value = almacen.NombreAlmacen.ToUpper();
         *  grdPizarra.Rows[iRenglon].Cells[0].ToolTipText = almacen.CodigoAlmacen;
         */

        private void inicializarPantalla()
        {
            #region "CODIGO DE INICIALIZACION"
            AcDeBotones(false);
            Reportes.Tools.ELog.save("PANEL DE CONTROL", new Exception("SE CARGARON LOS BONES"));
            InicializarCiadricula();
            Reportes.Tools.ELog.save("PANEL DE CONTROL", new Exception("CUADRICULA"));
            var lista = conAlmacen.listarAlmacenes();
            Reportes.Tools.ELog.save("PANEL DE CONTROL", new Exception("LISTA DE ALMACENES"));
            this.cmbAlmacenes.DisplayMember = "CNOMBREALMACEN";
            this.cmbAlmacenes.ValueMember   = "CIDALMACEN";
            this.cmbAlmacenes.DataSource    = lista;
            //AcDeBotones();

            button5.Enabled = true;
            if (conUsuarios.uAutentificado == null)
            {
                frmAutentificar nVentana = frmAutentificar.getIntancia(this);
                nVentana.ShowDialog();
            }
            #endregion
        }