Exemplo n.º 1
0
        private void CargarPerfiles()
        {
            try
            {
                BLL.Tables.TBL_PERFILES _perfiles = new BLL.Tables.TBL_PERFILES();
                _perfiles.ItemList();
                Entities.Tables.TBL_PERFILES _itemSeleccion = new Entities.Tables.TBL_PERFILES();
                //Limpia el combo
                this.comboPerfil.SuspendLayout();
                this.comboPerfil.DataSource = null;
                this.comboPerfil.Items.Clear();

                //Carga el item de Seleccion.-
                _itemSeleccion.NOMBREPERFIL = "<Seleccione un Perfil>";
                _itemSeleccion.ID_PERFIL    = 0;
                _perfiles.Result.Insert(0, _itemSeleccion);

                //Carga el combo
                this.comboPerfil.ValueMember   = "Id_Perfil";
                this.comboPerfil.DisplayMember = "NombrePerfil";
                this.comboPerfil.DataSource    = _perfiles.Result;
                this.comboPerfil.SelectedValue = 0;
                this.comboPerfil.ResumeLayout();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }