📄 roomtypedao.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Model;
namespace DAL
{
public class RoomTypeDAO
{
SQLHelper sqlhelper = new SQLHelper();
/// <summary>
/// 查询房间类型表所有
/// </summary>
/// <returns></returns>
public DataSet Bindselect()
{
DataSet ds = sqlhelper.GetDateSet("select * from RoomType");
return ds;
}
/// <summary>
/// 根据ID删除信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public int delete(int id)
{
int count = sqlhelper.RunSQL("delete from RoomType where TypeId="+id);
return count;
}
/// <summary>
/// 根据ID查询信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public DataSet selectwhereid(int id)
{
DataSet ds = sqlhelper.GetDateSet("select * from RoomType where TypeId="+id);
return ds;
}
/// <summary>
/// 修改
/// </summary>
/// <param name="room"></param>
/// <returns></returns>
public int update(RoomTypeEntity room)
{
int count = sqlhelper.RunSQL("update RoomType set TypeName='" + room.TypeName + "',TypePrice=" + double.Parse(room.TypePrice) + ",AddBedPrice=" + double.Parse(room.AddBedPrice) + ",IsAddBed='" + room.IsAddBed + "',Remark='" + room.Remark + "' where TypeID=" + room.TypeID);
return count;
}
/// <summary>
/// 插入客房类型信息
/// </summary>
/// <param name="room"></param>
/// <returns></returns>
public int insert(RoomTypeEntity room)
{
int count = sqlhelper.RunSQL("insert into RoomType values('" + room.TypeName + "'," + double.Parse(room.TypePrice) + "," + double.Parse(room.AddBedPrice) + ",'" + room.IsAddBed + "','" + room.Remark + "')");
return count;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -