示例#1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            ConfSonWebPandaPumpDataService info = new ConfSonWebPandaPumpDataService();

            if (string.IsNullOrWhiteSpace(txt_appKey.Text))
            {
                MessageBox.Show("appKey不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (string.IsNullOrWhiteSpace(txt_appSecret.Text))
            {
                MessageBox.Show("appSecret不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (string.IsNullOrWhiteSpace(txt_getTokenUrl.Text))
            {
                MessageBox.Show("TokenUrl不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (string.IsNullOrWhiteSpace(txt_getDataUrl.Text))
            {
                MessageBox.Show("DataUrl不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (string.IsNullOrWhiteSpace(txt_useName.Text))
            {
                MessageBox.Show("useName不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            info.AppKey                = txt_appKey.Text;
            info.AppSecret             = txt_appSecret.Text;
            info.GetTokenUrl           = txt_getTokenUrl.Text;
            info.GetDataUrl            = txt_getDataUrl.Text;
            info.UseName               = txt_useName.Text;
            info.SaveInterVal          = Convert.ToInt32(txt_saveInterVal.Value);
            info.CollectInterval       = Convert.ToInt32(txt_collectInterval.Value);
            info.CommandTimeoutSeconds = Convert.ToInt32(txt_commandTimeoutSeconds.Value);

            if (config.SubmitSonWebPandaPumpData(info, out string errMsg))
            {
                MessageBox.Show("提交 WEB熊猫二供接入服务 配置信息成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
                evtSubmit("WEB熊猫二供接入服务", EnvConfigInfo.Status.success);
            }
            else
            {
                MessageBox.Show("提交 WEB熊猫二供接入服务 配置信息失败," + errMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                evtSubmit("WEB熊猫二供接入服务", EnvConfigInfo.Status.fail);
            }
        }
示例#2
0
        // 配置对象转化
        private PandaParam ToPandaParam(ConfSonWebPandaPumpDataService param)
        {
            return(new PandaParam()
            {
                appKey = param.AppKey,
                appSecret = param.AppSecret,
                getTokenUrl = param.GetTokenUrl,
                getDataUrl = param.GetDataUrl,
                useName = param.UseName,

                collectInterval = param.CollectInterval,
                saveInterVal = param.SaveInterVal
            });
        }
示例#3
0
 public WEBPandaPumpService(ConfSonWebPandaPumpDataService pandaPumpParam)
 {
     Config.pandaPumpParam = pandaPumpParam;
 }