zoukankan      html  css  js  c++  java
  • 数据库课程实习设计——酒店房间预订管理系统

    项目源码地址:https://github.com/TreeDream/Hotel

    转载注明出处!!!

    目 录

    1 问题的提出................................................................................................................... 3

    2  可行性分析................................................................................................................. 4

    2.1  技术可行性...................................................................................................... 4

    2.2  经济可行性...................................................................................................... 4

    2.3  操作可行性...................................................................................................... 4

    3  需求分析.................................................................................................................... 5

    3.1  数据需求分析................................................................................................... 5

    3.2  功能需求分析................................................................................................... 5

    3.3  关系模式.......................................................................................................... 5

    3.4  数据流图.......................................................................................................... 6

    3.5  数据字典.......................................................................................................... 6

    4  数据库设计................................................................................................................. 7

    4.1 概念设计............................................................................................................ 7

    4.2 逻辑设计............................................................................................................ 8

    4.2.1 物理结构模型............................................................................................ 8

    4.2.2 表结构...................................................................................................... 8

    4.3 物理设计............................................................................................................ 9

    4.4  数据库建立...................................................................................................... 9

    4.5其他设计........................................................................................................... 13

    4.5.1存储过程设计......................................................................................... 13

    4.5.2 触发器设计............................................................................................ 15

    5 应用程序设计............................................................................................................. 15


     

     

    1 问题的提出

    随着计算机技术的飞速发展,信息时代的到来,信息改变了这个社会,各类行业在日常经营管理各个方面也在走向规范化和网络化。

    近年来,随着旅游业的快速发展,旅游的人也越来越多,在旅游业中,对酒店的管理是一个重要部分。一个好的酒店房间预订管理系统对于酒店来说是十分重要的。

    如何利用数据库更好的管理酒店房间资源,如何给客户提供服务是要解决的问题。本系统利用数据库对房间资源做了充分的利用,能够对客户提供简单的服务。

    2  可行性分析

       2.1  技术可行性

    采用SQL Server 2016数据库和C#开发,使用了先进的数据库技术与数据管理技术,在用户使用和管理的方面提供了便捷。本系统主要采用VS 2015 和 SQL Server2016进行相关的开发,而VS 2015是面向对象的可视化软件开发工具,其对编程平台对数据库的访问做了很好的封装;SQL Server 2016数据库,它能够处理大量数据,同时保持数据的完整性并提供许多高级管理功能。它的灵活性、安全性和易用性为数据库编程提供了良好的条件。

       2.2  经济可行性

    现代化的酒店组织庞大、服务项目多、信息量大,要想提高劳动生产、降低成本、提高服务质量和管理水平,促进经济效益,必须借助计算机来进行现代化信息管理。

    可以预估该系统的开发、运行、维护费用,预估该系统能给酒店带来的经济效益。然后将所需费用与所获经济利益比较,可以看出对企业有利。

      购买安装设备费用:计算机

       2.3  操作可行性

    本系统采用C#语言开发,使用VS 2015作为开发平台,后台数据库使用SQL Server 2016建立。所做的系统为酒店管理人员开发的界面,界面友好,只需要懂得简单的计算机操作知识,就能自用应用本软件。

    3  需求分析

    3.1  数据需求分析

    数据库可以对信息进行存储,系统的数据都是右数据库来提供,查询和使用数据都必须要进入数据库,这就需要对数据库建立相应的表来提供数据。本系统需要以下数据:

    (1)用户登录基本信息,包括登录 ID,密码等。

    (2)房间信息,包括房间的ID,种类。

    (3)房间统计,每一类的房间具体信息,包括统一价格等。

    (4)用户订房信息,包括订房时间及缴费等。

    3.2  功能需求分析

    需求分析从客户的需求中提取出软件系统能够帮助用户解决的业务问题,通过对用户业务问题的分析,规划出系统的功能模块。

      经过分析后,确定酒店房间管理系统的功能模块包括:

      (1)对用户信息的管理。

      (2)对用户订房信息的查询。

      (3)对房间信息的管理。

      (4)对房间资源的充分利用。

    3.3  关系模式

    (1) 客户(客户编号,客户姓名,客户密码,客户种类)

    (2) 房间(房间编号,房间种类)

    (3) 客户订购(订购客户编号,订购房间编号,订购开始时间,订购结束时间,订购缴费)

    (4) 房间种类(房间种类,某类房间总个数,某类房间标准价)

    3.4  数据流图

    3.5  数据字典

    数据元素

    数据类型

    数据来源

    客户编号

    Varchar(18)

    客户表

    客户姓名

    Varchar(20)

    客户表

    客户密码

    Varchar(20)

    客户表

    客户种类

    bit

    客户表

    房间编号

    int

    房间表

    房间种类

    Varchar(18)

    房间表

    订购客户编号

    Varchar(18)

    订购表

    订购房间编号

    Int

    订购表

    订购开始时间

    Datatime

    订购表

    订购结束时间

    Datatime

    订购表

    订购缴费

    money

    订购表

    房间种类

    Varchar(18)

    房间种类表

    某类房间个数

    int

    房间种类表

    某类房间标准价

    money

    房间种类表

    4  数据库设计

    4.1 概念设计

     

    4.2 逻辑设计

          4.2.1 物理结构模型

    4.2.2 表结构 

    Customer 客户信息表

    表中列名

    数据类型

    可否为空

    说明

    ID

    Varchar(18)

    not null(主键)

    客户编号

    Name

    Varchar(20)

    not null

    客户编号

    password

    Varchar(20)

    not null

    客户密码

    isVIP

    Bit

    not null

    客户是否是VIP

    Room房间信息表

    表中列名

    数据类型

    可否为空

    说明

    roomNum

    int

    not null(主键)

    房间编号

    Category

    varchar(20)

    not null

    房间种类

     

    RoomCategory房间种类表

    表中列名

    数据类型

    可否为空

    说明

    Category

    Varchar(20)

    Not null(主键)

    房间种类名

    cnt

    int

    Not null

    某一类房间个数

    price

    money

    Not null

    某一类房间标准价

                             

    Order订购表

    表中列名

    数据类型

    可否为空

    说明

    ID

    Varchar(18)

    Not null

    订房客户编号

    roomNum

    int

    Not null

    订房客户房间编号

    beginDate

    Datetime

    Not null

    订房开始时间

    endDate

    Datetime

    Not null

    订房结束时间

    price

    money

    Not null

    实际缴费

    4.3 物理设计

     (1)建立索引:

    对Customer表在ID属性列上建立聚集索引

    对Room表在roomNum属性列上建立聚集索引

    对RoomCategory表是在Category属性列上建立聚集索引

     (2)存储结构

    系统的日志文件和数据文件在D:HotelData,文件夹下。           

     

    4.4  数据库建立

      1 if exists (select 1
      2 
      3    from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
      4 
      5    where r.fkeyid = object_id('"Order"') and o.name = 'FK_ORDER_ORDER_CUSTOMER')
      6 
      7 alter table "Order"
      8 
      9    drop constraint FK_ORDER_ORDER_CUSTOMER
     10 
     11 go
     12 
     13  
     14 
     15 if exists (select 1
     16 
     17    from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
     18 
     19    where r.fkeyid = object_id('"Order"') and o.name = 'FK_ORDER_ORDER2_ROOM')
     20 
     21 alter table "Order"
     22 
     23    drop constraint FK_ORDER_ORDER2_ROOM
     24 
     25 go
     26 
     27  
     28 
     29 if exists (select 1
     30 
     31    from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
     32 
     33    where r.fkeyid = object_id('Room') and o.name = 'FK_ROOM_CONTAIN_ROOMCATE')
     34 
     35 alter table Room
     36 
     37    drop constraint FK_ROOM_CONTAIN_ROOMCATE
     38 
     39 go
     40 
     41  
     42 
     43 if exists (select 1
     44 
     45             from  sysobjects
     46 
     47            where  id = object_id('Customer')
     48 
     49             and   type = 'U')
     50 
     51    drop table Customer
     52 
     53 go
     54 
     55  
     56 
     57 if exists (select 1
     58 
     59             from  sysindexes
     60 
     61            where  id    = object_id('"Order"')
     62 
     63             and   name  = 'Order2_FK'
     64 
     65             and   indid > 0
     66 
     67             and   indid < 255)
     68 
     69    drop index "Order".Order2_FK
     70 
     71 go
     72 
     73  
     74 
     75 if exists (select 1
     76 
     77             from  sysindexes
     78 
     79            where  id    = object_id('"Order"')
     80 
     81             and   name  = 'Order_FK'
     82 
     83             and   indid > 0
     84 
     85             and   indid < 255)
     86 
     87    drop index "Order".Order_FK
     88 
     89 go
     90 
     91  
     92 
     93 if exists (select 1
     94 
     95             from  sysobjects
     96 
     97            where  id = object_id('"Order"')
     98 
     99             and   type = 'U')
    100 
    101    drop table "Order"
    102 
    103 go
    104 
    105  
    106 
    107 if exists (select 1
    108 
    109             from  sysindexes
    110 
    111            where  id    = object_id('Room')
    112 
    113             and   name  = 'Contain_FK'
    114 
    115             and   indid > 0
    116 
    117             and   indid < 255)
    118 
    119    drop index Room.Contain_FK
    120 
    121 go
    122 
    123  
    124 
    125 if exists (select 1
    126 
    127             from  sysobjects
    128 
    129            where  id = object_id('Room')
    130 
    131             and   type = 'U')
    132 
    133    drop table Room
    134 
    135 go
    136 
    137  
    138 
    139 if exists (select 1
    140 
    141             from  sysobjects
    142 
    143            where  id = object_id('RoomCategory')
    144 
    145             and   type = 'U')
    146 
    147    drop table RoomCategory
    148 
    149 go
    150 
    151  
    152 
    153 /*==============================================================*/
    154 
    155 /* Table: Customer                                              */
    156 
    157 /*==============================================================*/
    158 
    159 create table Customer (
    160 
    161    ID                   varchar(18)          not null,
    162 
    163    name                 varchar(20)          null,
    164 
    165    password             varchar(20)          null,
    166 
    167    isVIP                tinyint              null,
    168 
    169    constraint PK_CUSTOMER primary key nonclustered (ID)
    170 
    171 )
    172 
    173 go
    174 
    175  
    176 
    177 /*==============================================================*/
    178 
    179 /* Table: "Order"                                               */
    180 
    181 /*==============================================================*/
    182 
    183 create table "Order" (
    184 
    185    ID                   varchar(18)          not null,
    186 
    187    roomNum              int                  not null,
    188 
    189    beginDate            datetime             null,
    190 
    191    endDate              datetime             null,
    192 
    193    price                money                null,
    194 
    195    constraint PK_ORDER primary key (ID, roomNum)
    196 
    197 )
    198 
    199 go
    200 
    201  
    202 
    203 /*==============================================================*/
    204 
    205 /* Index: Order_FK                                              */
    206 
    207 /*==============================================================*/
    208 
    209 create index Order_FK on "Order" (
    210 
    211 ID ASC
    212 
    213 )
    214 
    215 go
    216 
    217  
    218 
    219 /*==============================================================*/
    220 
    221 /* Index: Order2_FK                                             */
    222 
    223 /*==============================================================*/
    224 
    225 create index Order2_FK on "Order" (
    226 
    227 roomNum ASC
    228 
    229 )
    230 
    231 go
    232 
    233  
    234 
    235 /*==============================================================*/
    236 
    237 /* Table: Room                                                  */
    238 
    239 /*==============================================================*/
    240 
    241 create table Room (
    242 
    243    roomNum              int                  not null,
    244 
    245    Category             varchar(18)          null,
    246 
    247    constraint PK_ROOM primary key nonclustered (roomNum)
    248 
    249 )
    250 
    251 go
    252 
    253  
    254 
    255 /*==============================================================*/
    256 
    257 /* Index: Contain_FK                                            */
    258 
    259 /*==============================================================*/
    260 
    261 create index Contain_FK on Room (
    262 
    263 Category ASC
    264 
    265 )
    266 
    267 go
    268 
    269  
    270 
    271 /*==============================================================*/
    272 
    273 /* Table: RoomCategory                                          */
    274 
    275 /*==============================================================*/
    276 
    277 create table RoomCategory (
    278 
    279    Category             varchar(18)          not null,
    280 
    281    cnt                  int                  null,
    282 
    283    price                money                null,
    284 
    285    constraint PK_ROOMCATEGORY primary key nonclustered (Category)
    286 
    287 )
    288 
    289 go
    290 
    291  
    292 
    293 alter table "Order"
    294 
    295    add constraint FK_ORDER_ORDER_CUSTOMER foreign key (ID)
    296 
    297       references Customer (ID)
    298 
    299 go
    300 
    301  
    302 
    303 alter table "Order"
    304 
    305    add constraint FK_ORDER_ORDER2_ROOM foreign key (roomNum)
    306 
    307       references Room (roomNum)
    308 
    309 go
    310 
    311  
    312 
    313 alter table Room
    314 
    315    add constraint FK_ROOM_CONTAIN_ROOMCATE foreign key (Category)
    316 
    317       references RoomCategory (Category)
    318 
    319 go
    View Code

     

     

    4.5其他设计

    4.5.1存储过程设计

     

    查询是否有该用户

     1 if exists (select name from sysobjects where name = 'select_exp' and type = 'P')
     2 
     3 drop procedure select_exp
     4 
     5 GO
     6 
     7 create procedure select_exp @id varchar(18),@passwords varchar(20)
     8 
     9 as
    10 
    11 select *
    12 
    13 from Customer
    14 
    15 where Customer.ID = id and Customer.password = @passwords
    16 
    17 Go
    View Code

     

    查询该用户的订房清单

     1 if exists (select name from sysobjects where name = 'order_exp' and type = 'P')
     2 
     3 drop procedure order_exp
     4 
     5 GO
     6 
     7 create procedure order_exp @the_id varchar(18)
     8 
     9 as
    10 
    11 select Customer.name,[Order].beginDate,[Order].endDate,Room.Category,[Order].price
    12 
    13 from Customer left join [Order] on Customer.ID = [Order].ID
    14 
    15 left join Room on [Order].roomNum = Room.roomNum
    16 
    17 where Customer.ID = [Order].ID and [Order].ID = @the_id
    18 
    19 GO
    View Code

     

    查询房间的所有用房时间

     1 if exists (select name from sysobjects where name = 'orderbynum_exp' and type = 'P')
     2 
     3 drop procedure orderbynum_exp
     4 
     5 GO
     6 
     7 create procedure orderbynum_exp @type int
     8 
     9 as
    10 
    11 select [Order].beginDate,[Order].endDate
    12 
    13 from [Order]
    14 
    15 where [Order].roomNum = @type
    16 
    17 Go
    View Code

     

    查询某类房间具体有哪些房间

     1 if exists (select name from sysobjects where name = 'room_exp' and type = 'P')
     2 
     3 drop procedure room_exp
     4 
     5 GO
     6 
     7 create procedure room_exp @type varchar(18)
     8 
     9 as
    10 
    11 select roomNum,price
    12 
    13 from Room left join RoomCategory on Room.Category = RoomCategory.Category
    14 
    15 where Room.Category = @type
    16 
    17 Go
    View Code

     

    插入一条订房信息

     1 if exists (select name from sysobjects where name = 'insert_exp' and type = 'P')
     2 
     3 drop procedure insert_exp
     4 
     5 GO
     6 
     7 create procedure insert_exp @id varchar(18),@room int,@begin DateTime,@end DateTime,@money money
     8 
     9 as
    10 
    11 insert into [Order](ID,roomNum,beginDate,endDate,price)
    12 
    13 values (@id,@room,@begin,@end,@money)
    14 
    15 GO
    16 
    17  
    View Code

    4.5.2 触发器设计

    --统计房间触发器

     1 alter trigger cnt
     2 
     3 on Room for insert
     4 
     5 as
     6 
     7 declare @type varchar(20),@tmp int
     8 
     9 select @type = Category
    10 
    11 from inserted
    12 
    13 select @tmp = COUNT(*)
    14 
    15 from Room
    16 
    17 where Room.Category = @type
    18 
    19 update RoomCategory
    20 
    21 set cnt = @tmp
    22 
    23 where RoomCategory.Category = @type
    24 
    25 go
    26 
    27  
    View Code

    5 应用程序设计

    应用程序采用C#制作,数据库连接使用ADO.NET

    考虑到客户定房间只会给定一个房间种类,和入住时段,如何充分利用房间资源,给客户提供订房服务。这里的解决方案是,遍历所有该种类的房间,找出每个房间的入住时间,如果客户需求的时间不与任何一个时间段冲突,则将这间房间给客户,否则继续找下一个房间。

    具体核心程序:

    登录数据库:

       //登录数据库

            

     1 private void button1_Click(object sender, EventArgs e)
     2 
     3         {
     4 
     5             if(textBox1.Text=="")
     6 
     7             {
     8 
     9                 MessageBox.Show("请输入要连接的数据库名");
    10 
    11             }
    12 
    13             else
    14 
    15             {
    16 
    17                 try
    18 
    19                 {
    20 
    21                     //datastr = "Server=.;Database="+textBox1.Text.Trim()+";Trusted_Connection=SSPI";
    22 
    23                     datastr = "Data Source=.;" +"Persist Security Info=True;" + "Initial Catalog=Hotel;" + "Integrated Security=false;" + "User ID=sa;" + "Password=yinjian..m;";
    24 
    25                     conn = new SqlConnection(datastr);
    26 
    27                     conn.Open();
    28 
    29                     if (conn.State==ConnectionState.Open)
    30 
    31                     {
    32 
    33                         label2.Text = "数据库【" + textBox1.Text.Trim() + "】连接成功";
    34 
    35                     }
    36 
    37                 }
    38 
    39                 catch
    40 
    41                 {
    42 
    43                 }
    44 
    45             }
    46 
    47         }
    View Code

     

     

    用户身份验证及用户订房清单查询:

            //登录身份

            

      1 private void button3_Click(object sender, EventArgs e)
      2 
      3         {
      4 
      5             conn = new SqlConnection(datastr);
      6 
      7             conn.Open();
      8 
      9             id = textBox2.Text.Trim();
     10 
     11             string password = textBox5.Text.Trim();
     12 
     13  
     14 
     15             SqlCommand cmd = new SqlCommand();
     16 
     17             cmd.Connection = conn;
     18 
     19  
     20 
     21             //以存储过程形式执行 sql 语句
     22 
     23             cmd.CommandType = CommandType.StoredProcedure;
     24 
     25             cmd.CommandText = "select_exp";
     26 
     27             //设置输入参数
     28 
     29             cmd.Parameters.AddWithValue("id", id);
     30 
     31             cmd.Parameters.AddWithValue("passwords", password);
     32 
     33  
     34 
     35             cmd.ExecuteNonQuery();
     36 
     37  
     38 
     39             //listView1.Clear();
     40 
     41             SqlDataReader sdr = cmd.ExecuteReader();
     42 
     43             sdr.Read();
     44 
     45             if(sdr.HasRows)
     46 
     47             {
     48 
     49                 flag = true;
     50 
     51                 if (sdr[3].ToString() == "True")
     52 
     53                 {
     54 
     55                     isVIP = true;
     56 
     57                 }
     58 
     59                 else isVIP = false;
     60 
     61                 label2.Text = sdr[1].ToString() + "用户登录成功!";
     62 
     63                 sdr.Close();
     64 
     65                 cmd = new SqlCommand();
     66 
     67                 cmd.Connection = conn;
     68 
     69                 cmd.CommandType = CommandType.StoredProcedure;
     70 
     71                 cmd.CommandText = "order_exp";
     72 
     73                 cmd.Parameters.AddWithValue("the_id", id);
     74 
     75  
     76 
     77                 //数据适配器
     78 
     79                 SqlDataAdapter sda = new SqlDataAdapter();
     80 
     81                 sda.SelectCommand = cmd;
     82 
     83  
     84 
     85                 //数据集
     86 
     87                 DataSet ds = new DataSet();
     88 
     89                 sda.Fill(ds, "cs");
     90 
     91                 dataGridView1.DataSource = ds.Tables[0];
     92 
     93             }
     94 
     95             else
     96 
     97             {
     98 
     99                 MessageBox.Show("用户名或密码错误!");
    100 
    101             }
    102 
    103         }
    View Code

     

     

     

    订房操作

            //订购房间

           

      1  private void button4_Click(object sender, EventArgs e)
      2 
      3         {
      4 
      5             conn = new SqlConnection(datastr);
      6 
      7             conn.Open();
      8 
      9  
     10 
     11             if (flag==true)
     12 
     13             {
     14 
     15                 begin = dateTimePicker1.Value;
     16 
     17                 end = dateTimePicker2.Value;
     18 
     19  
     20 
     21                 MessageBox.Show(end.ToString());
     22 
     23  
     24 
     25                 if(end<begin)
     26 
     27                 {
     28 
     29                     MessageBox.Show("时间非法!");
     30 
     31                    
     32 
     33                 }
     34 
     35                 else
     36 
     37                 {
     38 
     39                     string type = textBox3.Text.Trim();
     40 
     41  
     42 
     43                     SqlCommand cmd = new SqlCommand();
     44 
     45                     cmd.Connection = conn;
     46 
     47                     cmd.CommandType = CommandType.StoredProcedure;
     48 
     49                     cmd.CommandText = "room_exp";
     50 
     51                     cmd.Parameters.AddWithValue("type", type);
     52 
     53  
     54 
     55  
     56 
     57                      //listView1.Clear();
     58 
     59                     SqlDataReader sdr = cmd.ExecuteReader();
     60 
     61  
     62 
     63                     //找出标准单人间有哪些房间,房间号
     64 
     65  
     66 
     67                     int [] room = new int[1000];
     68 
     69                     int cnt = 0;
     70 
     71                
     72 
     73                     while (sdr.Read())
     74 
     75                     {
     76 
     77  
     78 
     79                         room[cnt++] = int.Parse(sdr[0].ToString());
     80 
     81                         xmoneys = decimal.Parse(sdr[1].ToString());
     82 
     83  
     84 
     85                     }
     86 
     87                     sdr.Close();
     88 
     89  
     90 
     91                     bool isflag = true;
     92 
     93                     for(int i = 0; i < cnt; i++)
     94 
     95                     {
     96 
     97                         SqlCommand cmd2 = new SqlCommand();
     98 
     99                         cmd2.Connection = conn;
    100 
    101                         cmd2.CommandType = CommandType.StoredProcedure;
    102 
    103                         cmd2.CommandText = "orderbynum_exp";
    104 
    105                         cmd2.Parameters.AddWithValue("type", room[i]);
    106 
    107                         sdr = cmd2.ExecuteReader();
    108 
    109                         while(sdr.Read())
    110 
    111                         {
    112 
    113                        
    114 
    115                             if(DateTime.Parse(sdr[0].ToString()) <=begin && begin <=DateTime.Parse(sdr[1].ToString()))
    116 
    117                             {
    118 
    119                                 isflag = false;
    120 
    121                                 break;
    122 
    123                             }
    124 
    125                             if(DateTime.Parse(sdr[0].ToString())<=end && end <= DateTime.Parse(sdr[1].ToString()))
    126 
    127                             {
    128 
    129                                 isflag = false;
    130 
    131                                 break;
    132 
    133                             }
    134 
    135                         }
    136 
    137                         sdr.Close();
    138 
    139  
    140 
    141                         if (isflag)
    142 
    143                         {
    144 
    145  
    146 
    147                             // room[i] 有空
    148 
    149                             SqlCommand cmd3 = new SqlCommand();
    150 
    151                             cmd3.Connection = conn;
    152 
    153                             cmd3.CommandType = CommandType.StoredProcedure;
    154 
    155                             cmd3.CommandText = "insert_exp";
    156 
    157                             cmd3.Parameters.AddWithValue("id", id);
    158 
    159                             cmd3.Parameters.AddWithValue("room", room[i]);
    160 
    161                             cmd3.Parameters.AddWithValue("begin",begin);
    162 
    163                             cmd3.Parameters.AddWithValue("end", end);
    164 
    165                             cmd3.Parameters.AddWithValue("money", xmoneys);
    166 
    167  
    168 
    169                             //MessageBox.Show(cmd3.ExecuteNonQuery().ToString());
    170 
    171                             cmd3.ExecuteNonQuery();
    172 
    173                             if(isVIP==true)
    174 
    175                             {
    176 
    177                                 xmoneys = xmoneys * (decimal)0.8;
    178 
    179                                 MessageBox.Show("您的房间号是:"+room[i].ToString()+"您是VIP用户,给您打了8折优惠"+xmoneys.ToString()+"");
    180 
    181  
    182 
    183                             }
    184 
    185                             else
    186 
    187                             {
    188 
    189                                 MessageBox.Show("您的房间号是:" + room[i].ToString() +"缴费"+ xmoneys.ToString() + "");
    190 
    191                             }
    192 
    193                             break;
    194 
    195                         }
    196 
    197                     }
    198 
    199  
    200 
    201                     if(isflag==false)
    202 
    203                     {
    204 
    205                         MessageBox.Show("房间已经被订购完了!");
    206 
    207                     }
    208 
    209                 }
    210 
    211             }
    212 
    213             else
    214 
    215             {
    216 
    217                 MessageBox.Show("请先登录用户!");
    218 
    219             }
    220 
    221         }
    View Code

     

     

     

     

    结 论

    在关系数据库中:

    明确设计的最终目标。

    对于这些数据,要按照功能和逻辑来进行拆分,并且存放在不同的表中,并且明确之间的关系;

    对于设计好的表,要进行重构,根据设计范式对表进行拆分和优化;

    对于每个表要增加对应的完整性检查,关键是实体完整性和参照完整性;

     

     

     

    参 考 文 献

    [1] 王珊 萨师煊.数据库系统概论.第4版.高等教育出版社,2011.5

    [2] 张海藩.软件工程导论(第六版)[M].北京:清华大学出版社,2013.8

  • 相关阅读:
    Euclid's Game (简单博弈)
    “科大讯飞杯”第十七届同济大学程序设计预选赛暨高校网络友谊赛(部分题解)
    牛客小白月赛4 (B 博弈论)
    博弈--尼姆博弈
    C# .net中获取台式电脑中串口设备的名称
    打印出C# 中float ,double 在内存中的存放形式
    VS2010 C++ 创建COM组件
    .net 中两个日期算经过的月份数
    一种计算MD5的实现方法
    将文件从程序集中复原
  • 原文地址:https://www.cnblogs.com/TreeDream/p/7545071.html
Copyright © 2011-2022 走看看