资源简介

北大青鸟项目实战.使用C#的三层架构做的酒店管理系统.

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using HotelManagerModels;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;

namespace HotelManagerDAL
{
    public class RoomService
    {
        private string conStr = ConfigurationManager.ConnectionStrings[“HotelDB“].ConnectionString;

        public IList GetRoomAllList()
        {
            IList rooms = new List();
            using (SqlConnection conn = new SqlConnection(conStr))
            {
                SqlCommand cmd = new SqlCommand(“usp_SelectRoomsAll“conn);
                conn.Open();
                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        Room room = new Room();
                        room.RoomID = Convert.ToInt32(reader[“roomID“]);
                        room.Number = Convert.ToString(reader[“Number“]);
                        room.TypeID = Convert.ToInt32(reader[“TypeID“]);
                        room.BedNumber = Convert.ToInt32(reader[“BedNumber“]);
                        room.Description = Convert.ToString(reader[“description“]);
                        room.State = Convert.ToString(reader[“state“]);
                        room.GuestNumber = Convert.ToInt32(reader[“guestNumber“]);
                        rooms.Add(room);
                    }
                }
            }
            return rooms;
        }

        public Room GetRoomByNumber(string number)
        {
            Room room = new Room();
            using (SqlConnection conn = new SqlConnection(conStr))
            {
                SqlCommand cmd = new SqlCommand(“usp_SelectRoomsByRoomNumber“conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(“@Number“ SqlDbType.NVarChar 50).Value = number;
                conn.Open();
                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        room.RoomID = Convert.ToInt32(reader[“RoomID“]);
                        room.Number = number;
                        room.GuestNumber = Convert.ToInt32(reader[“GuestNumber“]);
                        room.Description = Convert.ToString(reader[“Description“]);
                        room.State = Convert.ToString(reader[“State“]);
                        room.BedNumber = Convert.ToInt32(reader[“BedNumber“]);
                        room.TypeID = Convert.ToInt32(reader[“TypeID“]);
                    }
                }
            }
            return room;
        }

        public IList GetRoomsByRoomNumber(string number)
        {
            IList rooms = new List();
            using (SqlConnection conn = new SqlConnection(conStr))
            {
                SqlCommand cmd = new SqlCommand

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

     文件       2436  2008-12-06 14:16  HotelManageSystem\HotelManageSystem.sln

    ..A..H.     43008  2009-02-09 19:27  HotelManageSystem\HotelManageSystem.suo

     文件       5556  2008-12-08 13:47  HotelManageSystem\HotelManageSystem\HotelManager.csproj

     文件        251  2008-12-07 14:15  HotelManageSystem\HotelManageSystem\App.config

     文件        479  2008-12-05 14:09  HotelManageSystem\HotelManageSystem\Program.cs

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\保存.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\查询选择.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\计算.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\取消.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\删除.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\上记录.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\首记录.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\搜索.bmp

     文件       1322  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\退出.BMP

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\尾记录.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\下记录.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\新增.bmp

     文件        246  2008-12-06 12:16  HotelManageSystem\HotelManageSystem\Resources\修改.bmp

     文件        293  2008-12-06 12:14  HotelManageSystem\HotelManageSystem\obj\HotelManageSystem.csproj.FileList.txt

     文件        784  2008-12-04 23:09  HotelManageSystem\HotelManageSystem\obj\Debug\HotelManageSystem.csproj.GenerateResource.Cache

     文件       6144  2008-12-07 14:06  HotelManageSystem\HotelManageSystem\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       1644  2009-01-29 15:43  HotelManageSystem\HotelManageSystem\obj\Debug\HotelManageSystem.MainForm.resources

     文件       6938  2008-12-11 20:30  HotelManageSystem\HotelManageSystem\obj\Debug\HotelManageSystem.Properties.Resources.resources

     文件        180  2009-01-29 15:23  HotelManageSystem\HotelManageSystem\obj\Debug\HotelManageSystem.RoomSettingForm.resources

     文件        180  2008-12-11 20:30  HotelManageSystem\HotelManageSystem\obj\Debug\HotelManageSystem.RoomTypeSetting.resources

     文件      53248  2009-01-29 15:43  HotelManageSystem\HotelManageSystem\obj\Debug\HotelManageSystem.exe

     文件      58880  2009-01-29 15:43  HotelManageSystem\HotelManageSystem\obj\Debug\HotelManageSystem.pdb

     文件       8795  2008-12-11 20:29  HotelManageSystem\HotelManageSystem\obj\Debug\ResolveAssemblyReference.cache

     文件       1519  2009-01-29 15:43  HotelManageSystem\HotelManageSystem\obj\Debug\HotelManager.csproj.GenerateResource.Cache

     文件        678  2008-12-12 12:05  HotelManageSystem\HotelManageSystem\obj\HotelManager.csproj.FileList.txt

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

评论

共有 条评论