/// <summary>
    /// Reloads data.
    /// </summary>
    /// <param name="setAutomatically">Indicates if table should be pre-set according to field type</param>
    /// <param name="forceReload">Forces data to reload even if they are already loaded.</param>
    public void ReloadData(bool setAutomatically, bool forceReload)
    {
        if (!mLoaded || forceReload)
        {
            mLoaded = true;
            pnlContent.Controls.Clear();

            if (ItemID > 0)
            {
                var dataClassInfo = DataClassInfoProvider.GetDataClassInfo(ItemID);

                mDci        = dataClassInfo;
                mAttributes = dataClassInfo.GetSearchIndexColumns()?.ToList();

                if (mDci != null)
                {
                    mSearchSettings = new SearchSettings();
                    mSearchSettings.LoadData(mDci.ClassSearchSettings);
                    if ((mDci.TypeInfo.ObjectType == PredefinedObjectType.CUSTOMTABLECLASS) || (mDci.TypeInfo.ObjectType == PredefinedObjectType.FORMCLASS))
                    {
                        DisplayAzureFields = false;
                    }
                }
            }

            btnAutomatically.Click += btnAutomatically_Click;

            // Display checkbox matrix only if field names array is not empty
            if (mAttributes?.Count > 0)
            {
                // Setup controls
                btnAutomatically.Visible = true;
                if (mFields == null)
                {
                    mFields = new SearchSettings();
                }

                if (mDci != null)
                {
                    mFields.LoadData(mDci.ClassSearchSettings);
                }
                mInfos = mFields.GetAllSettingsInfos();

                CreateTable(setAutomatically);

                Literal ltl = new Literal();
                ltl.Text = "<br />";
                pnlContent.Controls.Add(ltl);
            }
        }
    }
    /// <summary>
    /// Reloads data.
    /// </summary>
    /// <param name="setAutomatically">Indicates if table should be pre-set according to field type</param>
    /// <param name="forceReload">Forces data to reload even if they are already loaded.</param>
    public void ReloadData(bool setAutomatically, bool forceReload)
    {
        if (!mLoaded || forceReload)
        {
            mLoaded = true;
            pnlContent.Controls.Clear();

            mAttributes = SearchHelper.GetClassSearchFields(ItemID);

            mDci = DataClassInfoProvider.GetDataClassInfo(ItemID);

            if (mDci != null)
            {
                mSearchSettings = new SearchSettings();
                mSearchSettings.LoadData(mDci.ClassSearchSettings);
            }

            btnAutomatically.Click += btnAutomatically_Click;

            // Display checkbox matrix only if field names array is not empty
            if (mAttributes.Count > 0)
            {
                // Setup controls
                btnAutomatically.Visible = true;
                if (mFields == null)
                {
                    mFields = new SearchSettings();
                }

                if (mDci != null)
                {
                    mFields.LoadData(mDci.ClassSearchSettings);
                }
                mInfos = mFields.GetAllSettingsInfos();

                CreateTable(setAutomatically);

                Literal ltl = new Literal();
                ltl.Text = "<br />";
                pnlContent.Controls.Add(ltl);
            }
        }
    }
Пример #3
0
    /// <summary>
    /// Reloads data.
    /// </summary>
    /// <param name="SetAutomatically">Indicates if table should be pre-set according to field type</param>
    public void ReloadData(bool setAutomatically, bool forceReload)
    {
        if ((!loaded) || ((loaded) && (forceReload)))
        {
            loaded = true;
            pnlContent.Controls.Clear();
            LoadData();
            btnAutomatically.Click += new EventHandler(btnAutomatically_Click);

            // Display checkbox matrix only if field names array is not empty
            if (attributes.Count > 0)
            {
                // Setup controls
                btnAutomatically.Visible = true;
                if (fields == null)
                {
                    fields = new SearchSettings();
                }

                if (dci != null)
                {
                    fields.LoadData(dci.ClassSearchSettings);
                }
                infos = fields.GetAllSettingsInfos();

                CreateTable(setAutomatically);

                Literal ltl = new Literal();
                ltl.Text = "<br />";
                pnlContent.Controls.Add(ltl);
            }

            // Setup OK button
            FormSubmitButton btnOk = new FormSubmitButton();
            btnOk.ID      = "btnOK";
            btnOk.Click  += new EventHandler(btnOK_Click);
            btnOk.Visible = DisplayOkButton;
            pnlContent.Controls.Add(btnOk);
        }
    }