温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:酒店管理系统(ExtJs)源码
当前文件:
MyHotelManager/HotelDAL/RoomTypeDAO.cs,打开代码结构图
MyHotelManager/HotelDAL/RoomTypeDAO.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 RoomTypeDAO 11
{ 12
13
SqlHelper sh = new SqlHelper(); 14
DataSet ds; 15
private SqlParameter para; //参数 16
17
18
/// <summary> 19
/// 添加房间类型 20
/// </summary> 21
/// <param name="rtb"></param> 22
/// <returns></returns> 23
public int AddRoomType(RoomTypeBean rtb) 24
{ 25
int count = 0; 26
try 27
{ 28
SqlParameter[] sp = { 29
para = new SqlParameter("@TypeName",rtb.TypeName), 30
para = new SqlParameter("@TypePrice",rtb.TypePrice), 31
para = new SqlParameter("@IsTv",rtb.IsTv), 32
para = new SqlParameter("@IsKongTiao",rtb.IsKongTiao), 33
para = new SqlParameter("@Remark",rtb.Remark) 34
}; 35
count = sh.RunSql("AddRoomType", sp); 36
} 37
catch (Exception ex) 38
{ 39
throw ex; 40
} 41
return count; 42
} 43
44
45
46
/// <summary> 47
/// 删除房间类型(根据类型Id) 48
/// </summary> 49
/// <param name="TypeId"></param> 50
/// <returns></returns> 51
public int DelRoomType(int TypeId) 52
{ 53
int count = 0; 54
try 55
{ 56
SqlParameter[] sp ={ 57
para = new SqlParameter("@TypeId",TypeId) 58
}; 59
count = sh.RunSql("DelRoomType", sp); 60
} 61
catch (Exception ex) 62
{ 63
throw ex; 64
} 65
return count; 66
} 67
68
69
70
/// <summary> 71
/// 查询所有房间类型(查询房间类型用到,带搜索) 72
/// </summary> 73
/// <param name="message"></param> 74
/// <returns></returns> 75
public DataSet GetAllRoomType(string message) 76
{ 77
try 78
{ 79
SqlParameter[] sp ={ 80
para = new SqlParameter("@message",message) 81
}; 82
ds = sh.GetDataSet("GetAllRoomType", sp); 83
} 84
catch (Exception ex) 85
{ 86
throw ex; 87
} 88
return ds; 89
} 90
91
92
93
/// <summary> 94
/// 查询所有未被使用的房间类型(删除用到) 95
/// </summary> 96
/// <returns></returns> 97
public DataSet GetRoomType() 98
{ 99
try 100
{ 101
ds = sh.GetDataSet("GetRoomType"); 102
} 103
catch (Exception ex) 104
{ 105
throw ex; 106
} 107
return ds; 108
} 109
110
111
112
/// <summary> 113
/// 查询今日房价 114
/// </summary> 115
/// <returns></returns> 116
public DataSet GetTodyPrice() 117
{ 118
try 119
{ 120
ds = sh.GetDataSet("GetTodyPrice"); 121
} 122
catch (Exception ex) 123
{ 124
throw ex; 125
} 126
return ds; 127
} 128
} 129
} 130





}