protected void OnHeaderEvent(object sender, HeaderEventArgs e)
		{
			switch (e.CommandName)
			{
				case Common.Names._HEADER_EVENT_Save:
                    List<Term> initialTermsList = GetTerms();
                    Common.GridHelper.SyncToGridClientState(ucGridMoveRows, initialTermsList, (Term term, string id) => { return term.ID.Equals(new Guid(id)); });
                    
                    //if the list being operated on is not same as the basic terms list obtained from the template, it needs synching up
                    if (!initialTermsList.Equals(_template.BasicTerms))
                    {
                        SyncTermsWithTemplate(initialTermsList);
                    }

                    SaveTemplateTerms();
                    GetTemplate(true);
                    PopulateForm();
                    IsChanged = false;
					break;
				case Common.Names._HEADER_EVENT_Reset:
                    GetTemplate(true);
                    PopulateForm();
                    IsChanged = false;
                    break;
				default:
					base.HandleHeaderEvent(sender, e);
					break;
			}
		}
		protected void OnHeaderEvent(object sender, HeaderEventArgs e)
		{
			switch (e.CommandName)
			{
				case Common.Names._HEADER_EVENT_Save:
                    _template.SaveExtensions(null, false);
					if (_template.IsManagedItem)
						RegisterAlert(string.Format("{0} Extensions have been saved.", this._itatSystem.ManagedItemName));
					else
						RegisterAlert("Template Extensions have been saved.");
					IsChanged = false;
					break;
				case Common.Names._HEADER_EVENT_Reset:
					GetTemplate(true);
					InitializeForm(-1);
					IsChanged = false;
					break;
				default:
					base.HandleHeaderEvent(sender, e);
					break;
			}
		}
		protected void OnHeaderEvent(object sender, HeaderEventArgs e)
		{
			switch (e.CommandName)
			{
				case Common.Names._HEADER_EVENT_Save:
			        _template.SaveLoaded(true, true, "Notifications");
					if (_template.IsManagedItem)
						RegisterAlert(string.Format("{0} Notifications have been saved.", this._itatSystem.ManagedItemName));
					else
						RegisterAlert("Template Notifications have been saved.");
					IsChanged = false;
					break;
				case Common.Names._HEADER_EVENT_Reset:
					GetTemplate(true);
				    LoadDateTermsAndNotifications();
                    edt.Html = "";
				    tblProperties.Visible = false;
				    _prevSelectedIndex = -1;
					IsChanged = false;
					break;
				default:
					base.HandleHeaderEvent(sender, e);
					break;
			}
		}
Esempio n. 4
0
		protected virtual void OnHeaderEvent(HeaderEventArgs e)
		{
			EventHandler<HeaderEventArgs> temp = HeaderEvent;
			if (temp != null)
				HeaderEvent(this, e);
		}
        protected void OnHeaderEvent(object sender, HeaderEventArgs e)
        {
            switch (e.CommandName)
            {
                case "Save":
                    Dictionary<Guid /*TermGroupID*/, bool /*CanAccess*/> canAccessTermGroup = BuildEditableTermGroups();
                    Dictionary<string /* Term Name */, List<string> /* Error Messages */ > termTypeErrors = GetTermTypeErrors(canAccessTermGroup);
                    _validationErrors.AddRange(GetValidationErrors(ManagedItemValidationType.ValidateOnSave, termTypeErrors, canAccessTermGroup));
                    foreach (ComplexList complexList in _managedItem.ComplexLists)
                    {
                        Dictionary<string /* Term Name */, List<string> /* Error Messages */ > complexListTermTypeErrors = Helper.GetComplexListTermTypeErrors(canAccessTermGroup, complexList, null);
                        _validationErrors.AddRange(Helper.GetComplexListValidationErrors(canAccessTermGroup, ManagedItemValidationType.ValidateOnSave, termTypeErrors, complexList.Items, true, _managedItem.SecurityModel, _managedItem.State.Status, complexList.TermGroupID, complexList.Name));
                    }

                    if (_validationErrors.Count == 0)
                    {
                        UpdateComplexListItems();
                        //DEG_20100212 Change made due to inadvertent orphaning after Complex List changes.
                        _managedItem.Update(false, Business.Retro.AuditType.Saved);
                        IsChanged = false;
                    }
                    break;

                case "Reset":
                    Server.Transfer(Request.Url.PathAndQuery);
                    IsChanged = false;
                    break;

                default:
                    break;

            }
        }
 protected void OnHeaderEvent(object sender, HeaderEventArgs e)
 {
 }
		public void OnHeaderEvent(object sender, HeaderEventArgs e)
		{
			switch (e.CommandName)
			{
				case Common.Names._HEADER_EVENT_Save:
                    DeleteAttachments();
                    _managedItem.Update(false, Business.Retro.AuditType.Saved);
					this.IsChanged = false;
					break;

				case Common.Names._HEADER_EVENT_Reset:
					UndoManagedItemUpdate();
					Server.Transfer(string.Format("ManagedItemProfile.aspx{0}", Utility.TextHelper.QueryString(true, Common.Names._QS_ITAT_SYSTEM_ID, _itatSystem.ID.ToString(), Common.Names._QS_MANAGED_ITEM_ID, _managedItem.ManagedItemID.ToString())), false);
					break;

				default:
					break;
			}
		}
        protected void OnHeaderEvent(object sender, HeaderEventArgs e)
        {
            switch (e.CommandName)
            {
                case Common.Names._HEADER_EVENT_Save:
                    SaveTemplateSummary();
                    break;

                case Common.Names._HEADER_EVENT_Reset:
                    GetTemplate(true);
                    LoadFields();
                    break;

                default:
                    base.HandleHeaderEvent(sender, e);
                    break;
            }
        }
		protected void HandleHeaderEvent(object sender, HeaderEventArgs e)
		{
			string props = "center=yes; help=no; resizable=yes;";
			switch (e.CommandName)
			{
				case Common.Names._HEADER_EVENT_Preview:
					string managedItemId = Request.QueryString[Common.Names._QS_MANAGED_ITEM_ID];
					string queryString;

                    if (!string.IsNullOrEmpty(managedItemId))
                        queryString = Utility.TextHelper.QueryString(true, Common.Names._QS_DOC_DLG_ACTION, Common.Names._QS_DOC_DLG_ACTION_PREVIEW, Common.Names._QS_MANAGED_ITEM_ID, managedItemId, Common.Names._QS_ITAT_SYSTEM_ID, _itatSystem.ID.ToString(), Common.Names._QS_SHOW_DEFAULT_DOCUMENT, "true");
                    else
                        queryString = Utility.TextHelper.QueryString(true, Common.Names._QS_DOC_DLG_ACTION, Common.Names._QS_DOC_DLG_ACTION_PREVIEW, Common.Names._QS_TEMPLATE_ID, _template.ID.ToString("D"), Common.Names._QS_ITAT_SYSTEM_ID, _itatSystem.ID.ToString(), Common.Names._QS_SHOW_DEFAULT_DOCUMENT, "true");
					ShowDialog("DocumentDialog.aspx" + queryString, props, false);
					break;
				default:
					throw new Exception(string.Format("UnHandled HeaderEvent:  CommandName='{0}', CommandArgument='{1}'.", e.CommandName, e.CommandArgument));
			}
		}
 protected void OnHeaderEvent(object sender, HeaderEventArgs e)
 {
     switch (e.CommandName)
     {
         //Changed for Multiple Documents 
         case Common.Names._HEADER_EVENT_Save:
             if (!ValidateAndUpdateTemplate(true, false, true, true))
                 return;
             IsChanged = false;
             if (_template.IsManagedItem)
                 RegisterAlert(string.Format("{0} Documents have been saved.", this._itatSystem.ManagedItemName));
             else
                 RegisterAlert("Template Documents have been saved.");
             break;
         //Changed for Multiple Documents
         case Common.Names._HEADER_EVENT_Reset:
             GetTemplate(true);
             InitializeMain();
             break;
         default:
             base.HandleHeaderEvent(sender, e);
             break;
     }
 }
 protected void OnHeaderEvent(object sender, HeaderEventArgs e)
 {
     switch (e.CommandName)
     {
         case Common.Names._HEADER_EVENT_Save:
             SaveTemplateWorkflows();
             IsChanged = false;
             break;
         case Common.Names._HEADER_EVENT_Reset:
             GetTemplate(true);
             PopulateForm();
             IsChanged = false;
             break;
         default:
             base.HandleHeaderEvent(sender, e);
             break;
     }
 }
        protected void OnHeaderEvent(object sender, HeaderEventArgs e)
        {
            switch (e.CommandName)
            {
                case Common.Names._HEADER_EVENT_Save:
                    Common.GridHelper.SyncToGridClientState(ucGridMoveRows, _template.ComplexLists, (Term term, string id) => { return term.ID.Equals(new Guid(id)); });
                    SaveTemplateTerms();
                    PopulateForm();
                    IsChanged = false;
                    break;

                case Common.Names._HEADER_EVENT_Reset:
                    GetTemplate(true);
                    PopulateForm();
                    IsChanged = false;
                    break;

                default:
                    base.HandleHeaderEvent(sender, e);
                    break;
            }
        }