嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
Winform简单三层架构考试系统
using System;
using System.Windows.Forms;
using OnLineTest.BLL;
using OnLineTest.Model;
namespace OnLineTest.UI
{
public partial class FrmLogin : Form
{
public FrmLogin()
{
InitializeComponent();
}
private void FrmLogin_Load(object sender, EventArgs e)
{
cboUserType.SelectedIndex = 0;
}
private void txtUID_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 13)
{
//btnLogin_Click(sender, e);
}
}
private void txtPWD_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 13)
{
// btnLogin_Click(sender, e);
}
}
private void btnLogin_Click_1(object sender, EventArgs e)
{
if (cboUserType.SelectedIndex==-1)
{
/*此处没用 - - 故意写的*/
MessageBox.Show("请选择用户类型!");
return;
}
string UID = txtUID.Text.Trim();
string PWD = txtPWD.Text;
UserInfoBLL bll = new UserInfoBLL();
string msg = "";
if (bll.GetPwdByUID(UID, PWD, out msg))
{
//登录成功
UserInfoBLL ubll = new UserInfoBLL();
UserInfo user = ubll.GetUserInfoByUID(UID);
QHelper.Role = user.Role;
QHelper.UID = user.Uid;
QHelper.RealName = user.RealName;
FrmMainMain f = new FrmMainMain();
f.Show();
this.Hide();
}
else
{
MessageBox.Show(msg);
}
}
private void btnClear_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}