Exemplo n.º 1
0
        private void GetTasks()
        {
            Client = new QRSNTLMWebClient(_serverURL);

            if (_searchTerm != null)
            {
                Dictionary <string, string> param = new Dictionary <string, string>();
                param.Add("filter", "name eq '" + _searchTerm + "'");

                _Tasks = JsonConvert.DeserializeObject <List <task> >(Client.Get("/qrs/task", param));
            }
            else
            {
                _Tasks = JsonConvert.DeserializeObject <List <task> >(Client.Get("/qrs/task"));
            }
        }
Exemplo n.º 2
0
        private void GetObjectList()
        {
            Client = new QRSNTLMWebClient(_serverURL);

            System.Diagnostics.Debugger.Launch();

            if (_searchTerm != null)
            {
                Dictionary <string, string> param = new Dictionary <string, string>();
                param.Add("filter", "name eq '" + _searchTerm + "'");

                ObjectList = JsonConvert.DeserializeObject <List <object> >(Client.Get("/qrs/" + _objecttype, param));
            }
            else
            {
                ObjectList = JsonConvert.DeserializeObject <List <object> >(Client.Get("/qrs/" + _objecttype));
            }
        }
Exemplo n.º 3
0
        private void CheckTask()
        {
            System.Diagnostics.Debugger.Launch();

            Client = new QRSNTLMWebClient(_serverURL);

            if (TaskID != null)
            {
                string findtask;
                findtask = Client.Get("/qrs/reloadtask/" + TaskID);
                reloadtask task = JsonConvert.DeserializeObject <reloadtask>(findtask);

                Dictionary <string, string> filter = new Dictionary <string, string>();
                filter.Add("filter", "ExecutionID eq " + task.operational.lastExecutionResult.id);

                string checkexec;
                checkexec = Client.Get("/qrs/executionresult/full", filter);
                List <executionresult> execresults = JsonConvert.DeserializeObject <List <executionresult> >(checkexec);
                _taskresult = execresults[0];

                return;
            }

            if (ExecutionID != null)
            {
                Dictionary <string, string> filter = new Dictionary <string, string>();
                filter.Add("filter", "ExecutionID eq " + ExecutionID);

                string checkexec;
                checkexec = Client.Get("/qrs/executionresult/full", filter);
                List <executionresult> execresults = JsonConvert.DeserializeObject <List <executionresult> >(checkexec);
                _taskresult = execresults[0];
                return;
            }

            throw new Exception("TaskID or ExecutionID not supplied");
        }
Exemplo n.º 4
0
        private void StartTask()
        {
            taskstartresult startresult;

            Client = new QRSNTLMWebClient(_serverURL);

            if (_TaskID != null || _TaskName != null)
            {
                if (_TaskID != null)
                {
                    startresult = JsonConvert.DeserializeObject <taskstartresult>(Client.Post("/qrs/task/" + _TaskID + "/start/synchronous", ""));
                }
                else
                {
                    Dictionary <string, string> param = new Dictionary <string, string>();
                    param.Add("filter", "name eq '" + _TaskName + "'");
                    List <task> searchtasks = JsonConvert.DeserializeObject <List <task> >(Client.Get("/qrs/task/", param));

                    if (searchtasks.Count == 0 || searchtasks.Count > 1)
                    {
                        throw new Exception("Either no task found or multiple tasks found");
                    }

                    startresult = JsonConvert.DeserializeObject <taskstartresult>(Client.Post("/qrs/task/" + searchtasks[0].ID + "/start/synchronous", ""));
                }

                Dictionary <string, string> filter = new Dictionary <string, string>();
                filter.Add("filter", "ExecutionID eq " + startresult.value);


                string checkexec;
                checkexec = Client.Get("/qrs/executionresult/full", filter);
                List <executionresult> execresults = JsonConvert.DeserializeObject <List <executionresult> >(checkexec);
                _taskresult = execresults[0];

                return;
            }

            throw new Exception("task id or task name not supplied");
        }