protected override void LoadViewState(object savedState)
 {
     base.LoadViewState(savedState);
     _managedItem = (Business.ManagedItem)ViewState[VSKEY_MANAGEDITEM];
     if (ViewState[VSKEY_ACTIVETERMGROUPID] != null)
     {
         Guid activeTermGroupId = (Guid)ViewState[VSKEY_ACTIVETERMGROUPID];
         ActiveTermGroup = _managedItem.FindTermGroup(activeTermGroupId);
     }
     else
         ActiveTermGroup = null;
     _isChanged = bool.Parse(Request.Form[_KH_K_HF_IS_CHANGED]);
 }
 protected virtual void GetManagedItem()
 {
     string qsValue = Request.QueryString[Common.Names._QS_MANAGED_ITEM_ID];
     bool loadComplexLists = false;
     _managedItem = Business.ManagedItem.Get(new Guid(qsValue), loadComplexLists);
     string qsTermGroup = Request.QueryString[Common.Names._QS_MANAGED_ITEM_TERMGROUP];
     if (_securityHelper == null)
         _securityHelper = new SecurityHelper(_itatSystem);
     if (string.IsNullOrEmpty(qsTermGroup))
     {
         bool isAdmin = Utility.ListHelper.HaveAMatch(_itatSystem.AllowedRoles(Business.XMLNames._AF_AdminViewer), _securityHelper.UserRoles);
         ActiveTermGroup = _managedItem.GetDefaultTermGroup(_securityHelper.UserRoles, isAdmin);
         try
         {
             Guid guid = ActiveTermGroup.ID;
         }
         catch (Exception)
         {
             UnauthorizedPageAccess();
         }
     }
     else
     {
         ActiveTermGroup = _managedItem.FindTermGroup(new Guid(qsTermGroup));
         if (ActiveTermGroup == null)
             throw new Exception(string.Format("Term Group ID {0} not found.", qsTermGroup));
         if (!_managedItem.CanAccessTermGroup(ActiveTermGroup, _securityHelper.UserRoles))
         {
             if (!Utility.ListHelper.HaveAMatch(_itatSystem.AllowedRoles(Business.XMLNames._AF_AdminViewer), _securityHelper.UserRoles))
                 UnauthorizedPageAccess();
         }
     }
 }