private void GetGroups() { using (IDataReader reader = User.GetListSecureGroup(Security.CurrentUser.UserID)) { if (reader.Read()) { iCurGroupId = (int)reader["GroupId"]; } } try { if (Request["SGroupID"] != null) { GroupID = int.Parse(Request["SGroupID"]); if (GroupID != 1 && GroupID != 6 && !SecureGroup.CanRead(GroupID)) GroupID = iCurGroupId; pc["SecureGroup_CurrentGroup"] = GroupID.ToString(); } else { try { GroupID = int.Parse(pc["SecureGroup_CurrentGroup"]); using (IDataReader r = SecureGroup.GetGroup(GroupID)) { if (!r.Read()) { GroupID = iCurGroupId; pc["SecureGroup_CurrentGroup"] = iCurGroupId.ToString(); } else { if (GroupID != 1 && GroupID != 6 && !SecureGroup.CanRead(GroupID)) { GroupID = iCurGroupId; pc["SecureGroup_CurrentGroup"] = iCurGroupId.ToString(); } } } } catch (Exception) { pc["SecureGroup_CurrentGroup"] = iCurGroupId.ToString(); GroupID = iCurGroupId; } } } catch { pc["SecureGroup_CurrentGroup"] = iCurGroupId.ToString(); GroupID = iCurGroupId; } }