public User(string UID, Int64 ModuleID) { SUser = SynapseUser.LoadByUserID(UID); UserID = UID; _CurrentModuleID = ModuleID; _UserControls = new Hashtable(); try { _Groups = SynapseProfile.LoadFromQuery("SELECT [P_ID] as ID,[FK_ModuleID],[FK_LABELID],[P_TECHNICALNAME] as TECHNICALNAME,[IS_OWNER],[LEVEL] FROM [V_Synapse_UserGroups] WHERE UserID = '" + UID + "'"); _Modules = SynapseModule.LoadFromQuery("SELECT DISTINCT [M_ID] as ID,[LABELID],[PATH],[M_TECHNICALNAME] as TECHNICALNAME,[VERSION],[MODULECATEGORY],[VERSIONDATE],[DESCLABELID],[DEVSOURCE],[PRODSOURCE],[IS_ACTIVE],[IS_REQUESTABLE] FROM [V_Synapse_UserGroups] WHERE UserID = '" + UID + "' OR M_ID=1 ORDER BY MODULECATEGORY"); CSC = ControlSecurity.Load("WHERE (UserID = '" + UserID + "' OR UserID = 'Everybody') AND (FK_MODULE_ID=" + ModuleID + " OR FK_MODULE_ID=1)"); foreach (ControlSecurity C in CSC) { try { _UserControls.Add(C.FORM_NAME + C.CTRL_NAME, C); } // TODO: Catch more specific exception catch (Exception ex) { SynapseForm.SynapseLogger.Error(ex.Message); } } } // TODO: Catch more specific exception catch (Exception ex) { SynapseForm.SynapseLogger.Error(ex.Message); } }
public void ReloadModulesAndGroups() { try { _Groups = SynapseProfile.LoadFromQuery("SELECT [P_ID] as ID,[FK_ModuleID],[FK_LABELID],[P_TECHNICALNAME] as TECHNICALNAME,[IS_OWNER],[LEVEL] FROM [V_Synapse_UserGroups] WHERE UserID = '" + UserID + "'"); _Modules = SynapseModule.LoadFromQuery("SELECT DISTINCT [M_ID] as ID,[LABELID],[PATH],[M_TECHNICALNAME] as TECHNICALNAME,[VERSION],[MODULECATEGORY],[VERSIONDATE],[DESCLABELID],[DEVSOURCE],[PRODSOURCE],[IS_ACTIVE],[IS_REQUESTABLE] FROM [V_Synapse_UserGroups] WHERE UserID = '" + UserID + "' OR M_ID=1 ORDER BY MODULECATEGORY"); } // TODO: Catch more specific exception catch (Exception ex) { SynapseForm.SynapseLogger.Error(ex.Message); } }