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

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