• 大小: 15.94MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-20
  • 语言: C#
  • 标签: winform  C#  报表打印  

资源简介

使用Visual Studio开发的毕业设计,基于winform的酒店管理系统,使用C#编程。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Configuration;
using System.Windows.Forms;

using MySql.Data.MySqlClient;
using System.xml;
using MySql.Data;


namespace HotelManagementSystem
{
    public class DbManager
    {
        public static string login_id = ““;//定义全局变量,记录当前登录的用户编号  
        public static string login_name = ““;//定义全局变量,记录当前登录的用户名  
        public static string login_passwd = ““;  //密码
        public static int power = 0;
        public static string identy = ““;
        public static int dprices = 100;   //单人房单价
        public static int hprices = 0;   //豪华单人房单价
        public static int sprices = 0;   //商务双人房单价
        public static int gprices = 0;   //高级大床房单价
        public static int tprices = 0;   //特色大床房单价

        public static MySqlConnection conn;//定义一个MySqlConnection类型的公共变量conn,用于判断数据库是否连接成功  
        public static string sqlcon = “server=47.106.90.110;database=hoteldatabase;user id=root@zzj;pwd=aaa333...;CharSet=utf8“;

        #region 建立数据库连接
        ///   
        /// 建立数据库连接  
        /// 
  
        ///   
        public static MySqlConnection GetConn()
        {
            conn = new MySqlConnection(sqlcon);
            conn.Open();
            return conn;
        }
        #endregion

        #region 关闭数据库
        ///   
        /// 关闭数据库  
        /// 
  
        public void CloseConn()
        {
            if (conn.State == ConnectionState.Open)   //判断是否打开与数据库的连接  
            {
                conn.Close();   //关闭数据库的连接  
                conn.Dispose();   //释放My_con变量的所有空间  
            }
        }
        #endregion

        #region  读取指定表中的信息
        ///   
        /// 读取指定表中的信息.  
        /// 
  
        /// SQL语句  
        /// 返回bool型  
        public MySqlDataReader GetComand(string sqlStr)
        {
            GetConn();   //打开与数据库的连接  
            MySqlCommand comand = conn.CreateCommand();//创建一个SqlCommand对象,用于执行SQL语句  
            comand.CommandText = sqlStr;    //获取指定的SQL语句  
            MySqlDataReader myRead = comand.ExecuteReader(); //执行SQL语名句,生成一个MySqlDataReader对象  
            return myRead;
        }
        #endregion

        #region 执行MySqlCommand命令
        ///   
        /// 执行SqlCommand  
        /// 
  
        /// SQL语句  
        public void GetSqlCom(string sqlStr)
        {
            GetConn();   //打开与数据库的连接  
            MySqlCommand sqlCom = new MySqlCommand(sqlStr conn); //创建一个MySqlCommand对象,用于执行SQL语句  
            sqlCom.ExecuteNonQuery();   //执行SQL语句  
            sqlCom.Dispose();   //释放所有空间  
            CloseConn();    //调用con_close()方法,关闭与数据库的连接  
        }
        #endregion

        #region  创建DataSet对象
        /// 
  
        //

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

    .CA....       222  2018-05-17 20:08  HotelManagementSystem\.vs\HotelManagementSystem\DesignTimeBuild\.dtbcache

    .CA..H.    152576  2019-01-04 21:49  HotelManagementSystem\.vs\HotelManagementSystem\v15\.suo

    .CA....         0  2018-05-17 19:03  HotelManagementSystem\.vs\HotelManagementSystem\v15\Server\sqlite3\db.lock

    .CA....      4096  2018-05-17 19:03  HotelManagementSystem\.vs\HotelManagementSystem\v15\Server\sqlite3\storage.ide

    .CA....     32768  2019-01-04 21:47  HotelManagementSystem\.vs\HotelManagementSystem\v15\Server\sqlite3\storage.ide-shm

    .CA....   1301952  2019-01-04 21:49  HotelManagementSystem\.vs\HotelManagementSystem\v15\Server\sqlite3\storage.ide-wal

    .CA....   6493743  2018-04-17 11:33  HotelManagementSystem\Database1\Database1.dbmdl

    .CA....      3368  2018-04-17 11:32  HotelManagementSystem\Database1\Database1.sqlproj

    .CA....       144  2018-04-17 11:32  HotelManagementSystem\Database1\Database1.sqlproj.user

    .CA....      3108  2018-04-30 10:46  HotelManagementSystem\HotelManagementSystem\3.lrc

    .CA....    250044  2018-04-28 19:40  HotelManagementSystem\HotelManagementSystem\3.wav

    .CA....       187  2018-04-14 00:02  HotelManagementSystem\HotelManagementSystem\App.config

    .CA....    250044  2018-04-28 19:35  HotelManagementSystem\HotelManagementSystem\bin\Debug\3.wav

    .CA....     53760  2018-04-28 19:39  HotelManagementSystem\HotelManagementSystem\bin\Debug\AxInterop.WMPLib.dll

    .CA....   3693283  2018-05-02 22:14  HotelManagementSystem\HotelManagementSystem\bin\Debug\Debug.rar

    .CA....   1888768  2018-07-26 19:32  HotelManagementSystem\HotelManagementSystem\bin\Debug\HotelManagementSystem.exe

    .CA....       187  2018-04-14 00:02  HotelManagementSystem\HotelManagementSystem\bin\Debug\HotelManagementSystem.exe.config

    .CA....    239104  2018-07-26 19:32  HotelManagementSystem\HotelManagementSystem\bin\Debug\HotelManagementSystem.pdb

    .CA....     23168  2018-05-04 17:28  HotelManagementSystem\HotelManagementSystem\bin\Debug\HotelManagementSystem.vshost.exe

    .CA....       187  2018-04-14 00:02  HotelManagementSystem\HotelManagementSystem\bin\Debug\HotelManagementSystem.vshost.exe.config

    .CA....       490  2015-07-10 19:01  HotelManagementSystem\HotelManagementSystem\bin\Debug\HotelManagementSystem.vshost.exe.manifest

    .CA....    330752  2018-05-17 19:03  HotelManagementSystem\HotelManagementSystem\bin\Debug\Interop.WMPLib.dll

    .CA....     49168  2012-09-26 03:16  HotelManagementSystem\HotelManagementSystem\bin\Debug\Microsoft.CSharp.dll

    .CA....   1550200  2014-06-02 21:12  HotelManagementSystem\HotelManagementSystem\bin\Debug\Microsoft.Office.Interop.Excel.dll

    .CA....     63336  2014-06-02 21:12  HotelManagementSystem\HotelManagementSystem\bin\Debug\Microsoft.Vbe.Interop.dll

    .CA....    294912  2013-05-22 17:21  HotelManagementSystem\HotelManagementSystem\bin\Debug\MySql.Data.dll

    .CA....    448360  2014-06-02 21:12  HotelManagementSystem\HotelManagementSystem\bin\Debug\office.dll

    .CA....     32392  2018-05-16 23:53  HotelManagementSystem\HotelManagementSystem\bin\Debug\stdole.dll

    .CA....     27192  2012-09-26 03:16  HotelManagementSystem\HotelManagementSystem\bin\Debug\System.Data.DataSetExtensions.dll

    .CA....   1164272  2012-09-26 03:16  HotelManagementSystem\HotelManagementSystem\bin\Debug\System.Data.dll

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

评论

共有 条评论