基本信息
源码名称:Winform简单三层架构考试系统(附数据库文件)
源码大小:0.99M
文件格式:.zip
开发语言:C#
更新时间:2016-11-02
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 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();
        }
    }
}