// 配置对象转化 private PandaParam ToPandaParam(ConfSonWebPandaYLDataService 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 }); }
private void btnSubmit_Click(object sender, EventArgs e) { ConfSonWebPandaYLDataService info = new ConfSonWebPandaYLDataService(); 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.SubmitSonWebPandaYLData(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); } }
public WEBPandaYLSacdaService(ConfSonWebPandaYLDataService pandaYaLiParam) { Config.pandaYaLiParam = pandaYaLiParam; }