#region public override void FormOnLoad() 加载窗体
///<summary>
/// 加载窗体
///</summary>
publicoverridevoid FormOnLoad()
{
// 绑定下拉筐数据
this.BindItemDetails();
if (!string.IsNullOrEmpty(this.UserInfo.CompanyId))
{
this.ucCompany.SelectedId = this.UserInfo.CompanyId;
}
string isStaff = DotNetService.Instance.ParameterService.GetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "IsStaff");
if (!string.IsNullOrEmpty(isStaff))
{
this.chkIsStaff.Checked = true.ToString().Equals(isStaff);
}
string close = DotNetService.Instance.ParameterService.GetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "Close");
if (!string.IsNullOrEmpty(close))
{
this.chkClose.Checked = true.ToString().Equals(close);
}
string password = DotNetService.Instance.ParameterService.GetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "Password");
if (!string.IsNullOrEmpty(password))
{
if (password.Equals(this.rbtnUserInput.Name))
{
this.rbtnUserInput.Checked = true;
}
elseif (password.Equals(this.rbtnDefaultPassword.Name))
{
this.rbtnDefaultPassword.Checked = true;
}
elseif (password.Equals(this.rbtnUserNamePassword.Name))
{
this.rbtnUserNamePassword.Checked = true;
}
}
}
#endregion
privatevoid rbtnUserInput_CheckedChanged(object sender, EventArgs e)
{
if (this.rbtnUserInput.Checked)
{
this.txtPassword.TabStop = true;
this.txtConfirmPassword.TabStop = true;
this.txtPassword.Text = string.Empty;
this.txtConfirmPassword.Text = string.Empty;
DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "Password", this.rbtnUserInput.Name);
}
}
privatevoid rbtnDefaultPassword_CheckedChanged(object sender, EventArgs e)
{
if (this.rbtnDefaultPassword.Checked)
{
this.txtPassword.Text = BaseSystemInfo.DefaultPassword;
this.txtConfirmPassword.Text = BaseSystemInfo.DefaultPassword;
if (!string.IsNullOrEmpty(this.txtPassword.Text))
{
this.txtPassword.TabStop = false;
this.txtConfirmPassword.TabStop = false;
}
DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "Password", this.rbtnDefaultPassword.Name);
}
}
privatevoid rbtnUserNamePassword_CheckedChanged(object sender, EventArgs e)
{
if (this.rbtnUserNamePassword.Checked)
{
this.txtPassword.Text = this.txtUserName.Text;
this.txtConfirmPassword.Text = this.txtUserName.Text;
if (string.IsNullOrEmpty(this.txtPassword.Text))
{
this.txtPassword.TabStop = true;
this.txtConfirmPassword.TabStop = true;
}
else
{
this.txtPassword.TabStop = false;
this.txtConfirmPassword.TabStop = false;
}
DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "Password", this.rbtnUserNamePassword.Name);
}
}
privatevoid chkIsStaff_CheckedChanged(object sender, EventArgs e)
{
if (this.FormLoaded)
{
DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "IsStaff", this.chkIsStaff.Checked.ToString());
}
}
privatevoid chkClose_CheckedChanged(object sender, EventArgs e)
{
if (this.FormLoaded)
{
DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "Close", this.chkClose.Checked.ToString());
}
}