完善一些事件处理

This commit is contained in:
dathlin
2017-07-12 10:25:23 +08:00
parent 6d79df3582
commit 0022c081d4
2 changed files with 167 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
using CommonLibrary;
using HslCommunication;
using HslCommunication.BasicFramework;
using HslCommunication.Enthernet;
using Newtonsoft.Json.Linq;
@@ -59,8 +60,151 @@ namespace 软件系统客户端Wpf
}
#region
private void MenuItem公告管理_Click(object sender, RoutedEventArgs e)
{
using (FormInputAndAction fiaa = new FormInputAndAction(str => UserClient.Net_simplify_client.ReadFromServer(
CommonHeadCode.SimplifyHeadCode., str).IsSuccess, UserClient.Announcement, "请输入公告内容"))
{
fiaa.ShowDialog();
}
}
private void MenuItem账户管理_Click(object sender, RoutedEventArgs e)
{
FormAccountManage fam = new FormAccountManage(() =>
{
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.);
if (result.IsSuccess) return result.Content;
else return result.ToMessageShowString();
}, m => UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode., m).IsSuccess);
fam.ShowDialog();
fam.Dispose();
}
private void MenuItem注册账户_Click(object sender, RoutedEventArgs e)
{
//using (FormRegisterAccount fra = new FormRegisterAccount())
//{
// fra.ShowDialog();
//}
}
private void MenuItem日志查看_Click(object sender, RoutedEventArgs e)
{
}
private void MenuItem远程更新_Click(object sender, RoutedEventArgs e)
{
if (UserClient.UserAccount.UserName == "admin")
{
//using (FormUpdateRemote fur = new FormUpdateRemote())
//{
// fur.ShowDialog();
//}
}
else
{
MessageBox.Show("权限不足!");
}
}
private void MenuItem消息发送_Click(object sender, RoutedEventArgs e)
{
using (FormInputAndAction fiaa = new FormInputAndAction(str => UserClient.Net_simplify_client.ReadFromServer(
CommonHeadCode.SimplifyHeadCode., UserClient.UserAccount.UserName + ":" + str).IsSuccess, "", "请输入群发的消息:"))
{
fiaa.ShowDialog();
}
}
private void MenuItem开发中心_Click(object sender, RoutedEventArgs e)
{
using (FormSuper fs = new FormSuper(() =>
{
OperateResultBytes result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode., new byte[0]);
//解析
if (result.IsSuccess)
{
int[] data = new int[result.Content.Length / 4];
for (int i = 0; i < data.Length; i++)
{
data[i] = BitConverter.ToInt32(result.Content, i * 4);
}
return data;
}
else
{
return null;
}
}))
{
fs.ShowDialog();
}
}
private void MenuItem密码更改_Click(object sender, RoutedEventArgs e)
{
using (FormPasswordModify fpm = new FormPasswordModify(UserClient.UserAccount.Password,
p =>
{
JObject json = new JObject
{
{ UserAccount.UserNameText, UserClient.UserAccount.UserName },
{ UserAccount.PasswordText, p }
};
return UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode., json.ToString()).IsSuccess;
}, 6, 8))
{
fpm.ShowDialog();
}
}
private void MenuItem聊天信息_Click(object sender, RoutedEventArgs e)
{
}
private void MenuItem头像更改_Click(object sender, RoutedEventArgs e)
{
}
private void MenuItem关于本软件_Click(object sender, RoutedEventArgs e)
{
using (FormAbout fa = new FormAbout(Resource.StringResouce.SoftName,
UserClient.CurrentVersion, 2017, Resource.StringResouce.SoftCopyRight))
{
fa.ShowDialog();
}
}
private void MenuItem更新日志_Click(object sender, RoutedEventArgs e)
{
}
private void MenuItem版本号说明_Click(object sender, RoutedEventArgs e)
{
}
private void MenuItem意见反馈_Click(object sender, RoutedEventArgs e)
{
using (FormInputAndAction fiaa = new FormInputAndAction(str => UserClient.Net_simplify_client.ReadFromServer(
CommonHeadCode.SimplifyHeadCode., UserClient.UserAccount.UserName + ":" + str).IsSuccess, "", "请输入意见反馈:"))
{
fiaa.ShowDialog();
}
}
#endregion
#region
@@ -194,15 +338,16 @@ namespace 软件系统客户端Wpf
}
#endregion
}
}