GetVendors() public method

public GetVendors ( int PortalId, bool UnAuthorized, int PageIndex, int PageSize, int &TotalRecords ) : ArrayList
PortalId int
UnAuthorized bool
PageIndex int
PageSize int
TotalRecords int
return System.Collections.ArrayList
Beispiel #1
0
        private void SetDataSource()
        {
            CreateLetterSearch();

            bool isUnauthorized = false;

            if (_searchFilter.Equals(Localization.GetString("All"), StringComparison.InvariantCultureIgnoreCase))
            {
                _searchFilter = "";
            }
            else if (_searchFilter.Equals(Localization.GetString("Unauthorized"), StringComparison.InvariantCultureIgnoreCase))
            {
                _searchFilter  = "";
                isUnauthorized = true;
            }

            //Get the list of vendors from the database
            var totalRecords     = 0;
            var vendorController = new Dnn.Modules.Vendors.Components.VendorsController();
            int portal           = Globals.IsHostTab(PortalSettings.ActiveTab.TabID) ? Null.NullInteger : PortalId;

            if (String.IsNullOrEmpty(_searchFilter))
            {
                grdVendors.DataSource       = vendorController.GetVendors(portal, isUnauthorized, grdVendors.CurrentPageIndex, grdVendors.PageSize, ref totalRecords);
                grdVendors.VirtualItemCount = totalRecords;
            }
            else
            {
                if (_searchField == "email")
                {
                    grdVendors.DataSource       = vendorController.GetVendorsByEmail(_searchFilter, portal, grdVendors.CurrentPageIndex, grdVendors.PageSize, ref totalRecords);
                    grdVendors.VirtualItemCount = totalRecords;
                }
                else
                {
                    grdVendors.DataSource       = vendorController.GetVendorsByName(_searchFilter, portal, grdVendors.CurrentPageIndex, grdVendors.PageSize, ref totalRecords);
                    grdVendors.VirtualItemCount = totalRecords;
                }
            }
        }
        private void SetDataSource()
        {
            CreateLetterSearch();

            bool isUnauthorized = false;
            if (_searchFilter.Equals(Localization.GetString("All"), StringComparison.InvariantCultureIgnoreCase))
            {
                _searchFilter = "";
            }
            else if (_searchFilter.Equals(Localization.GetString("Unauthorized"), StringComparison.InvariantCultureIgnoreCase))
            {
                _searchFilter = "";
                isUnauthorized = true;
            }
			
            //Get the list of vendors from the database
            var totalRecords = 0;
            var vendorController = new Dnn.Modules.Vendors.Components.VendorsController();
            int portal = Globals.IsHostTab(PortalSettings.ActiveTab.TabID) ? Null.NullInteger : PortalId;
            
			if (String.IsNullOrEmpty(_searchFilter))
			{
			    grdVendors.DataSource = vendorController.GetVendors(portal, isUnauthorized, grdVendors.CurrentPageIndex, grdVendors.PageSize, ref totalRecords);
			    grdVendors.VirtualItemCount = totalRecords;
			}
            else
            {
                if (_searchField == "email")
                {
                    grdVendors.DataSource = vendorController.GetVendorsByEmail(_searchFilter, portal, grdVendors.CurrentPageIndex, grdVendors.PageSize, ref totalRecords);
                    grdVendors.VirtualItemCount = totalRecords;
                }
                else
                {
                    grdVendors.DataSource = vendorController.GetVendorsByName(_searchFilter, portal, grdVendors.CurrentPageIndex, grdVendors.PageSize, ref totalRecords);
                    grdVendors.VirtualItemCount = totalRecords;
                }
            }
        }