• 大小: 3.06MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-16
  • 语言: 其他
  • 标签:

资源简介

餐饮管理系统 课程设计报告加源码加数据库 自己开发 适合初学者交课程设计

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;


namespace WindowsFormsApplication2
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
            this.Opacity = 0;//切换效果
            TimeInitForm();
         //this.skinEngine1.SkinFile = “G:\\DiamondGreen.ssk“;

            this.skinEngine1.SkinFile = “D:\\MP10.ssk“;
        }   
        private void btnSumbit_Click(object sender EventArgs e)
        {
            if (txtName.Text == ““)//如果用户名输入为空,弹出窗口给出警告
            {
                MessageBox.Show(“请输入用户名“ “警告“ MessageBoxButtons.OK MessageBoxIcon.Warning);
                txtPwd.Clear();//将密码清空
                txtName.Focus();//光标落在用户名输入框
            }
            else
            {
                if (txtPwd.Text == ““)//如果密码输入为空,弹出窗口给出警告
                {
                    MessageBox.Show(“请输入密码“ “警告“ MessageBoxButtons.OK MessageBoxIcon.Warning);
                 
                }
                else
                {

                    SqlConnection myconn;//连接数据库
                    SqlCommand mycomd;
                    //SqlDataReader sRead;

                    string connString = “Server=(local);Integrated Security=SSPI;Database=db_MrCy;Max Pool Size=75;Min Pool Size=5;“;//用windows身份登录
                    myconn = new SqlConnection(connString);

                    if (myconn.State == System.Data.ConnectionState.Closed)
                    {
                        try
                        {
                            myconn.Open();
                        }

                        catch (Exception a)
                        {
                            MessageBox.Show(“数据库连接失败“ + a.Message);
                            return;
                        }
                    }
                    //将输入的用户名与密码与数据库中数据比较
                    SqlCommand cmd = new SqlCommand(“select * from tb_User where UserName=‘“ + txtName.Text.Trim() + “‘ and UserPwd=‘“ + txtPwd.Text.Trim() + “‘“ myconn);
                    SqlDataReader sdr = cmd.ExecuteReader();
                    sdr.Read();
                    if (sdr.HasRows)
                    {
                        sdr.Close();
                        mycomd = new SqlCommand(“select * from tb_User where UserName=‘“ + txtName.Text + “‘“ myconn);
                        SqlDataReader sdr1=mycomd.ExecuteReader();
                        sdr1.Read();
                        string UserPower = sdr1[“power“].ToString().Trim();//取出此用户名的权限power
                        sdr1.Close();
                        frmMain main = new frmMain(UserPower txtName.Text DateTime.Now.ToShortDateString());//实例新的窗口,传递用户名,权限,登录时间
                        main.Show();
                        this.Hide();
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    2228224  2011-07-14 10:24  课程设计\课程设计\db_MrCy.MDF

     文件    1048576  2011-07-14 10:24  课程设计\课程设计\db_MrCy_Log.LDF

     文件     516096  2006-08-18 11:50  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\app.publish\Application Files\WindowsFormsApplication2_1_0_0_2\IrisSkin2.dll.deploy

     文件     210432  2011-07-11 13:28  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\app.publish\Application Files\WindowsFormsApplication2_1_0_0_2\WindowsFormsApplication2.exe.deploy

     文件       7929  2011-07-11 13:28  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\app.publish\Application Files\WindowsFormsApplication2_1_0_0_2\WindowsFormsApplication2.exe.manifest

     文件      20480  2007-12-22 09:46  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\app.publish\Application Files\WindowsFormsApplication2_1_0_0_2\皮肤.exe.deploy

     文件     494976  2011-07-11 13:28  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\app.publish\setup.exe

     文件       5385  2011-07-11 13:28  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\app.publish\WindowsFormsApplication2.application

     文件     516096  2006-08-18 11:50  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\IrisSkin2.dll

     文件       1701  2011-07-11 13:28  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.application

     文件     210432  2011-07-11 13:28  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe

     文件       4332  2011-07-11 13:28  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe.manifest

     文件     206336  2011-07-11 13:28  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.pdb

     文件       1701  2011-07-10 19:39  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.application

     文件      11608  2011-07-11 13:26  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe

     文件       4332  2011-07-10 19:39  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe.manifest

     文件      20480  2007-12-22 09:46  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\皮肤.exe

     文件      22016  2007-12-22 09:46  课程设计\课程设计\WindowsFormsApplication2\bin\Debug\皮肤.pdb

     文件       5032  2007-12-22 09:44  课程设计\课程设计\WindowsFormsApplication2\bin\DeepCyan.ssk

     文件      12261  2007-12-22 09:45  课程设计\课程设计\WindowsFormsApplication2\bin\EmeraldColor1.ssk

     文件     516096  2006-08-18 11:50  课程设计\课程设计\WindowsFormsApplication2\bin\IrisSkin2.dll

     文件      15899  2007-12-22 09:46  课程设计\课程设计\WindowsFormsApplication2\bin\MP10.ssk

     文件      31443  2006-03-21 14:19  课程设计\课程设计\WindowsFormsApplication2\bin\msn.gif

     文件      16292  2006-03-22 05:55  课程设计\课程设计\WindowsFormsApplication2\bin\MSN.ssk

     文件      15928  2007-12-22 09:10  课程设计\课程设计\WindowsFormsApplication2\bin\Vista2_color7.ssk

     文件      20480  2007-12-22 09:46  课程设计\课程设计\WindowsFormsApplication2\bin\皮肤.exe

     文件      22016  2007-12-22 09:46  课程设计\课程设计\WindowsFormsApplication2\bin\皮肤.pdb

     文件       5632  2005-11-11 22:25  课程设计\课程设计\WindowsFormsApplication2\bin\皮肤.vshost.exe

     文件       6204  2011-07-10 19:29  课程设计\课程设计\WindowsFormsApplication2\Form1.cs

     文件       8256  2011-07-09 15:19  课程设计\课程设计\WindowsFormsApplication2\Form1.Designer.cs

............此处省略210个文件信息

评论

共有 条评论