public void WriteXml(XmlWriter writer)
 {
     writer.WriteStartElement("portalAlias");
     writer.WriteElementString("portalID", PortalID.ToString());
     writer.WriteElementString("portalAliasID", PortalAliasID.ToString());
     writer.WriteElementString("HTTPAlias", HTTPAlias);
     writer.WriteEndElement();
 }
示例#2
0
 public override string ToString()
 {
     return
         //Unknown_28h.Bin + ", (" + Unknown_28h_8a.ToString() + ", " + Unknown_28h_8b.ToString() + "), " +
         (Unknown_00h.ToString() + ", " +
          //IndexFlags.ToString() + ", " +
          IndexCount.ToString() + ", " + //IndexUnk.ToString() + ", " +
          IndexID.ToString() + ", " + AreaID.ToString() + ", " +
          CellAABB.ToString() + ", " +
          Unknown_24h.Hex + ", " +
          Unknown_28h.Hex + ", " +
          //PartFlags.ToString() + ", " + //PartUnk1.ToString() + ", " +
          PartID.ToString() + ", " +
          PartUnk2.ToString() + ", " +
          PortalID.ToString());
 }
示例#3
0
        public void WriteXml(XmlWriter writer)
        {
            //Write start of main elemenst
            writer.WriteStartElement("portalAlias");

            //write out properties
            writer.WriteElementString("portalID", PortalID.ToString());
            writer.WriteElementString("portalAliasID", PortalAliasID.ToString());
            writer.WriteElementString("HTTPAlias", HTTPAlias);
            writer.WriteElementString("skin", Skin);
            writer.WriteElementString("cultureCode", CultureCode);
            writer.WriteElementString("browserType", BrowserType.ToString().ToLowerInvariant());
            writer.WriteElementString("primary", IsPrimary.ToString().ToLowerInvariant());

            //Write end of main element
            writer.WriteEndElement();
        }
示例#4
0
        /// <summary>
        /// Property access, initially provided for TokenReplace
        /// </summary>
        /// <param name="propertyName">Name of the Property</param>
        /// <param name="format">format string</param>
        /// <param name="formatProvider">format provider for numbers, dates, currencies</param>
        /// <param name="accessingUser">userinfo of the user, who queries the data (used to determine permissions)</param>
        /// <param name="currentScope">requested maximum access level, might be restricted due to user level</param>
        /// <param name="propertyNotFound">out: flag, if property could be retrieved.</param>
        /// <returns>current value of the property for this userinfo object</returns>
        public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound)
        {
            Scope internScope;

            if (UserID == -1 && currentScope > Scope.Configuration)
            {
                internScope = Scope.Configuration; //anonymous users only get access to displayname
            }
            else if (UserID != accessingUser.UserID && !isAdminUser(ref accessingUser) && currentScope > Scope.DefaultSettings)
            {
                internScope = Scope.DefaultSettings; //registerd users can access username and userID as well
            }
            else
            {
                internScope = currentScope; //admins and user himself can access all data
            }
            string outputFormat = format == string.Empty ? "g" : format;

            switch (propertyName.ToLowerInvariant())
            {
            case "verificationcode":
                if (internScope < Scope.SystemMessages)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                var ps   = PortalSecurity.Instance;
                var code = ps.Encrypt(Config.GetDecryptionkey(), PortalID + "-" + GetMembershipUserId());
                return(code.Replace("+", ".").Replace("/", "-").Replace("=", "_"));

            case "affiliateid":
                if (internScope < Scope.SystemMessages)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(AffiliateID.ToString(outputFormat, formatProvider));

            case "displayname":
                if (internScope < Scope.Configuration)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(PropertyAccess.FormatString(DisplayName, format));

            case "email":
                if (internScope < Scope.DefaultSettings)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(PropertyAccess.FormatString(Email, format));

            case "firstname":     //using profile property is recommended!
                if (internScope < Scope.DefaultSettings)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(PropertyAccess.FormatString(FirstName, format));

            case "issuperuser":
                if (internScope < Scope.Debug)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(IsSuperUser.ToString(formatProvider));

            case "lastname":     //using profile property is recommended!
                if (internScope < Scope.DefaultSettings)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(PropertyAccess.FormatString(LastName, format));

            case "portalid":
                if (internScope < Scope.Configuration)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(PortalID.ToString(outputFormat, formatProvider));

            case "userid":
                if (internScope < Scope.DefaultSettings)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(UserID.ToString(outputFormat, formatProvider));

            case "username":
                if (internScope < Scope.DefaultSettings)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(PropertyAccess.FormatString(Username, format));

            case "fullname":     //fullname is obsolete, it will return DisplayName
                if (internScope < Scope.Configuration)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(PropertyAccess.FormatString(DisplayName, format));

            case "roles":
                if (currentScope < Scope.SystemMessages)
                {
                    propertyNotFound = true;
                    return(PropertyAccess.ContentLocked);
                }
                return(PropertyAccess.FormatString(string.Join(", ", Roles), format));
            }
            propertyNotFound = true;
            return(string.Empty);
        }
示例#5
0
        public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound)
        {
            string outputFormat = string.Empty;

            if (format == string.Empty)
            {
                outputFormat = "g";
            }

            string lowerPropertyName = propertyName.ToLower();

            if (currentScope == Scope.NoSettings)
            {
                propertyNotFound = true;
                return(PropertyAccess.ContentLocked);
            }
            propertyNotFound = true;

            string result   = string.Empty;
            bool   isPublic = true;

            switch (lowerPropertyName)
            {
            case "tabid":
                propertyNotFound = false;
                result           = (TabID.ToString(outputFormat, formatProvider));
                break;

            case "taborder":
                isPublic         = false;
                propertyNotFound = false;
                result           = (TabOrder.ToString(outputFormat, formatProvider));
                break;

            case "portalid":
                propertyNotFound = false;
                result           = (PortalID.ToString(outputFormat, formatProvider));
                break;

            case "tabname":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(LocalizedTabName, format);
                break;

            case "isvisible":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsVisible, formatProvider));
                break;

            case "parentid":
                isPublic         = false;
                propertyNotFound = false;
                result           = (ParentId.ToString(outputFormat, formatProvider));
                break;

            case "level":
                isPublic         = false;
                propertyNotFound = false;
                result           = (Level.ToString(outputFormat, formatProvider));
                break;

            case "iconfile":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(IconFile, format);
                break;

            case "iconfilelarge":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(IconFileLarge, format);
                break;

            case "disablelink":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DisableLink, formatProvider));
                break;

            case "title":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Title, format);
                break;

            case "description":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Description, format);
                break;

            case "keywords":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(KeyWords, format);
                break;

            case "isdeleted":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsDeleted, formatProvider));
                break;

            case "url":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Url, format);
                break;

            case "skinsrc":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(SkinSrc, format);
                break;

            case "containersrc":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ContainerSrc, format);
                break;

            case "tabpath":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(TabPath, format);
                break;

            case "startdate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (StartDate.ToString(outputFormat, formatProvider));
                break;

            case "enddate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (EndDate.ToString(outputFormat, formatProvider));
                break;

            case "haschildren":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(HasChildren, formatProvider));
                break;

            case "refreshinterval":
                isPublic         = false;
                propertyNotFound = false;
                result           = (RefreshInterval.ToString(outputFormat, formatProvider));
                break;

            case "pageheadtext":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(PageHeadText, format);
                break;

            case "skinpath":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(SkinPath, format);
                break;

            case "skindoctype":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(SkinDoctype, format);
                break;

            case "containerpath":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ContainerPath, format);
                break;

            case "issupertab":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsSuperTab, formatProvider));
                break;

            case "fullurl":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(FullUrl, format);
                break;

            case "sitemappriority":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(SiteMapPriority.ToString(), format);
                break;
            }
            if (!isPublic && currentScope != Scope.Debug)
            {
                propertyNotFound = true;
                result           = PropertyAccess.ContentLocked;
            }
            return(result);
        }
示例#6
0
        public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound)
        {
            string outputFormat = string.Empty;

            if (format == string.Empty)
            {
                outputFormat = "g";
            }
            if (currentScope == Scope.NoSettings)
            {
                propertyNotFound = true;
                return(PropertyAccess.ContentLocked);
            }
            propertyNotFound = true;
            string result   = string.Empty;
            bool   isPublic = true;

            switch (propertyName.ToLowerInvariant())
            {
            case "portalid":
                propertyNotFound = false;
                result           = (PortalID.ToString(outputFormat, formatProvider));
                break;

            case "displayportalid":
                propertyNotFound = false;
                result           = (OwnerPortalID.ToString(outputFormat, formatProvider));
                break;

            case "tabid":
                propertyNotFound = false;
                result           = (TabID.ToString(outputFormat, formatProvider));
                break;

            case "tabmoduleid":
                propertyNotFound = false;
                result           = (TabModuleID.ToString(outputFormat, formatProvider));
                break;

            case "moduleid":
                propertyNotFound = false;
                result           = (ModuleID.ToString(outputFormat, formatProvider));
                break;

            case "moduledefid":
                isPublic         = false;
                propertyNotFound = false;
                result           = (ModuleDefID.ToString(outputFormat, formatProvider));
                break;

            case "moduleorder":
                isPublic         = false;
                propertyNotFound = false;
                result           = (ModuleOrder.ToString(outputFormat, formatProvider));
                break;

            case "panename":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(PaneName, format);
                break;

            case "moduletitle":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ModuleTitle, format);
                break;

            case "cachetime":
                isPublic         = false;
                propertyNotFound = false;
                result           = (CacheTime.ToString(outputFormat, formatProvider));
                break;

            case "cachemethod":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(CacheMethod, format);
                break;

            case "alignment":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Alignment, format);
                break;

            case "color":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Color, format);
                break;

            case "border":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Border, format);
                break;

            case "iconfile":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(IconFile, format);
                break;

            case "alltabs":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(AllTabs, formatProvider));
                break;

            case "isdeleted":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsDeleted, formatProvider));
                break;

            case "header":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Header, format);
                break;

            case "footer":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Footer, format);
                break;

            case "startdate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (StartDate.ToString(outputFormat, formatProvider));
                break;

            case "enddate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (EndDate.ToString(outputFormat, formatProvider));
                break;

            case "containersrc":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ContainerSrc, format);
                break;

            case "displaytitle":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DisplayTitle, formatProvider));
                break;

            case "displayprint":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DisplayPrint, formatProvider));
                break;

            case "displaysyndicate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DisplaySyndicate, formatProvider));
                break;

            case "iswebslice":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsWebSlice, formatProvider));
                break;

            case "webslicetitle":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(WebSliceTitle, format);
                break;

            case "websliceexpirydate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (WebSliceExpiryDate.ToString(outputFormat, formatProvider));
                break;

            case "webslicettl":
                isPublic         = false;
                propertyNotFound = false;
                result           = (WebSliceTTL.ToString(outputFormat, formatProvider));
                break;

            case "inheritviewpermissions":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(InheritViewPermissions, formatProvider));
                break;

            case "isshareable":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsShareable, formatProvider));
                break;

            case "isshareableviewonly":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsShareableViewOnly, formatProvider));
                break;

            case "desktopmoduleid":
                isPublic         = false;
                propertyNotFound = false;
                result           = (DesktopModuleID.ToString(outputFormat, formatProvider));
                break;

            case "friendlyname":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.FriendlyName, format);
                break;

            case "foldername":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.FolderName, format);
                break;

            case "description":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.Description, format);
                break;

            case "version":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.Version, format);
                break;

            case "ispremium":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsPremium, formatProvider));
                break;

            case "isadmin":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsAdmin, formatProvider));
                break;

            case "businesscontrollerclass":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.BusinessControllerClass, format);
                break;

            case "modulename":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.ModuleName, format);
                break;

            case "supportedfeatures":
                isPublic         = false;
                propertyNotFound = false;
                result           = (DesktopModule.SupportedFeatures.ToString(outputFormat, formatProvider));
                break;

            case "compatibleversions":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.CompatibleVersions, format);
                break;

            case "dependencies":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.Dependencies, format);
                break;

            case "permissions":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.Permissions, format);
                break;

            case "defaultcachetime":
                isPublic         = false;
                propertyNotFound = false;
                result           = (ModuleDefinition.DefaultCacheTime.ToString(outputFormat, formatProvider));
                break;

            case "modulecontrolid":
                isPublic         = false;
                propertyNotFound = false;
                result           = (ModuleControlId.ToString(outputFormat, formatProvider));
                break;

            case "controlsrc":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ModuleControl.ControlSrc, format);
                break;

            case "controltitle":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ModuleControl.ControlTitle, format);
                break;

            case "helpurl":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ModuleControl.HelpURL, format);
                break;

            case "supportspartialrendering":
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(ModuleControl.SupportsPartialRendering, formatProvider));
                break;

            case "containerpath":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ContainerPath, format);
                break;

            case "panemoduleindex":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PaneModuleIndex.ToString(outputFormat, formatProvider));
                break;

            case "panemodulecount":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PaneModuleCount.ToString(outputFormat, formatProvider));
                break;

            case "isdefaultmodule":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsDefaultModule, formatProvider));
                break;

            case "allmodules":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(AllModules, formatProvider));
                break;

            case "isportable":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsPortable, formatProvider));
                break;

            case "issearchable":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsSearchable, formatProvider));
                break;

            case "isupgradeable":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsUpgradeable, formatProvider));
                break;

            case "adminpage":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.AdminPage, format);
                break;

            case "hostpage":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DesktopModule.HostPage, format);
                break;
            }
            if (!isPublic && currentScope != Scope.Debug)
            {
                propertyNotFound = true;
                result           = PropertyAccess.ContentLocked;
            }
            return(result);
        }
示例#7
0
        /// <summary>
        /// Gets the SQL select.
        /// </summary>
        /// <returns></returns>
        public string GetSqlSelect()
        {
            StringBuilder select = new StringBuilder("", 1000);

            select.Append(" SELECT");
            if (MaxHits > 0)
            {
                select.Append(" TOP " + MaxHits);
            }
            select.Append(" ");
            select.Append(SelectFieldList);
            if (SupportsWorkflow && WorkflowVersion == WorkFlowVersion.Staging)
            {
                select.Append(" FROM " + ItemTableName + "_st itm");
            }
            else
            {
                select.Append(" FROM " + ItemTableName + " itm");
            }

            if (DataSource == DataSourceType.This)
            {
                // Note that there at this point are only one single moduleid in ModuleList!
                select.Append(" WHERE itm.ModuleID = " + ModuleList + "");
            }
            else
            {
                select.Append(", rb_Modules mod, rb_ModuleDefinitions modDef");
                if (_userID > -1)
                {
                    select.Append(", rb_Roles, rb_UserRoles");
                }

                if (DataSource == DataSourceType.List)
                {
                    if (AllNotInList)
                    {
                        select.Append(" WHERE itm.ModuleID NOT IN (" + ModuleList + ")");
                    }
                    else
                    {
                        select.Append(" WHERE itm.ModuleID IN (" + ModuleList + ")");
                    }
                }
                else
                if (AllNotInList)
                {
                    select.Append(" WHERE itm.ModuleID NOT IN (" + ModuleList + ")");
                }
                else
                {
                    select.Append(" WHERE 1=1");
                }

                if (MobileOnly)
                {
                    select.Append(" AND Mod.ShowMobile=1");
                }

                select.Append(" AND itm.ModuleID = mod.ModuleID");
                select.Append(" AND mod.ModuleDefID = modDef.ModuleDefID");
                select.Append(" AND modDef.PortalID = " + PortalID.ToString());
                if (_userID > -1)
                {
                    select.Append(" AND rb_UserRoles.UserID = " + _userID.ToString());
                    select.Append(" AND rb_UserRoles.RoleID = rb_Roles.RoleID");
                    select.Append(" AND rb_Roles.PortalID = " + _portalID.ToString());
                    select.Append(" AND ((mod.AuthorizedViewRoles LIKE '%All Users%') OR (mod.AuthorizedViewRoles LIKE '%'+rb_Roles.RoleName+'%'))");
                }
                else
                {
                    select.Append(" AND (mod.AuthorizedViewRoles LIKE '%All Users%')");
                }
            }

            // Why this? Because some Rb modules inserts a record containing null value fields! :o(
            select.Append(" AND itm." + TitleFieldName + " IS NOT NULL");

            if (SearchString != "")
            {
                select.Append(" AND (");
                if (SearchField == "All")
                {
                    string[] arrField   = _searchFieldList.Split(';');
                    bool     firstField = true;
                    foreach (string field in arrField)
                    {
                        if (firstField)
                        {
                            firstField = false;
                        }
                        else
                        {
                            select.Append(" OR ");
                        }
                        select.Append("itm." + field + " like '%" + SearchString + "%'");
                    }
                }
                else
                {
                    select.Append("itm." + SearchField + " like '%" + SearchString + "%'");
                }
                select.Append(")");
            }
            select.Append(" ORDER BY itm." + SortField + " " + SortDirection);

            return(select.ToString());
        }