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 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();
 }
Exemple #4
0
        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();
        }
Exemple #5
0
 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();
 }
Exemple #6
0
        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();
        }
Exemple #7
0
        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();
        }
Exemple #8
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 #9
0
        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();
        }
Exemple #10
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 #11
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 #12
0
        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();
        }
Exemple #13
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 #14
0
 private void FillGrid()
 {
     ContextManager manager = new ContextManager();
     SecurityCategoriesLogic logic = new SecurityCategoriesLogic(manager);
     DataGV.DataSource = logic.GetAll();
 }