public ActionEdit(int _ID) { ID = _ID; InitializeComponent(); ContextManager manager = new ContextManager(); SecurityActionsLogic logic = new SecurityActionsLogic(manager); SecurityAction action = logic.Get(ID); NameTB.Text = action.Name; CodeTB.Text = action.Code; DescriptionTB.Text = action.Description; SecurityCategoriesLogic categoriesLogic = new SecurityCategoriesLogic(manager); //role.SecurityCategory.Name var categories = categoriesLogic.GetAll(); int i = 0; foreach (var category in categories) { Helpers.Item item = new Helpers.Item(); item.ID = category.ID.ToString(); item.Name = category.Name; CategoriesCB.Items.Add(item); if (action.CategoryID == category.ID) { CategoriesCB.SelectedIndex = i; } i++; } manager.CloseContext(); }
private void FillGrid() { ContextManager manager = new ContextManager(); SecurityCategoriesLogic logic = new SecurityCategoriesLogic(manager); DataGV.DataSource = logic.GetAll(); }
private void FillCategories() { ContextManager manager = new ContextManager(); SecurityCategoriesLogic categories = new SecurityCategoriesLogic(manager); CategoriesLB.DataSource = categories.GetAll(); if (CategoriesLB.Items.Count > 0) { CategoriesLB.SelectedIndex = 0; } manager.CloseContext(); }
public RoleActionsF() { InitializeComponent(); //створюэмо грід з можливістю групування GroupByGrid grid = new GroupByGrid(); ContextManager manager = new ContextManager(); SecurityActionsLogic actions = new Logic.Security.SecurityActionsLogic(manager); SecurityCategoriesLogic categories = new SecurityCategoriesLogic(manager); SecurityRolesLogic roles = new SecurityRolesLogic(manager); ActionsGV.AutoGenerateColumns = false; RolesCB.DataSource = roles.GetAll(); CategoriesCB.DataSource = categories.GetAll(); manager.CloseContext(); }
public ActionNew() { InitializeComponent(); ContextManager manager = new ContextManager(); SecurityCategoriesLogic cl = new SecurityCategoriesLogic(manager); CategoriesCB.DataSource = cl.GetAll(); CategoriesCB.Update(); //CategoriesCB.Items.AddRange(cl.GetAll()); //foreach (var c in cl.GetAll()) //{ // CategoriesCB.Items.Add( //} manager.CloseContext(); }