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 XKGLXT
{
public partial class Login : Form
{
Model.User mdl_ui = new Model.User();
BLL.User bll_ui = new BLL.User();
Model.Student mdl_st = new Model.Student();
BLL.Student bll_st = new BLL.Student();
BLL.Right bll_rt = new BLL.Right();
public Login()
{
InitializeComponent();
}
private void BtnLogin_Click(object sender, EventArgs e)
{
//MessageBox.Show(cbxRole.SelectedIndex.ToString());
if (cbxRole.Text=="管理员")
{
mdl_ui.UserID = TxtUser.Text;
mdl_ui.Pwd = TxtPass.Text;
Model.Login.UserNo = TxtUser.Text;
if (bll_ui.login(mdl_ui) > 0)
{
Model.Login.flag = true;
MessageBox.Show("登录成功");
this.Close();
}
else
{
Model.Login.flag = false;
MessageBox.Show("用户名或密码错误!");
}
}
if (cbxRole.Text == "教师")
{
mdl_ui.UserID = TxtUser.Text;
mdl_ui.Pwd = TxtPass.Text;
Model.Login.UserNo = TxtUser.Text;
if (bll_ui.login(mdl_ui) > 0)
{
Model.Login.flag = true;
MessageBox.Show("登录成功");
this.Close();
}
else
{
Model.Login.flag = false;
MessageBox.Show("用户名或密码错误!");
}
}
if(cbxRole.Text=="学生")
{
mdl_st.StuNo = TxtUser.Text;
mdl_st.Pwd = TxtPass.Text;
Model.Login.StuNo =
1