资源简介
使用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\Databa
.CA.... 3368 2018-04-17 11:32 HotelManagementSystem\Databa
.CA.... 144 2018-04-17 11:32 HotelManagementSystem\Databa
.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个文件信息
相关资源
- halcon 与C#之HWindow鼠标控制图片缩放,
- C#生辰八字生成器源码
- C#调用USB口摄像头单头,多头源码
- ASP.NET图书管理系统源码.zip
- 基于遗传算法的排程系统
- DevExpress WinForm中文文档
- C#购物系统课程设计
- Beginning C# 7 Programming with Visual Studio
- C# 实现多个IP摄像头画面预览以及截图
- Visual C#.NET串口通信及测控应用典型实
- DevexpressWinform中文文档
- 基于.net的医院信息管理系统C#
- C#Socket网络通信实现多人聊天
- 企业人事管理系统C#源代码
- C#实现软件加壳
- ASP.NET网络书店(C#全源码提供)
- C#获取视频时长,并且视频截图
- Essential C# 7.0
- Devexpress Winform中文文档纯中文文档N
- 北大青鸟accp7.0 使用C#开发数据库应用
- C#电梯调度
- Pro ASP.NET Core MVC 2 (7th) 中文版
- C# 调用Bartender打印的2种方式
- Iocomp.Net+WinForms+V4+SP2完全破解版
- c#人力资源管理系统源代码
- DevExpress控件forC#-8.2
- C#多线程编程实战_中文完整版
- C#学生信息管理系统含全部源码,详细
- Devexpress 中文说明文档winform
- s2深入.NET平台和C#编程课后、上机、指
评论
共有 条评论