温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:酒店管理系统(ExtJs)源码
当前文件:
MyHotelManager/HotelDAL/OpenRoomInfoDAO.cs,打开代码结构图
MyHotelManager/HotelDAL/OpenRoomInfoDAO.cs,打开代码结构图1using System; 2
using System.Collections.Generic; 3
using System.Text; 4
using System.Data; 5
using System.Data.SqlClient; 6
using HotelModels; 7
8
namespace HotelDAL 9
{ 10
public class OpenRoomInfoDAO 11
{ 12
13
SqlHelper sh = new SqlHelper(); 14
DataSet ds; 15
private SqlParameter para; //参数 16
17
18
19
/// <summary> 20
/// 查询所有的开房信息(首页的Grid,带搜索功能) 21
/// </summary> 22
/// <param name="message"></param> 23
/// <returns></returns> 24
public DataSet GetOpenRoomInfoAll(string message) 25
{ 26
try 27
{ 28
SqlParameter[] sp ={ 29
para = new SqlParameter("@message",message) 30
}; 31
ds = sh.GetDataSet("GetOpenRoomInfoAll", sp); 32
} 33
catch (Exception ex) 34
{ 35
throw ex; 36
} 37
return ds; 38
} 39
40
41
42
/// <summary> 43
/// 开房操作 44
/// </summary> 45
/// <param name="orib"></param> 46
/// <returns></returns> 47
public int OpenRoom(OpenRoomInfoBean orib) 48
{ 49
int count = 0; 50
try 51
{ 52
SqlParameter[] sp ={ 53
para = new SqlParameter("@RoomId",orib.RoomId), 54
para = new SqlParameter("@GuestNumber",orib.GuestNumber), 55
para = new SqlParameter("@GuestName",orib.GuestName), 56
para = new SqlParameter("@GuestMoney",orib.GuestMoney), 57
para = new SqlParameter("@Remark",orib.Remark) 58
}; 59
count = sh.RunSql("OpenRoom", sp); 60
} 61
catch (Exception ex) 62
{ 63
throw ex; 64
} 65
return count; 66
} 67
68
69
70
71
/// <summary> 72
/// 退房操作 73
/// </summary> 74
/// <param name="Number"></param> 75
/// <returns></returns> 76
public int CloseRoom(string Number) 77
{ 78
int count = 0; 79
try 80
{ 81
SqlParameter[] sp ={ 82
para = new SqlParameter("@Number",Number) 83
}; 84
count = sh.RunSql("CloseRoom", sp); 85
} 86
catch (Exception ex) 87
{ 88
throw ex; 89
} 90
return count; 91
} 92
93
} 94
} 95





}