Beispiel #1
0
        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();
        }
Beispiel #2
0
        private void FillGrid()
        {
            ContextManager          manager = new ContextManager();
            SecurityCategoriesLogic logic   = new SecurityCategoriesLogic(manager);

            DataGV.DataSource = logic.GetAll();
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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();
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
        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();
        }
Beispiel #7
0
 private void FillGrid()
 {
     ContextManager manager = new ContextManager();
     SecurityCategoriesLogic logic = new SecurityCategoriesLogic(manager);
     DataGV.DataSource = logic.GetAll();
 }