Exemplo n.º 1
0
 /// <summary>
 /// Load filter control according filterpath.
 /// </summary>
 private void LoadFilter()
 {
     if (this.mFilterControl == null)
     {
         if (this.FilterControlPath != null)
         {
             try
             {
                 if (File.Exists(Server.MapPath(this.FilterControlPath)))
                 {
                     this.mFilterControl = (this.Page.LoadControl(this.FilterControlPath)) as CMSAbstractBaseFilterControl;
                     if (this.mFilterControl != null)
                     {
                         this.mFilterControl.ID = "filterControl";
                         this.Controls.AddAt(0, this.mFilterControl);
                         this.mFilterControl.FilterName = this.FilterName;
                         if (this.Page != null)
                         {
                             this.mFilterControl.Page = this.Page;
                         }
                     }
                 }
             }
             catch (Exception ex)
             {
                 EventLogProvider log = new EventLogProvider();
                 log.LogEvent("Filter control", "LOADFILTER", ex);
             }
         }
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// Loads dynamically custom filter if is defined.
    /// </summary>
    private void LoadFilter()
    {
        // Use user filter
        if (!String.IsNullOrEmpty(filterControl))
        {
            pnlFilter.Controls.Clear();

            searchControl = (CMSAbstractBaseFilterControl)LoadUserControl(filterControl);
            if (searchControl != null)
            {
                searchControl.Parameters       = parameters;
                searchControl.FilteredControl  = this;
                searchControl.OnFilterChanged += searchControl_OnFilterChanged;
                searchControl.ID            = "filterElem";
                searchControl.SelectedValue = hidItem.Value.Replace(valuesSeparator, string.Empty);
                searchControl.FilterMode    = filterMode;

                pnlFilter.Controls.Add(searchControl);
                pnlFilter.Visible = true;

                // Get init filter where condition
                FilterWhere = SqlHelper.AddWhereCondition(string.Empty, searchControl.WhereCondition);

                // When both filters are rendered, mark the first as followed by another
                if (useDefaultNameFilter)
                {
                    pnlFilter.CssClass += " header-panel-not-last";
                }
            }
        }
    }
 /// <summary>
 /// Load filter control according filterpath.
 /// </summary>
 private void LoadFilter()
 {
     if (mFilterControl == null)
     {
         if (FilterControlPath != null)
         {
             try
             {
                 if (File.Exists(Server.MapPath(FilterControlPath)))
                 {
                     mFilterControl = (Page.LoadUserControl(FilterControlPath)) as CMSAbstractBaseFilterControl;
                     if (mFilterControl != null)
                     {
                         mFilterControl.ID = "filterControl";
                         Controls.AddAt(0, mFilterControl);
                         mFilterControl.FilterName = FilterName;
                         if (Page != null)
                         {
                             mFilterControl.Page = Page;
                         }
                     }
                 }
             }
             catch (Exception ex)
             {
                 EventLogProvider.LogException("Filter control", "LOADFILTER", ex);
             }
         }
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Load filter control according filterpath.
 /// </summary>
 private void LoadFilter()
 {
     if (mFilterControl == null)
     {
         if (FilterControlPath != null)
         {
             try
             {
                 mFilterControl = (Page.LoadUserControl(FilterControlPath)) as CMSAbstractBaseFilterControl;
                 if (mFilterControl != null)
                 {
                     mFilterControl.ID = "filterControl";
                     Controls.AddAt(0, mFilterControl);
                     mFilterControl.FilterName = FilterName;
                     if (Page != null)
                     {
                         mFilterControl.Page = Page;
                     }
                 }
             }
             catch (Exception ex)
             {
                 EventLogProvider.LogException("Filter control", "LOADFILTER", ex, loggingPolicy: LoggingPolicy.ONLY_ONCE);
             }
         }
     }
 }
Exemplo n.º 5
0
    /// <summary>
    /// Loads dynamically custom filter if is defined.
    /// </summary>
    private void LoadFilter()
    {
        // Use user filter
        if (!String.IsNullOrEmpty(filterControl))
        {
            pnlFilter.Controls.Clear();

            searchControl = (CMSAbstractBaseFilterControl)LoadUserControl(filterControl);
            if (searchControl != null)
            {
                searchControl.Parameters       = parameters;
                searchControl.FilteredControl  = this;
                searchControl.OnFilterChanged += searchControl_OnFilterChanged;
                searchControl.ID            = "filterElem";
                searchControl.SelectedValue = hidItem.Value.Replace(valuesSeparator, string.Empty);
                searchControl.FilterMode    = filterMode;

                pnlFilter.Controls.Add(searchControl);
                pnlFilter.Visible = true;

                // Get init filter where condition
                FilterWhere = SqlHelperClass.AddWhereCondition("", searchControl.WhereCondition);
            }
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// Gets SQL Where condition for a state.
    /// </summary>
    private string GetStateCondition(CMSAbstractBaseFilterControl filter)
    {
        string originalQuery = filter.WhereCondition;

        if (!String.IsNullOrEmpty(originalQuery))
        {
            return(String.Format("AccountStateID IN (SELECT StateID FROM CMS_State WHERE {0})", originalQuery));
        }
        return(originalQuery);
    }
Exemplo n.º 7
0
    /// <summary>
    /// Gets SQL Where condition for owner's fullname.
    /// </summary>
    private string GetOwnerCondition(CMSAbstractBaseFilterControl filter)
    {
        string originalQuery = filter.WhereCondition;

        if (!String.IsNullOrEmpty(originalQuery))
        {
            return(String.Format("ContactOwnerUserID IN (SELECT UserID FROM CMS_User WHERE {0})", originalQuery));
        }
        return(originalQuery);
    }
    /// <summary>
    /// Loads dynamically custom filter if is defined.
    /// </summary>
    private void LoadFilter()
    {
        // Use user filter
        if (!String.IsNullOrEmpty(filterControl))
        {
            pnlFilter.Controls.Clear();

            searchControl = (CMSAbstractBaseFilterControl)LoadUserControl(filterControl);
            if (searchControl != null)
            {
                searchControl.Parameters = parameters;
                searchControl.FilteredControl = this;
                searchControl.OnFilterChanged += searchControl_OnFilterChanged;
                searchControl.ID = "filterElem";
                searchControl.SelectedValue = hidItem.Value.Replace(valuesSeparator, string.Empty);
                searchControl.FilterMode = filterMode;

                pnlFilter.Controls.Add(searchControl);
                pnlFilter.Visible = true;

                // Get init filter where condition
                FilterWhere = SqlHelperClass.AddWhereCondition("", searchControl.WhereCondition);
            }
        }
    }
Exemplo n.º 9
0
 /// <summary>
 /// Load filter control according filterpath.
 /// </summary>
 private void LoadFilter()
 {
     if (this.mFilterControl == null)
     {
         if (this.FilterControlPath != null)
         {
             try
             {
                 if (File.Exists(Server.MapPath(this.FilterControlPath)))
                 {
                     this.mFilterControl = (this.Page.LoadControl(this.FilterControlPath)) as CMSAbstractBaseFilterControl;
                     if (this.mFilterControl != null)
                     {
                         this.mFilterControl.ID = "filterControl";
                         this.Controls.AddAt(0, this.mFilterControl);
                         this.mFilterControl.FilterName = this.FilterName;
                         if (this.Page != null)
                         {
                             this.mFilterControl.Page = this.Page;
                         }
                     }
                 }
             }
             catch (Exception ex)
             {
                 EventLogProvider log = new EventLogProvider();
                 log.LogEvent("Filter control", "LOADFILTER", ex);
             }
         }
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// Gets SQL Where condition for a state.
 /// </summary>
 private string GetStateCondition(CMSAbstractBaseFilterControl filter)
 {
     string originalQuery = filter.WhereCondition;
     if (!String.IsNullOrEmpty(originalQuery))
     {
         return String.Format("ContactStateID IN (SELECT StateID FROM CMS_State WHERE {0})", originalQuery);
     }
     return originalQuery;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Load filter control according filterpath.
 /// </summary>
 private void LoadFilter()
 {
     if (mFilterControl == null)
     {
         if (FilterControlPath != null)
         {
             try
             {
                 if (File.Exists(Server.MapPath(FilterControlPath)))
                 {
                     mFilterControl = (Page.LoadUserControl(FilterControlPath)) as CMSAbstractBaseFilterControl;
                     if (mFilterControl != null)
                     {
                         mFilterControl.ID = "filterControl";
                         Controls.AddAt(0, mFilterControl);
                         mFilterControl.FilterName = FilterName;
                         if (Page != null)
                         {
                             mFilterControl.Page = Page;
                         }
                     }
                 }
             }
             catch (Exception ex)
             {
                 EventLogProvider.LogException("Filter control", "LOADFILTER", ex);
             }
         }
     }
 }
    /// <summary>
    /// Loads dynamically custom filter if is defined.
    /// </summary>
    private void LoadFilter()
    {
        // Use user filter
        if (!String.IsNullOrEmpty(filterControl))
        {
            pnlFilter.Controls.Clear();

            searchControl = (CMSAbstractBaseFilterControl)LoadUserControl(filterControl);
            if (searchControl != null)
            {
                searchControl.Parameters = parameters;
                searchControl.FilteredControl = this;
                searchControl.OnFilterChanged += searchControl_OnFilterChanged;
                searchControl.ID = "filterElem";
                searchControl.SelectedValue = hidItem.Value.Replace(valuesSeparator, string.Empty);
                searchControl.FilterMode = filterMode;

                pnlFilter.Controls.Add(searchControl);
                pnlFilter.Visible = true;

                // Get init filter where condition
                FilterWhere = SqlHelper.AddWhereCondition(string.Empty, searchControl.WhereCondition);

                // When both filters are rendered, mark the first as followed by another
                if (useDefaultNameFilter)
                {
                    pnlFilter.CssClass += " header-panel-not-last";
                }
            }
        }
    }
Exemplo n.º 13
0
 /// <summary>
 /// Gets SQL Where condition for a country.
 /// </summary>
 private string GetCountryCondition(CMSAbstractBaseFilterControl filter)
 {
     string originalQuery = filter.WhereCondition;
     if (!String.IsNullOrEmpty(originalQuery))
     {
         return String.Format("AccountCountryID IN (SELECT CountryID FROM CMS_Country WHERE {0})", originalQuery);
     }
     return originalQuery;
 }