コード例 #1
0
        } // updateNextDueDate()

        public void setLastFutureDate()
        {
            if (_UpdateFutureTasks)
            {
                CswNbtActGenerateFutureNodes CswNbtActGenerateFutureNodes = new CswNbtActGenerateFutureNodes(_CswNbtResources);

                DateTime LatestFutureDate = CswNbtActGenerateFutureNodes.getDateOfLastExistingFutureNode(_CswNbtNode);
                if (LatestFutureDate > DateTime.MinValue)
                {
                    CswNbtActGenerateFutureNodes.deleteExistingFutureNodes(_CswNbtNode);
                    CswNbtActGenerateFutureNodes.makeNodesBatch(_CswNbtNode, LatestFutureDate);
                } //if there are future nodes
            }
        }         // _setLastFutureDate()
コード例 #2
0
        public JObject futureScheduling(CswCommaDelimitedString SelectedGeneratorNodeKeys, DateTime EndDate)
        {
            JObject ret = new JObject();

            CswNbtActGenerateFutureNodes CswNbtActGenerateFutureNodes = new CswNbtActGenerateFutureNodes(_CswNbtResources);

            Collection <CswNbtObjClassBatchOp> BatchNodes = new Collection <CswNbtObjClassBatchOp>();

            foreach (string NodeKeyStr in SelectedGeneratorNodeKeys)
            {
                CswNbtNodeKey CurrentNodeKey       = new CswNbtNodeKey(NodeKeyStr);
                CswNbtNode    CurrentGeneratorNode = _CswNbtResources.Nodes[CurrentNodeKey.NodeId];
                BatchNodes.Add(CswNbtActGenerateFutureNodes.makeNodesBatch(CurrentGeneratorNode, EndDate));
            }//iterate selected Generator notes

            if (BatchNodes.Count > 0)
            {
                ret["result"] = BatchNodes.Count.ToString();

                CswNbtView BatchOpsView = new CswNbtView(_CswNbtResources);
                BatchOpsView.ViewName = "New Batch Operations";
                BatchOpsView.ViewMode = CswEnumNbtViewRenderingMode.Tree;
                CswNbtViewRelationship BatchRel = BatchOpsView.AddViewRelationship(BatchNodes[0].NodeType, false);
                foreach (CswNbtObjClassBatchOp BatchNode in BatchNodes)
                {
                    if (BatchNode != null)
                    {
                        BatchRel.NodeIdsToFilterIn.Add(BatchNode.NodeId);
                    }
                }

                CswNbtWebServiceTree ws = new CswNbtWebServiceTree(_CswNbtResources, BatchOpsView);
                ret["treedata"] = ws.runTree(null, null, false, true, string.Empty);

                BatchOpsView.SaveToCache(true);
                ret["sessionviewid"] = BatchOpsView.SessionViewId.ToString();
                ret["viewmode"]      = BatchOpsView.ViewMode.ToString();
            }

            return(ret);
        } // futureScheduling()