Ejemplo n.º 1
0
        private static SqlParameter[] GetPageSearchByServiceParams(SearchManager searcher,
                                                                   SqlIOAsync data)
        {
            int iIsForward = GeneralHelpers.ConvertStringToInt(searcher.IsForward);

            if (iIsForward != 1 || iIsForward != 0)
            {
                iIsForward = 1;
            }
            bool bNeedsTypeId = NeedsTypeIdSearchParam(searcher.SearchResult.URIDataManager.AppType);

            if (bNeedsTypeId)
            {
                SqlParameter[] oPrams2 =
                {
                    data.MakeInParam("@AccountId",   SqlDbType.Int,        4, searcher.SearchResult.URIMember.ClubInUse.PKId),
                    data.MakeInParam("@NetworkId",   SqlDbType.Int,        4, searcher.NetworkSelected.PKId),
                    data.MakeInParam("@NetworkType", SqlDbType.NVarChar,  25, searcher.NetworkType.ToString()),
                    data.MakeInParam("@Keywords",    SqlDbType.NVarChar, 255, searcher.Keywords),
                    data.MakeInParam("@IsForward",   SqlDbType.Bit,        1, iIsForward),
                    data.MakeInParam("@StartRow",    SqlDbType.Int,        4, searcher.StartRow),
                    data.MakeInParam("@PageSize",    SqlDbType.Int,        4, searcher.PageSize),
                    //filter for types
                    data.MakeInParam("@TypeId",      SqlDbType.Int,        4, searcher.TypeId),
                    data.MakeInParam("@ServiceId",   SqlDbType.Int,        4, searcher.ServiceSelected.ServiceId)
                };
                return(oPrams2);
            }
            else
            {
                SqlParameter[] oPrams3 =
                {
                    data.MakeInParam("@AccountId",   SqlDbType.Int,        4, searcher.SearchResult.URIMember.ClubInUse.PKId),
                    data.MakeInParam("@NetworkId",   SqlDbType.Int,        4, searcher.NetworkSelected.PKId),
                    data.MakeInParam("@NetworkType", SqlDbType.NVarChar,  25, searcher.NetworkType.ToString()),
                    data.MakeInParam("@Keywords",    SqlDbType.NVarChar, 255, searcher.Keywords),
                    data.MakeInParam("@IsForward",   SqlDbType.Bit,        1, iIsForward),
                    data.MakeInParam("@StartRow",    SqlDbType.Int,        4, searcher.StartRow),
                    data.MakeInParam("@PageSize",    SqlDbType.Int,        4, searcher.PageSize),
                    data.MakeInParam("@ServiceId",   SqlDbType.Int,        4, searcher.ServiceSelected.ServiceId)
                };
                return(oPrams3);
            }
        }
Ejemplo n.º 2
0
        public static int GetPageSize(ContentURI uri)
        {
            string sPageSize = string.Empty;
            int    iPageSize = 25;

            iPageSize = (uri.URIDataManager.PageSize <= 0) ?
                        iPageSize : uri.URIDataManager.PageSize;
            //edit panel has separate page size
            //linked views panel has to have same pagination or can't switch between panels
            //(i.e. when editing a custom doc that's number 11 in lv -won't find it in edit)
            if (uri.URIDataManager.ServerActionType == GeneralHelpers.SERVER_ACTION_TYPES.edit ||
                uri.URIDataManager.ServerActionType == GeneralHelpers.SERVER_ACTION_TYPES.linkedviews)
            {
                sPageSize = (!string.IsNullOrEmpty(uri.URIDataManager.PageSizeEdits)) ?
                            uri.URIDataManager.PageSizeEdits : "10";
                iPageSize = GeneralHelpers.ConvertStringToInt(sPageSize);
            }
            return(iPageSize);
        }
Ejemplo n.º 3
0
        public static string GetTempDocPath(ContentURI uri, bool isLocalCacheDirectory,
                                            string uriPattern, string tempURIPattern)
        {
            string sTempDocPath = string.Empty;
            //use uri.URIDataManager.TempDocURI to set subdirectory for holding
            //all related tempdocs (easy to package)
            string sRandomId  = ContentURI.GetURIPatternPart(tempURIPattern, ContentURI.URIPATTERNPART.id);
            string sNodeName  = ContentURI.GetURIPatternPart(tempURIPattern, ContentURI.URIPATTERNPART.node);
            string sDirectory = string.Empty;

            //ok to put empty uris in a "0" subfolder
            if (sRandomId != string.Empty &&
                sNodeName != GeneralHelpers.NONE &&
                sRandomId != "0")
            {
                //has a tempdoc to work with
                //uri.uridatamanager.tempdocuri's random urid is always subdir
                sDirectory = GetTempWebDirectory(uri, isLocalCacheDirectory,
                                                 GeneralHelpers.ConvertStringToInt(sRandomId));
            }
            else
            {
                //may be starting to build a tempdoc
                //need a random directory
                sDirectory = GetTempWebDirectory(uri, isLocalCacheDirectory,
                                                 GeneralHelpers.Get2RandomInteger());
            }
            string sDelimiter = FileStorageIO.GetDelimiterForFileStorage(sDirectory);
            //don't use uri.uriclubdocpath filename because it may not need to be set
            //for the selectedlinkedviewuri
            string sFileName = string.Concat(
                ContentHelper.MakeStandardFileNameFromURIPattern(uriPattern),
                GeneralHelpers.EXTENSION_XML);

            //make the tempdocpath
            sTempDocPath = string.Concat(sDirectory, sDelimiter,
                                         ContentHelper.MakeStandardFileNameFromURIPattern(uriPattern),
                                         GeneralHelpers.EXTENSION_XML);
            return(sTempDocPath);
        }