提交 1ec5d80f 编写于 作者: Richard__Hu's avatar Richard__Hu

ClientsLibrary中提供的账户选择功能,支持选择所有,按工厂选择,按角色选择。

上级 5a5aeca1
......@@ -16,13 +16,18 @@ namespace ClientsLibrary
{
#region Constructor
public FormAccountSelect(List<string> selected = null)
/// <summary>
/// 实例化一个选择服务器账户的窗口,该窗口可以根据工厂属性或是角色属性来筛选
/// </summary>
/// <param name="condition"></param>
/// <param name="selected"></param>
public FormAccountSelect(string condition = null, List<string> selected = null)
{
InitializeComponent();
Icon = UserSystem.GetFormWindowIcon();
m_selected = selected;
m_condition = condition;
}
......@@ -35,7 +40,7 @@ namespace ClientsLibrary
{
// 初始化
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户, "");
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户, m_condition);
if (result.IsSuccess)
{
List<UserAccount> accounts = JArray.Parse(result.Content).ToObject<List<UserAccount>>();
......@@ -136,6 +141,7 @@ namespace ClientsLibrary
private List<string> m_selected;
private List<UserAccount> m_result;
private string m_condition;
#endregion
......
......@@ -183,9 +183,9 @@ namespace ClientsLibrary.Configuration
if (listBox1.SelectedItem is RoleItem role)
{
// select account
using (FormAccountSelect form = new FormAccountSelect(role.Accounts))
using (FormAccountSelect form = new FormAccountSelect(null, role.Accounts))
{
if(form.ShowDialog() == DialogResult.OK)
if (form.ShowDialog() == DialogResult.OK)
{
role.Accounts = form.SelectAccounts.ConvertAll(m => m.UserName);
listBox2.DataSource = role.Accounts;
......
......@@ -42,7 +42,7 @@ namespace CommonLibrary
*
**************************************************************************/
SoftBasic.FrameworkVersion = new SystemVersion("1.6.14");
SoftBasic.FrameworkVersion = new SystemVersion("1.6.15");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册