温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:酒店管理系统(三层开发)源码
当前文件:
ThreeLayerHotel/DAO/UserRoomDAL.cs,打开代码结构图
ThreeLayerHotel/DAO/UserRoomDAL.cs,打开代码结构图1using System; 2
using System.Collections.Generic; 3
using System.Linq; 4
using System.Text; 5
using Entity; 6
using System.Data; 7
8
namespace DAL 9
{ 10
public class UserRoomDAL 11
{ 12
public static DataTable GetUserRoom() 13
{ 14
string sql = "select * from UserRoom"; 15
return SQLHelp.FillTable(sql); 16
} 17
18
public static DataTable GetUserRoomByHotelUser_UserNameRoom_Number(string UserName,string Number) 19
{ 20
string sql = "EXEC SEL_UserRoom '"+UserName+"','"+Number+"'"; 21
return SQLHelp.FillTable(sql); 22
} 23
24
public static DataTable GetUserReceptionTable() 25
{ 26
string sql = "select * from View_UserReception"; 27
return SQLHelp.FillTable(sql); 28
} 29
30
public static DataTable GetUserReceptionByUserName(string UserName) 31
{ 32
string sql = "select * from View_UserReception where UserName = '"+UserName+"'"; 33
return SQLHelp.FillTable(sql); 34
} 35
36
public static DataTable GetUserReceptionByName(string Name) 37
{ 38
string sql = "select * from View_UserReception where Name like '%" + Name + "%'"; 39
return SQLHelp.FillTable(sql); 40
} 41
42
public static DataTable GetUserReceptionStateByRoomID(int RoomID) 43
{ 44
string sql = "select state,username,number from View_UserReception where RoomID = " + RoomID + ""; 45
return SQLHelp.FillTable(sql); 46
} 47
48
public static int AddUserRoom(UserRoomEntity URE) 49
{ 50
string sql = "insert into UserRoom values("+URE.UserID+","+URE.RoomID+",'"+URE.State+"')"; 51
return SQLHelp.ExecQuery(sql); 52
} 53
/**/ 54
public static int UpdateUserReceptionStateByRoomID(int RoomID) 55
{ 56
string sql = "update Room set state = '入住' where RoomID = " + RoomID + ""; 57
SQLHelp.ExecQuery(sql); 58
string strsql = "EXEC UPD_State "+RoomID; 59
return SQLHelp.ExecQuery(strsql); 60
} 61
62
63
64
public static int DeleteUserRoomByUserID(int UserID,int RoomID) 65
{ 66
string sql = "delete from UserRoom where UserID = " + UserID + "and RoomID = " + RoomID; 67
return SQLHelp.ExecQuery(sql); 68
} 69
} 70
} 71





}
}