Exemplo n.º 1
0
        public void LoadRol()
        {
            try
            {
                RoleBLL   RoleBLL = new RoleBLL();
                DataTable Roles;
                Roles = RoleBLL.All();
                comboBoxRol.DisplayMember = "Text";
                comboBoxRol.ValueMember   = "Value";

                List <Object> items = new List <object>();
                items.Add(new { Text = "Seleccione un opción", Value = "0" });
                foreach (DataRow Rol in Roles.Rows)
                {
                    items.Add(new { Text = Rol[RoleML.DataBase.Name].ToString(), Value = Rol[RoleML.DataBase.Id].ToString() });
                }
                comboBoxRol.DataSource = items;
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("LoadJobs: {0}", ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }