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
{
///
/// 密码框
///
public TextEdit PassEdit { get { return this.PasswordEdit; } }
public AwaitScreenControl()
{
InitializeComponent();
this.userName.Text = ERPInfo.Instance.UserName;
this.PasswordEdit.KeyDown += OnPasswordEditKeyDown;
this.UnlockBtn.Click += OnUnlockBtClick;
}
///
/// 窗体初始化
///
///
///
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();
}
///
/// 解锁按钮点击
///
///
///
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();
}
}
///
/// 密码输入事件
///
///
///
private void OnPasswordEditKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
OnUnlockBtClick(null, null);
e.Handled = true;
}
else
{
this.toolTipController.HideHint();
}
}
}
}