public void TestInitialized()
 {
     parameters = new OriginTaskParameters
     {
         taskId           = "5",
         operationsSelect = OriginTaskParameters.selectOperation.ProvideTaskInfo
     };
 }
Esempio n. 2
0
        /// <summary>
        /// Регистрирует статус результата выполнения задачи в Oracle.
        /// </summary>
        public void Complete()
        {
            OriginTaskParameters originParameters = new OriginTaskParameters
            {
                taskId     = taskDataPack.TaskId,
                taskStatus = taskStatusField
            };

            OriginTaskModel originTaskModel = new OriginTaskModel(originParameters);

            originTaskModel.Update();
        }
Esempio n. 3
0
        /// <summary>
        /// Устанавливает статус задачи в БД на "прервана".
        /// </summary>
        private void AbortTask()
        {
            OriginTaskParameters originParameters = new OriginTaskParameters
            {
                taskId     = taskDataPack.TaskId,
                taskStatus = -1
            };

            OriginTaskModel originTaskModel = new OriginTaskModel(originParameters);

            originTaskModel.Update();
        }
Esempio n. 4
0
        /// <summary>
        /// Проверяет полноту выполнения всех подзадач центральной задачи.
        /// </summary>
        public void Check()
        {
            // Заполняем параметры запроса.
            OriginTaskParameters originParameters = new OriginTaskParameters
            {
                taskId           = taskDataPack.TaskId,
                lastStartDate    = taskDataPack.LastStartDate,
                connectSettings  = string.Empty,
                operationsSelect = OriginTaskParameters.selectOperation.Check
            };

            OriginTaskModel originTaskModel = new OriginTaskModel(originParameters);

            originTaskModel.Select();

            taskStatusField = Convert.ToInt32(originTaskModel.ResultData.Rows[0][0]);
        }
Esempio n. 5
0
        /// <summary>
        /// Возвращает данные о задаче в рамках выполнения запроса к сервисам ГИС ЖКХ.
        /// А именно:
        /// <see cref="DataPack.Path"/>,
        /// <see cref="DataPack.AddOrgPpaGuid"/>,
        /// <see cref="DataPack.AddSignature"/>,
        /// <see cref="DataPack.TemplatePath"/>,
        /// <see cref="DataPack.Action"/>,
        /// <see cref="DataPack.TemplateResponsePath"/>,
        /// <see cref="DataPack.ActionResponce"/>,
        /// <see cref="DataPack.MethodVersion"/>.
        /// </summary>
        protected void ProvideTaskInfo()
        {
            // Создаем параметры модели.
            OriginTaskParameters originTaskParameters = new OriginTaskParameters
            {
                taskId           = taskDataPack.TaskId,
                connectSettings  = string.Empty,
                operationsSelect = OriginTaskParameters.selectOperation.ProvideTaskInfo
            };

            // Скармливаем конструктору.
            OriginTaskModel originTaskModel = new OriginTaskModel(originTaskParameters);

            // Выполняем выборку данных.
            originTaskModel.Select();

            // Заполняем параметры задачи полученными из БД данными.
            taskDataPack.Path                 = originTaskModel.ResultData.Rows[0].Field <string>("PATH");
            taskDataPack.TemplatePath         = originTaskModel.ResultData.Rows[0].Field <string>("REQUEST_PATH");
            taskDataPack.Action               = originTaskModel.ResultData.Rows[0].Field <string>("REQUEST_ACTION");
            taskDataPack.TemplateResponsePath = originTaskModel.ResultData.Rows[0].Field <string>("RESPONSE_PATH");
            taskDataPack.ActionResponce       = originTaskModel.ResultData.Rows[0].Field <string>("RESPONSE_ACTION");
            taskDataPack.MethodVersion        = originTaskModel.ResultData.Rows[0].Field <string>("VERSION");
            taskDataPack.OrgPPAGUID           = originTaskModel.ResultData.Rows[0].Field <string>("ORG_PPAGUID");

            taskDataPack.AddOrgPpaGuid = Convert.ToBoolean(originTaskModel.ResultData.Rows[0].Field <System.Int16>("ADD_ORG_PPA_GUID"));
            taskDataPack.AddSignature  = Convert.ToBoolean(originTaskModel.ResultData.Rows[0].Field <System.Int16>("ADD_SIGNATURE"));

#if DEBUG
            Notificator.Write("PATH: " + taskDataPack.Path + " " +
                              "REQUEST_PATH: " + taskDataPack.TemplatePath + " " +
                              "REQUEST_ACTION: " + taskDataPack.Action + " " +
                              "RESPONSE_PATH: " + taskDataPack.TemplateResponsePath + " " +
                              "RESPONSE_ACTION: " + taskDataPack.ActionResponce + " " +
                              "VERSION: " + taskDataPack.MethodVersion + " " +
                              "ORG_PPAGUID: " + taskDataPack.OrgPPAGUID + " " +
                              "ADD_ORG_PPA_GUID: " + taskDataPack.AddOrgPpaGuid.ToString() + " " +
                              "ADD_SIGNATURE: " + taskDataPack.AddSignature.ToString()
                              );
#endif
        }