protected override void LoadViewState(object savedState) { base.LoadViewState(savedState); //retrieve system name from ViewState, and get the corresponding template object _template = (Business.Template)ViewState[VSKEY_TEMPLATE]; _isChanged = bool.Parse(Request.Form[_KH_K_HF_IS_CHANGED]); _isChangedInitial = bool.Parse(Request.Form[_KH_K_HF_IS_CHANGED_INITIAL]); }
protected void GetTemplate(bool overrideContext) { if (overrideContext || (Context.Items[Common.Names._CNTXT_Template] == null)) { string qsMIID = Request.QueryString[Common.Names._QS_MANAGED_ITEM_ID]; if (!string.IsNullOrEmpty(qsMIID)) { try { Guid managedItemID = new Guid(qsMIID); ManagedItem managedItem = ManagedItem.Get(managedItemID,true); managedItem.IsEditLanguage = true; _template = managedItem; } catch { throw new Exception(String.Format("The \"{0}\" query string value \"{1}\" is not a valid GUID.", Common.Names._QS_MANAGED_ITEM_ID, qsMIID)); } } else { string qsTID = Request.QueryString[Common.Names._QS_TEMPLATE_ID]; try { Guid templateID = new Guid(qsTID); _template = new Business.Template(templateID, DefType.Draft); } catch { throw new Exception(String.Format("The \"{0}\" query string value \"{1}\" is not a valid GUID.", Common.Names._QS_TEMPLATE_ID, qsTID)); } } } else { _template = (Business.Template)Context.Items[Common.Names._CNTXT_Template]; //IsChanged related change if (Context.Items[Common.Names._CNTXT_IsChanged] != null) { IsChanged = (bool)Context.Items[Common.Names._CNTXT_IsChanged]; } } }