• 大小: 348KB
    文件类型: .rar
    金币: 2
    下载: 2 次
    发布日期: 2021-08-28
  • 语言: C#
  • 标签: 源代码  

资源简介

用C#写的酒店管理软件,包含房间信息查看,预订房间,入住房间等 添加皮肤控件,界面美观,代码绝对清楚,由于最近较忙 还有退房管理员等功能没写,想练习的可以下载了自己去扩充,如果有人急需完整的 可以联系我

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;

namespace HotelManager
{
    class Database
    {
        //数据库连接字符串
        public static string ConnStr = @“Provider=Microsoft.Jet.OLEDB.4.0; Data source=password.mdb;“;
        public static OleDbConnection oleDbConnection = new System.Data.OleDb.OleDbConnection(ConnStr);

        //数据库操作:验证,判断数据库中是否存在一条满足SQL语句的记录
        public static string Yanzheng(string sql)
        {
            oleDbConnection.Open();
            string ret = “no“;
            try
            {
                String query = sql;
                OleDbCommand oleDbCommand = new OleDbCommand(query oleDbConnection);

                OleDbDataReader reader = oleDbCommand.ExecuteReader();
                if (reader.Read())
                    ret = “ok“;
            }
            catch (Exception ex)
            {
                ret = ex.Message;
            }
            finally
            {
                oleDbConnection.Close();
            }
            return ret;
        }
        //数据库操作:读取所有数据
        public static DataSet Fangtai(string sqlstring sql1)
        {
            DataSet ds = new DataSet();
            string ret = ““;
            oleDbConnection.Open();
            try
            {
                OleDbDataAdapter adapter = new OleDbDataAdapter(sql ConnStr);
                adapter.Fill(ds sql1);
            }
            catch (Exception ex)
            {
                ret = ex.Message;
            }
            finally
            {
                oleDbConnection.Close();
            }
            return ds;
        }
        //数据库操作:更新数据
        public static string zengjia(string sqlstring sql1string fanghao)
        {
            string ret = “no“;
            oleDbConnection.Open();
            try
            {
                String query = “select * from “ + sql1 + “ where 房间号=‘“ + fanghao + “‘“;
                OleDbCommand oleDbCommand = new OleDbCommand(query oleDbConnection);
                OleDbDataReader reader = oleDbCommand.ExecuteReader();
                if (reader.Read())
                {
                    ret = “该房间已经存在,请确定房间号!“;
                }
                else
                {
                    reader.Close();
                    query = sql;
                    oleDbCommand = new OleDbCommand(query oleDbConnection);
                    oleDbCommand.ExecuteNonQuery();
                    ret = “ok“;
                }
            }
            catch (Exception ex)
            {
                ret = ex.Message;
            }
            finally
            {
                oleDbConnection.Close();
            }
            
            return ret;
        }
        //数据库操作:删除数据
        public static string shanchu(string sql)
        {
            string ret = “no“;
            oleDbConnection.Open(

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

     文件       5032  2006-04-04 15:20  HotelManager\HotelManager\bin\Debug\DeepCyan.ssk

     文件      17010  2006-03-22 05:57  HotelManager\HotelManager\bin\Debug\GlassOrange.ssk

     文件      65536  2009-04-14 19:43  HotelManager\HotelManager\bin\Debug\HotelManager.exe

     文件      97792  2009-04-14 19:43  HotelManager\HotelManager\bin\Debug\HotelManager.pdb

     文件       5632  2005-11-11 22:25  HotelManager\HotelManager\bin\Debug\HotelManager.vshost.exe

     文件     516096  2006-08-18 11:50  HotelManager\HotelManager\bin\Debug\IrisSkin2.dll

     文件      15156  2006-03-22 05:55  HotelManager\HotelManager\bin\Debug\MacOS.ssk

     文件      16262  2006-03-22 12:32  HotelManager\HotelManager\bin\Debug\OneBlue.ssk

     文件     458752  2009-04-10 21:05  HotelManager\HotelManager\bin\Debug\Password.mdb

     文件      31723  2006-07-11 00:45  HotelManager\HotelManager\bin\Debug\vista1.ssk

     文件      15904  2006-07-18 23:12  HotelManager\HotelManager\bin\Debug\Vista2_color1.ssk

     文件      12600  2006-07-13 23:36  HotelManager\HotelManager\bin\Debug\XPSilver.ssk

     文件       5577  2009-04-07 17:05  HotelManager\HotelManager\Database.cs

     文件       5409  2009-04-08 09:54  HotelManager\HotelManager\HotelManager.csproj

     文件       1236  2009-04-14 19:43  HotelManager\HotelManager\obj\Debug\HotelManager.csproj.GenerateResource.Cache

     文件      65536  2009-04-14 19:43  HotelManager\HotelManager\obj\Debug\HotelManager.exe

     文件      97792  2009-04-14 19:43  HotelManager\HotelManager\obj\Debug\HotelManager.pdb

     文件        180  2009-04-07 15:47  HotelManager\HotelManager\obj\Debug\HotelManager.Properties.Resources.resources

     文件        180  2009-04-07 17:26  HotelManager\HotelManager\obj\Debug\HotelManager.主界面.resources

     文件        180  2009-04-07 15:47  HotelManager\HotelManager\obj\Debug\HotelManager.实时房态.resources

     文件       8228  2009-04-08 09:18  HotelManager\HotelManager\obj\Debug\HotelManager.押金管理.resources

     文件        180  2009-04-08 10:20  HotelManager\HotelManager\obj\Debug\HotelManager.用户信息.resources

     文件        180  2009-04-14 19:43  HotelManager\HotelManager\obj\Debug\HotelManager.用户登陆.resources

     文件        180  2009-04-08 09:57  HotelManager\HotelManager\obj\Debug\HotelManager.订房登记.resources

     文件       5696  2009-04-08 09:18  HotelManager\HotelManager\obj\Debug\ResolveAssemblyReference.cache

     文件       4608  2009-04-07 13:11  HotelManager\HotelManager\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       2891  2009-04-14 19:44  HotelManager\HotelManager\obj\HotelManager.csproj.FileListAbsolute.txt

     文件        478  2009-04-07 10:00  HotelManager\HotelManager\Program.cs

     文件       1202  2009-04-07 09:21  HotelManager\HotelManager\Properties\AssemblyInfo.cs

     文件       2848  2009-04-07 13:11  HotelManager\HotelManager\Properties\Resources.Designer.cs

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

评论

共有 条评论