学生学籍管理系统代码.doc
文本预览下载声明
学生学籍管理系统详细代码
本文为学生学籍管理系统的各个模块效果图和详细代码;
登录模块:
登录模块代码:
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 StuIFMS
{
public partial class Form1 : Form
{
public Color temp;//存储临时的按钮颜色
public Form1()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}
public User CurrentUser;
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show(学生/教师用自己的学号/教师编号登录!,如过没有注册则点击“注册”进行注册!, 提示);
}
private void button1_Click(object sender, EventArgs e)
{
bool UserExit = false, KeyRight = false;
//声明上下文集合
DataClasses1DataContext myDataContext = new DataClasses1DataContext();
//把用户表里所有内容提取到User集合里
//排查输入错误
//用户名为空
if (textBox1.Text == )
MessageBox.Show(用户名不能为空!, 提示);
//用户名不为空
else
{
//密码为空
if (textBox2.Text == )
MessageBox.Show(密码不能为空, 提示);
//密码不为空
else
{
//学生身份登录
if (radioButton1.Checked==true)
{
var User = from user in myDataContext.UsersTable
where user.Identity == 学生
select user;
foreach (var stu in User)
{
if (stu.UerID == textBox1.Text)
{
UserExit = true;
if (stu.Password == textBox2.Text)
{
KeyRight = true;
显示全部