Exemplo n.º 1
0
        private void btQueryTaskStatus_Click(object sender, EventArgs e)
        {
            this.swordHost = this.tbSwordHost.Text;
            if (this.swordHost == "")
            {
                MessageBox.Show("Sword host is null");
                return;
            }

            string taskIDListString = this.tbTaskID.Text;

            if (taskIDListString == "")
            {
                MessageBox.Show("Task ID is null");
                return;
            }

            this.taskIDList = taskIDListString.Split(',').ToList();
            if (this.taskIDList.Count == 0)
            {
                MessageBox.Show("Task ID is null");
                return;
            }

            string response = "";
            Error  err      = HttpAPI.QueryTaskStatus(this.swordHost, this.taskIDList, ref response);

            if (ErrorCode.ErrNoError != err.code)
            {
                MessageBox.Show("API call error");
                return;
            }

            this.tbAPIResult.Text = FormatJsonString(response);
        }
Exemplo n.º 2
0
        private void btCreateTask_Click(object sender, EventArgs e)
        {
            this.swordHost = this.tbSwordHost.Text;
            if (this.swordHost == "")
            {
                MessageBox.Show("Sword host is null");
                return;
            }

            this.taskPara = this.tbTaskInfo.Text;
            if (this.taskPara == "")
            {
                MessageBox.Show("Task information is null");
                return;
            }

            string response = "";
            Error  err      = HttpAPI.CreateTask(this.swordHost, this.taskPara, ref response);

            if (ErrorCode.ErrNoError != err.code)
            {
                MessageBox.Show("API call error");
                return;
            }

            this.tbAPIResult.Text = FormatJsonString(response);
        }
Exemplo n.º 3
0
        private void btQueryTaskCapacity_Click(object sender, EventArgs e)
        {
            this.swordHost = this.tbSwordHost.Text;
            if (this.swordHost == "")
            {
                MessageBox.Show("Sword host is null");
                return;
            }

            string response = "";
            Error  err      = HttpAPI.QueryTaskCapacity(this.swordHost, ref response);

            if (ErrorCode.ErrNoError != err.code)
            {
                MessageBox.Show("API call error");
                return;
            }

            this.tbAPIResult.Text = FormatJsonString(response);
        }