📄 userroomdal.cs
字号:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using System.Data;
namespace DAL
{
public class UserRoomDAL
{
public static DataTable GetUserRoom()
{
string sql = "select * from UserRoom";
return SQLHelp.FillTable(sql);
}
public static DataTable GetUserRoomByHotelUser_UserNameRoom_Number(string UserName,string Number)
{
string sql = "EXEC SEL_UserRoom '"+UserName+"','"+Number+"'";
return SQLHelp.FillTable(sql);
}
public static DataTable GetUserReceptionTable()
{
string sql = "select * from View_UserReception";
return SQLHelp.FillTable(sql);
}
public static DataTable GetUserReceptionByUserName(string UserName)
{
string sql = "select * from View_UserReception where UserName = '"+UserName+"'";
return SQLHelp.FillTable(sql);
}
public static DataTable GetUserReceptionByName(string Name)
{
string sql = "select * from View_UserReception where Name like '%" + Name + "%'";
return SQLHelp.FillTable(sql);
}
public static DataTable GetUserReceptionStateByRoomID(int RoomID)
{
string sql = "select state,username,number from View_UserReception where RoomID = " + RoomID + "";
return SQLHelp.FillTable(sql);
}
public static int AddUserRoom(UserRoomEntity URE)
{
string sql = "insert into UserRoom values("+URE.UserID+","+URE.RoomID+",'"+URE.State+"')";
return SQLHelp.ExecQuery(sql);
}
/**/
public static int UpdateUserReceptionStateByRoomID(int RoomID)
{
string sql = "update Room set state = '入住' where RoomID = " + RoomID + "";
SQLHelp.ExecQuery(sql);
string strsql = "EXEC UPD_State "+RoomID;
return SQLHelp.ExecQuery(strsql);
}
public static int DeleteUserRoomByUserID(int UserID,int RoomID)
{
string sql = "delete from UserRoom where UserID = " + UserID + "and RoomID = " + RoomID;
return SQLHelp.ExecQuery(sql);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -