2017-10-07 10:52:36 +08:00
|
|
|
|
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();
|
|
|
|
|
|
|
2017-10-15 16:04:28 +08:00
|
|
|
|
Icon = UserSystem.GetFormWindowIcon();
|
2017-10-07 10:52:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2017-10-07 21:32:23 +08:00
|
|
|
|
#region Localization Support
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 本地化显示的操作,还未完成
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void UILocalization()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_RoleItem == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text = UserLocalization.Localization.AccountRoleAdd;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Text = UserLocalization.Localization.AccountRoleEdit;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
label1.Text = UserLocalization.Localization.GeneralUniqueID + ":";
|
|
|
|
|
|
label2.Text = UserLocalization.Localization.GeneralName + ":";
|
|
|
|
|
|
label3.Text = UserLocalization.Localization.GeneralDescription + ":";
|
|
|
|
|
|
|
|
|
|
|
|
userButton_login.UIText = UserLocalization.Localization.ButtonEnsure;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Form Load Show
|
2017-10-07 10:52:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void FormInputNewRole_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_RoleItem == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
textBox1.Text = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-07 21:32:23 +08:00
|
|
|
|
private void FormInputNewRole_Shown(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
UILocalization();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-07 10:52:36 +08:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Show Dialog
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DialogResult ShowDialog(RoleItem roleItem)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 此处是编辑
|
|
|
|
|
|
m_RoleItem = roleItem;
|
2017-10-07 21:32:23 +08:00
|
|
|
|
|
2017-10-07 10:52:36 +08:00
|
|
|
|
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
|
2017-10-07 21:32:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 10:52:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|