Beispiel #1
0
 private void frmBusquedaRol_Load(object sender, EventArgs e)
 {
     IList<Rol> roles = new RolBL().GetAll();
     Rol seleccione = new Rol();
     seleccione.Descripcion = "Seleccione";
     roles.Insert(0, seleccione);
     cboRol.DataSource = roles;
 }
        public void init()
        {
            IList<Area> areas = new AreaBL().GetAll();
            cboArea.DataSource = areas;

            IList<Local> locales = new LocalBL().GetAll();
            cboLocal.DataSource = locales;

            IList<Rol> roles = new RolBL().GetAll();
            cboRol.DataSource = roles;

            cboArea.DisplayMember = "Descripcion";
            cboCargo.DisplayMember = "Descripcion";
            cboLocal.DisplayMember = "Nombre";

            cboRol.DisplayMember = "Descripcion";
            cboEstadoCivil.DisplayMember = "Descripcion";
            cboTipoDocumento.DisplayMember = "Descripcion";

            cboEstadoCivil.SelectedIndex = 0;
            cboTipoDocumento.SelectedIndex = 0;

            this.txtEmail.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaEmail);

            this.txtNumeroDocumento.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
            this.txtTelefono.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
            this.txtAnexo.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
            this.txtApePaterno.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaLetras);
            this.txtApeMaterno.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaLetras);
            this.txtNombres.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaLetras);

            this.txtNombres.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos);
            this.txtNombreUsuario.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos);
            this.txtApeMaterno.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos);
            this.txtApePaterno.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos);

            this.txtTelefono.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos);
            this.txtNumeroDocumento.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos);

            this.txtNombres.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos);
            this.txtNombreUsuario.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos);
            this.txtApeMaterno.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos);
            this.txtApePaterno.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos);
            this.txtTelefono.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos);
            this.txtNumeroDocumento.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos);
        }
        private void frmNuevoEmpleado_Load(object sender, EventArgs e)
        {
            IList<Area> areas = new AreaBL().GetAll();
            cboArea.DataSource = areas;

            IList<Local> locales = new LocalBL().GetAll();
            cboLocal.DataSource = locales;

            IList<Rol> roles = new RolBL().GetAll();
            cboRol.DataSource = roles;
        }