Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parseResult"></param>
        private void ProcessXGUploadRecordResult(XGDevice xgdevice, IParseResult pr)
        {
            ProcessXGDeviceRecordHelp(xgdevice, pr, false);

            IOperaFactory operaFactory = xgdevice.Dpu.OperaFactory;
            IOpera        op           = operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.RemoveUpload);
            //ITaskFactory taskFactory = xgdevice.Dpu.TaskFactory;

            Task task = new Task(xgdevice, op, new ImmediateStrategy(), 1);

            xgdevice.TaskManager.Tasks.Enqueue(task);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="st"></param>
        /// <param name="parseResult"></param>
        private void ProcessXGReadRecordCountResult(XGDevice xgdevice, IParseResult pr)
        {
            IOperaFactory operaFactory = xgdevice.Dpu.OperaFactory;
            int           count        = Convert.ToInt32(pr.Results["recordcount"]);

            if (count > 0)
            {
                for (int i = 1; i < count + 1; i++)
                {
                    Opera op = (Opera)operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.ReadRecord);
                    op.SendPart["recordidx"] = i;

                    Task task = new Task(xgdevice, op, new ImmediateStrategy(), 2);
                    xgdevice.TaskManager.Tasks.Enqueue(task);
                }

                Opera clearOP = (Opera)operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.ClearRecord);

                Task clearTask = new Task(xgdevice, clearOP, new ImmediateStrategy(), 1);
                xgdevice.TaskManager.Tasks.Enqueue(clearTask);
            }
        }