Exemple #1
0
        private void 账户管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //该部分比较复杂,需要对委托,匿名委托概念比较清晰
            FormAccountManage fam = new FormAccountManage(() => UserServer.ServerAccounts.GetAllAccountsJson(),
                                                          m => { UserServer.ServerAccounts.LoadAllAccountsJson(m); return(true); });

            fam.ShowDialog();
            fam.Dispose();
        }
        private void 账户管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormAccountManage fam = new FormAccountManage(() =>
            {
                OperateResult <string> 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();
        }