Exemplo n.º 1
0
 /// <summary>
 /// True, if history is available.
 /// </summary>
 /// <returns></returns>
 public bool IsHistoryAvailable(DIDataWizardType wizardType)
 {
     bool Retval = true;
     try
     {
         if (wizardType == DIDataWizardType.HomePage && this._NavigationHistory.Count == 0)
         {
             Retval = false;
         }
         else
         {
             Retval = true;
         }
     }
     catch (Exception)
     {
         Retval = true;
     }
     return Retval;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Get the most recent history. 
        /// </summary>
        /// <param name="wizardType"></param>
        /// <param name="filterPage"></param>
        /// <returns></returns>
        public string GetHistoryPage(DIDataWizardType wizardType, bool filterPage)
        {
            string Retval = string.Empty;
            try
            {
                //if (this.IsFilterDeletedFromHistory)
                //{
                //    // -- Deleted last entry from the history
                //    this._NavigationHistory.RemoveAt(this._NavigationHistory.Count - 1);
                //    this.IsFilterDeletedFromHistory = false;
                //    try
                //    {
                //        DIWizardPanel.PanelType PanelPage = (DIWizardPanel.PanelType)Enum.Parse(typeof(DIWizardPanel.PanelType), this._NavigationHistory[this._NavigationHistory.Count - 1]);
                //        this._IsFilterPage = false;
                //        filterPage = false;
                //    }
                //    catch (Exception)
                //    {
                //    }
                //}

                // -- Get the most recent history.
                if (this._NavigationHistory.Count > 0)
                {
                    Retval = this._NavigationHistory[this._NavigationHistory.Count - 1];
                }
                else if (this._NavigationHistory.Count == 0)
                {
                    this._IsFilterPage = false;
                    Retval = Constants.DWOPTIONPAGE;
                }

                if (wizardType == DIDataWizardType.Filters && this._IsValidSourceFilter)
                {
                    try
                    {
                        //-- Reset the setting, so that DW option page will be displayed.
                        DIWizardPanel.PanelType PanelPage = (DIWizardPanel.PanelType)Enum.Parse(typeof(DIWizardPanel.PanelType), this._NavigationHistory[this._NavigationHistory.Count - 1]);
                        this._IsFilterPage = false;
                        wizardType = DIDataWizardType.SelectionPage;
                        filterPage = false;
                    }
                    catch (Exception)
                    {
                    }
                }

                if (!filterPage)
                {
                    // -- Convert the panel type enum into the array list.
                    ArrayList PanelType = this.EnumToArray();

                    // -- current page is not the DW option page
                    foreach (string Fields in PanelType)
                    {
                        if (Fields.ToLower() == Retval.ToLower())
                        {
                            if (wizardType == DIDataWizardType.SelectionPage)
                            {
                                Retval = Constants.DWOPTIONPAGE;
                                break;
                            }
                        }
                    }
                    //if (!string.IsNullOrEmpty(this.IndicatorNIds))
                    //{
                    //    this._UserPreference.UserSelection.IndicatorNIds = this.IndicatorNIds;
                    //    this._UserPreference.UserSelection.ShowIUS = false;
                    //    this.IndicatorNIds = string.Empty;
                    //}
                }

                if (this._NavigationHistory.Count > 0 && Retval != Constants.DWOPTIONPAGE)
                {
                    this._NavigationHistory.RemoveAt(this._NavigationHistory.Count - 1);
                }

                try
                {
                    //-- Update the selection status list
                    this.UpdateSelectionList((DIWizardPanel.PanelType)Enum.Parse(typeof(DIWizardPanel.PanelType), Retval));
                }
                catch (Exception)
                {
                }
            }
            catch (Exception)
            {
                Retval = string.Empty;
            }
            return Retval;
        }