Example #1
0
        internal Dictionary <String, String> GetCheckBoxDetailsForDocumentType(String documentType)
        {
            WBQuery query = new WBQuery();

            query.AddEqualsFilter(WBColumn.DocumentType, documentType);
            query.AddEqualsFilter(WBColumn.UseCheckBox, true);
            query.OrderByAscending(WBColumn.Order);

            SPList checkBoxDetailsList = Libraries.ProtectedMasterLibrary.Web.Lists.TryGetList(CHECK_BOXES_LIST_TITLE);
            SPListItemCollection items = checkBoxDetailsList.WBxGetItems(Libraries.ProtectedMasterLibrary.Site, query);

            Dictionary <String, String> checkBoxDetails = new Dictionary <String, String>();

            foreach (SPListItem item in items)
            {
                checkBoxDetails.Add(item.WBxGetAsString(WBColumn.CheckBoxCode), item.WBxGetAsString(WBColumn.CheckBoxText));
            }

            return(checkBoxDetails);
        }
Example #2
0
        internal WBQuery GetQueryForTeamsPublicRecordsToArchiveInFutureWeek(WBTeam team, int weekInFuture, bool limitToJustOneWeek)
        {
            WBQuery query = new WBQuery();

            if (team != null)
            {
                query.AddEqualsFilter(WBColumn.OwningTeam, team);
            }
            query.AddEqualsFilter(WBColumn.LiveOrArchived, WBColumn.LIVE_OR_ARCHIVED__LIVE);
            query.AddEqualsFilter(WBColumn.ProtectiveZone, WBRecordsType.PROTECTIVE_ZONE__PUBLIC);
            query.AddEqualsFilter(WBColumn.RecordSeriesStatus, WBColumn.RECORD_SERIES_STATUS__LATEST);

            query.OrderByAscending(WBColumn.ReviewDate);

            if (limitToJustOneWeek && weekInFuture > 1)
            {
                query.AddFilter(WBColumn.ReviewDate, WBQueryClause.Comparators.GreaterThanEquals, DateTime.Now.AddDays((-_weeksBetweenReviewDateAndAutoArchival + weekInFuture - 1) * 7));
            }

            query.AddFilter(WBColumn.ReviewDate, WBQueryClause.Comparators.LessThan, DateTime.Now.AddDays((-_weeksBetweenReviewDateAndAutoArchival + weekInFuture) * 7));
            query.RecursiveAll = true;

            return(query);
        }