ClientsLibrary中提供的账户选择功能,支持选择所有,按工厂选择,按角色选择。
This commit is contained in:
@@ -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");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user