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 DeleteSB_Click(object sender, EventArgs e) { ContextManager manager = new ContextManager(); SecurityCategoriesLogic sr = new SecurityCategoriesLogic(manager); sr.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells[0].FormattedValue)); manager.Save(); FillGrid(); }
private void SaveBt_Click(object sender, EventArgs e) { ContextManager manager = new ContextManager(); SecurityCategoriesLogic logic = new SecurityCategoriesLogic(manager); logic.Create(NameTB.Text); manager.Save(); manager.CloseContext(); this.Close(); }
private void SaveBt_Click(object sender, EventArgs e) { ContextManager manager = new ContextManager(); SecurityCategoriesLogic logic = new SecurityCategoriesLogic(manager); logic.Update(ID, NameTB.Text); manager.Save(); manager.CloseContext(); this.Close(); }
public CategoryEdit(int _ID) { ID = _ID; InitializeComponent(); ContextManager manager = new ContextManager(); SecurityCategoriesLogic logic = new SecurityCategoriesLogic(manager); SecurityCategory role = logic.Get(ID); NameTB.Text = role.Name; manager.CloseContext(); }
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(); }
public ActionsForm() { InitializeComponent(); DataGV.AutoGenerateColumns = false; ContextManager manager = new ContextManager(); SecurityCategoriesLogic categories = new SecurityCategoriesLogic(manager); //CategoriesGV.DataSource = categories.GetAll(); //foreach (var c in categories.GetAll()) //{ // CategoriesTV.Nodes.Add(c.ID.ToString(), c.Name); //} FillCategories(); FillGrid(); }