在好例子网,分享、交流、成长!
您当前所在位置:首页C# 开发实例C#语言基础 → c#+access新生管理信息系统全代码​

c#+access新生管理信息系统全代码​

C#语言基础

下载此实例
  • 开发语言:C#
  • 实例大小:1.33M
  • 下载次数:76
  • 浏览次数:627
  • 发布时间:2019-03-05
  • 实例类别:C#语言基础
  • 发 布 人:yxs25800
  • 文件格式:.zip
  • 所需积分:2
 相关标签: Access C# 系统 研究生 管理

实例介绍

【实例简介】

c# access新生管理信息系统全代码

【实例截图】

【核心代码】


usingSystem;
usingSystem.Drawing;
usingSystem.Collections;
usingSystem.ComponentModel;
usingSystem.Windows.Forms;
usingSystem.Data;
usingSystem.Data.OleDb;
//Download by http://down.liehuo.net
namespaceMasterMIS
{
    /// <summary>
    /// Form1 的摘要说明。
    /// </summary>
    publicclassLogin : System.Windows.Forms.Form
    {
        privateSystem.Windows.Forms.TextBox password;
        privateSystem.Windows.Forms.TextBox name;
        privateSystem.Windows.Forms.Label label3;
        privateSystem.Windows.Forms.Label label2;
        privateSystem.Windows.Forms.Label label1;
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        privateSystem.ComponentModel.Container components =null;
        privateOleDbConnection oleConnection1 =null;
        privateSystem.Windows.Forms.Button btClose;
        privateSystem.Windows.Forms.Button btAdd;
        privateOleDbCommand oleCommand1 =null;
 
        publicLogin()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            oleConnection1 =newOleDbConnection(MasterMIS.database.dbConnection.connection);
            oleCommand1 =newOleDbCommand();
            oleCommand1.Connection = oleConnection1;
 
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
 
        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        protectedoverridevoidDispose(booldisposing )
        {
            if( disposing )
            {
                if(components !=null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }
 
        #region Windows 窗体设计器生成的代码
        /// <summary>
        /// 设计器支持所需的方法 - 不要使用代码编辑器修改
        /// 此方法的内容。
        /// </summary>
        privatevoidInitializeComponent()
        {
            this.btClose =newSystem.Windows.Forms.Button();
            this.btAdd =newSystem.Windows.Forms.Button();
            this.password =newSystem.Windows.Forms.TextBox();
            this.name =newSystem.Windows.Forms.TextBox();
            this.label3 =newSystem.Windows.Forms.Label();
            this.label2 =newSystem.Windows.Forms.Label();
            this.label1 =newSystem.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // btClose
            //
            this.btClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.btClose.ForeColor = System.Drawing.Color.DarkSlateGray;
            this.btClose.Location =newSystem.Drawing.Point(168, 160);
            this.btClose.Name ="btClose";
            this.btClose.Size =newSystem.Drawing.Size(75, 23);
            this.btClose.TabIndex = 13;
            this.btClose.Text ="取消";
            this.btClose.Click  =newSystem.EventHandler(this.btClose_Click);
            //
            // btAdd
            //
            this.btAdd.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.btAdd.ForeColor = System.Drawing.Color.DarkSlateGray;
            this.btAdd.Location =newSystem.Drawing.Point(48, 160);
            this.btAdd.Name ="btAdd";
            this.btAdd.Size =newSystem.Drawing.Size(75, 23);
            this.btAdd.TabIndex = 12;
            this.btAdd.Text ="确定";
            this.btAdd.Click  =newSystem.EventHandler(this.btAdd_Click);
            //
            // password
            //
            this.password.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.password.Location =newSystem.Drawing.Point(128, 120);
            this.password.Name ="password";
            this.password.PasswordChar ='*';
            this.password.Size =newSystem.Drawing.Size(100, 21);
            this.password.TabIndex = 11;
            this.password.Text ="admin";
            //
            // name
            //
            this.name.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.name.Location =newSystem.Drawing.Point(128, 80);
            this.name.Name ="name";
            this.name.Size =newSystem.Drawing.Size(100, 21);
            this.name.TabIndex = 10;
            this.name.Text ="admin";
            //
            // label3
            //
            this.label3.Font =newSystem.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label3.ForeColor = System.Drawing.Color.DarkSlateGray;
            this.label3.Location =newSystem.Drawing.Point(64, 120);
            this.label3.Name ="label3";
            this.label3.Size =newSystem.Drawing.Size(56, 23);
            this.label3.TabIndex = 9;
            this.label3.Text ="密  码";
            //
            // label2
            //
            this.label2.Font =newSystem.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label2.ForeColor = System.Drawing.Color.DarkSlateGray;
            this.label2.Location =newSystem.Drawing.Point(64, 80);
            this.label2.Name ="label2";
            this.label2.Size =newSystem.Drawing.Size(56, 23);
            this.label2.TabIndex = 8;
            this.label2.Text ="用户名";
            //
            // label1
            //
            this.label1.Font =newSystem.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label1.ForeColor = System.Drawing.Color.DarkSlateGray;
            this.label1.Location =newSystem.Drawing.Point(32, 24);
            this.label1.Name ="label1";
            this.label1.Size =newSystem.Drawing.Size(232, 40);
            this.label1.TabIndex = 7;
            this.label1.Text ="研究生管理信息系统";
            //
            // Login
            //
            this.AutoScaleBaseSize =newSystem.Drawing.Size(6, 14);
            this.BackColor = System.Drawing.Color.Lavender;
            this.ClientSize =newSystem.Drawing.Size(339, 257);
            this.Controls.Add(this.btClose);
            this.Controls.Add(this.btAdd);
            this.Controls.Add(this.password);
            this.Controls.Add(this.name);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.MaximizeBox =false;
            this.MinimizeBox =false;
            this.Name ="Login";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text ="登录";
            this.Load  =newSystem.EventHandler(this.Login_Load);
            this.ResumeLayout(false);
            this.PerformLayout();
 
        }
        #endregion
 
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        staticvoidMain()
        {
            Application.Run(newLogin());
        }
 
        privatevoidbtAdd_Click(objectsender, System.EventArgs e)
        {
            if(name.Text.Trim()==""||password.Text.Trim()=="")
                MessageBox.Show("请输入用户名和密码","提示");
            else
            {
                oleConnection1.Open();
                OleDbCommand cmd=newOleDbCommand("",oleConnection1);
                stringsql="select RoleName from userinfo where UName='"name.Text.Trim()"' and PWD='"password.Text.Trim()"'";
                cmd.CommandText=sql;
                stringrolename;
 
                if(null!=cmd.ExecuteScalar())
                {
                    rolename=cmd.ExecuteScalar().ToString();
                    //隐藏登录窗口
                    this.Visible=false; 
                    //创建并打开主界面
                    Main main=newMain();
                    main.Tag=this.FindForm();
                    sql="select * from roles where RoleName='"rolename"'";
                    OleDbDataReader dr;
                    cmd.CommandText=sql;
                    dr=cmd.ExecuteReader();
                    dr.Read();
      
                    main.menuItem1.Visible=(bool)(dr.GetValue(1));
                     
                    main.menuItem4.Visible=(bool)(dr.GetValue(1));
             
                    main.menuItem5.Visible=(bool)(dr.GetValue(2));
 
                    main.menuItem6.Visible=(bool)(dr.GetValue(2));
 
                    main.menuItem7.Visible=(bool)(dr.GetValue(3));
 
                    main.statusBarPanel2.Text=name.Text.Trim();
             
                    main.ShowDialog();
                }
                else
                    MessageBox.Show("用户名或密码错误","警告");
 
                oleConnection1.Close();
            }
        }
 
        privatevoidbtClose_Click(objectsender, System.EventArgs e)
        {
            this.Close();
        }
 
        privatevoidLogin_Load(objectsender, EventArgs e)
        {
 
        }
    }
}


实例下载地址

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警