角色管理器优化,可更改角色名,描述信息,客户端主界面测试中英文切换,v1.6.2
This commit is contained in:
111
ClientsLibrary/AccountSupport/FormInputNewRole.cs
Normal file
111
ClientsLibrary/AccountSupport/FormInputNewRole.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using CommonLibrary;
|
||||
|
||||
namespace ClientsLibrary
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 用户输入或者编辑新的角色内容
|
||||
/// </summary>
|
||||
public partial class FormInputNewRole : Form
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
|
||||
public FormInputNewRole()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Icon = UserClient.GetFormWindowIcon();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Form Load
|
||||
|
||||
|
||||
private void FormInputNewRole_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (m_RoleItem == null)
|
||||
{
|
||||
textBox1.Text = Guid.NewGuid().ToString("N");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Show Dialog
|
||||
|
||||
|
||||
public DialogResult ShowDialog(RoleItem roleItem)
|
||||
{
|
||||
// 此处是编辑
|
||||
m_RoleItem = roleItem;
|
||||
|
||||
if (m_RoleItem != null)
|
||||
{
|
||||
textBox1.Text = m_RoleItem.RoleCode;
|
||||
textBox2.Text = m_RoleItem.RoleName;
|
||||
textBox3.Text = m_RoleItem.Description;
|
||||
}
|
||||
|
||||
return ShowDialog();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Property
|
||||
|
||||
public RoleItem RoleItem
|
||||
{
|
||||
get { return m_RoleItem; }
|
||||
}
|
||||
|
||||
public string RoleName
|
||||
{
|
||||
get { return textBox2.Text; }
|
||||
}
|
||||
|
||||
public string RoleDescription
|
||||
{
|
||||
get { return textBox3.Text; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Members
|
||||
|
||||
private RoleItem m_RoleItem;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Save
|
||||
|
||||
|
||||
private void userButton_login_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(m_RoleItem == null)
|
||||
{
|
||||
m_RoleItem = new RoleItem()
|
||||
{
|
||||
RoleCode = textBox1.Text,
|
||||
RoleName = textBox2.Text,
|
||||
Description = textBox3.Text,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user