基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Model;
|
||||
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;
|
||||
|
||||
namespace Lskj.Main.Control
|
||||
{
|
||||
public partial class AwaitScreenControl : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 密码框
|
||||
/// </summary>
|
||||
public TextEdit PassEdit { get { return this.PasswordEdit; } }
|
||||
public AwaitScreenControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.userName.Text = ERPInfo.Instance.UserName;
|
||||
this.PasswordEdit.KeyDown += OnPasswordEditKeyDown;
|
||||
this.UnlockBtn.Click += OnUnlockBtClick;
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗体初始化
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void OnFrmAwaitScreenLoad()
|
||||
{
|
||||
this.tipsPanel.Location = new Point((this.Width - this.tipsPanel.Width) / 2, (this.Height - this.tipsPanel.Height) / 2);
|
||||
this.PasswordEdit.Text = "";
|
||||
this.PasswordEdit.Focus();
|
||||
}
|
||||
/// <summary>
|
||||
/// 解锁按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnUnlockBtClick(object sender, EventArgs e)
|
||||
{
|
||||
if (!ERPInfo.Instance.InPassWord.Equals(this.PasswordEdit.Text))
|
||||
{
|
||||
this.toolTipController.ShowHint("密码输入错误", this.PasswordEdit, DevExpress.Utils.ToolTipLocation.RightBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Visible = false;
|
||||
this.SendToBack();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 密码输入事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnPasswordEditKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
OnUnlockBtClick(null, null);
|
||||
e.Handled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.toolTipController.HideHint();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user