Esempio n. 1
0
        public void InitializeModuleSection()
        {
            TreeListNode node = treeList.FocusedNode;

            if (node != null)
            {
                ADUserGroupSectionsController objUserGroupSectionsController = new ADUserGroupSectionsController();
                ADUserGroupSectionsInfo       objADUserGroupSectionsInfo     = (ADUserGroupSectionsInfo)objUserGroupSectionsController.GetObjectByID(Convert.ToInt32(node.Tag));
                if (objADUserGroupSectionsInfo != null)
                {
                    STModuleToUserGroupSectionsController objModuleToUserGroupSectionsController = new STModuleToUserGroupSectionsController();
                    DataSet ds = objModuleToUserGroupSectionsController.GetAllModuleToUserGroupSectionByUserGroupSectionID(objADUserGroupSectionsInfo.ADUserGroupSectionID);
                    if (ds != null)
                    {
                        foreach (DataRow row in ds.Tables[0].Rows)
                        {
                            STModuleToUserGroupSectionsInfo objSTModuleToUserGroupSectionsInfo = (STModuleToUserGroupSectionsInfo) new STModuleToUserGroupSectionsController().GetObjectFromDataRow(row);
                            if (objADUserGroupSectionsInfo != null)
                            {
                                STModulesInfo objSTModulesInfo = (STModulesInfo) new STModulesController().GetObjectByID(objSTModuleToUserGroupSectionsInfo.FK_STModuleID);
                                if (objSTModulesInfo != null)
                                {
                                    lstModule.Add(objSTModulesInfo);
                                }
                            }
                        }
                    }
                }
            }
            fld_dgcModuleActivesGridControl.DataSource = lstModule;
            fld_dgcModuleActivesGridControl.RefreshDataSource();
        }
Esempio n. 2
0
        private void DeleteSection_Clicked(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn xóa nhóm module này không", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                TreeListNode node = fld_treeUserGroup.FocusedNode;
                ADUserGroupSectionsController         objUserGroupSectionsController         = new ADUserGroupSectionsController();
                STModuleToUserGroupSectionsController objModuleToUserGroupSectionsController = new STModuleToUserGroupSectionsController();

                DataSet ds = objModuleToUserGroupSectionsController.GetAllModuleToUserGroupSectionByUserGroupSectionID((int)node.Tag);
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    STModuleToUserGroupSectionsInfo objModuleToUserGroupSectionsInfo = (STModuleToUserGroupSectionsInfo)objModuleToUserGroupSectionsController.GetObjectFromDataRow(row);
                    objModuleToUserGroupSectionsController.DeleteObject(objModuleToUserGroupSectionsInfo.STModuleToUserGroupSectionID);
                }

                objUserGroupSectionsController.DeleteObject((int)node.Tag);
                ((UserManagementModule)Module).InitializeTreeList(fld_treeUserGroup);
            }
        }
Esempio n. 3
0
        private void AddModuleNode(TreeList fld_trlstUserGroup, int iUserGroupSectionID, TreeListNode parentNode)
        {
            STModuleToUserGroupSectionsController objSTModuleToUserGroupSectionsController = new STModuleToUserGroupSectionsController();
            DataSet dsModuleUserGroupSections = objSTModuleToUserGroupSectionsController.GetAllModuleToUserGroupSectionByUserGroupSectionID(iUserGroupSectionID);

            if (dsModuleUserGroupSections != null)
            {
                foreach (DataRow row in dsModuleUserGroupSections.Tables[0].Rows)
                {
                    STModuleToUserGroupSectionsInfo objSTModuleToUserGroupSectionsInfo = (STModuleToUserGroupSectionsInfo)objSTModuleToUserGroupSectionsController.GetObjectFromDataRow(row);
                    if (objSTModuleToUserGroupSectionsInfo != null)
                    {
                        STModulesInfo objSTModulesInfo = (STModulesInfo) new STModulesController().GetObjectByID(objSTModuleToUserGroupSectionsInfo.FK_STModuleID);
                        if (objSTModulesInfo != null)
                        {
                            TreeListNode treeListModuleNode = fld_trlstUserGroup.AppendNode(new object[] { objSTModulesInfo.STModuleDesc, parentNode.Level + 1 }, parentNode);
                            treeListModuleNode.Tag = objSTModulesInfo.STModuleID;
                        }
                    }
                }
            }
        }