コード例 #1
0
        public static void Produce(ContractQueueItem QueueItem)
        {
            //add to queue
            //Check if existing queue item exists.
            if (Queue.Where(item => item.ContractRefID == QueueItem.ContractRefID).Any())
                return; //Todo: should really override old/existing queue item!

            Queue.Add(QueueItem);
        }
コード例 #2
0
        public static void InitQueue()
        {
            for (int i = 0; i < 5; i++)
            {
                ContractQueueItem item = new ContractQueueItem
                {
                    ContractRefID = i,
                    ErrorCount = 0,
                    Inserted = DateTime.Today,
                    LastErrorReason = "",
                    processed = null,
                    QueueID = i,
                    QueueRefID = i,
                    QueueRefType = "",
                    QueueType = QueueType.Activate
                };

                Queue.Add(item);
            }
        }
コード例 #3
0
        public void Index(Contract contract)
        {
            if (contract.ContractStatus == QueueType.Activate)
            {
                ContractQueueItem queueItem = new ContractQueueItem {
                    ContractRefID = 1,
                    ErrorCount = 0,
                    Inserted = DateTime.Today,
                    LastErrorReason = "",
                    processed = null,
                    QueueID = 1,
                    QueueRefID = 1,
                    QueueRefType = "",
                    QueueType = QueueType.Activate
                };

                ContractQueue.Produce(queueItem);
            }
            else if (contract.ContractStatus == QueueType.Deactivate)
            {
                ContractQueueItem queueItem = new ContractQueueItem
                {
                    ContractRefID = 1,
                    ErrorCount = 0,
                    Inserted = DateTime.Today,
                    LastErrorReason = "",
                    processed = null,
                    QueueID = 1,
                    QueueRefID = 1,
                    QueueRefType = "",
                    QueueType = QueueType.Deactivate
                };

                ContractQueue.Produce(queueItem);
            }
        }