客户端新增系统配置界面,集中处理系统配置功能,完成信任客户端列表功能,v1.4.7

This commit is contained in:
dathlin
2017-09-24 12:42:45 +08:00
parent 8f779ca4de
commit f5a76a7e43
26 changed files with 940 additions and 74 deletions

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HslCommunication;
using Newtonsoft.Json.Linq;
namespace ClientsLibrary.Configuration
{
public partial class GeneralConfiguration : UserControl
{
public GeneralConfiguration()
{
InitializeComponent();
}
private void GeneralConfiguration_Load(object sender, EventArgs e)
{
// 初始化
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode., "");
if (result.IsSuccess)
{
JObject json = JObject.Parse(result.Content);
checkBox1.Checked = HslCommunication.BasicFramework.SoftBasic.GetValueFromJsonObject(json, "AllowUserMulti", false);
}
else
{
MessageBox.Show("请求服务器失败,请稍后重试!");
userButton2.Enabled = false;
}
}
private void userButton2_Click(object sender, EventArgs e)
{
JObject json = new JObject
{
{ "AllowUserMulti", new JValue(checkBox1.Checked) },
};
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(
CommonLibrary.CommonHeadCode.SimplifyHeadCode., json.ToString());
if (result.IsSuccess)
{
MessageBox.Show("上传成功!");
}
else
{
MessageBox.Show("上传失败!");
}
}
}
}