您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->酒店管理系统(ExtJs)源码>>HotelDAL/RoomDAO.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:酒店管理系统(ExtJs)源码
当前文件:文件类型 MyHotelManager/HotelDAL/RoomDAO.cs打开代码结构图
普通视图
		            
1using System; 2using System.Collections.Generic; 3using System.Text; 4using System.Data; 5using System.Data.SqlClient; 6using HotelModels; 7//该源码首发自www.51aspx.com(51aspx.com) 8 9namespace HotelDAL 10{ 11 public class RoomDAO 12 { 13 14 SqlHelper sh = new SqlHelper(); 15 DataSet ds; 16 private SqlParameter para; //参数 17 18 19 /// <summary> 20 /// 根据类型Id查询所有客房信息(状态为空闲) 21 /// </summary> 22 /// <param name="TypeId"></param> 23 /// <returns></returns> 24 public DataSet GetRoomByTypeId(int TypeId) 25 { 26 try 27 { 28 SqlParameter[] sp ={ 29 para = new SqlParameter("@TypeId",TypeId) 30 }; 31 ds = sh.GetDataSet("GetRoomByTypeId", sp); 32 } 33 catch (Exception ex) 34 { 35 throw ex; 36 } 37 return ds; 38 } 39 40 41 /// <summary> 42 /// 添加客房表 43 /// </summary> 44 /// <param name="rb"></param> 45 /// <returns></returns> 46 public int AddRoom(RoomBean rb) 47 { 48 int count = 0; 49 try 50 { 51 SqlParameter[] sp ={ 52 para = new SqlParameter("@Number",rb.Number), 53 para = new SqlParameter("@BedNumber",rb.BedNumber), 54 para = new SqlParameter("@TypeId",rb.TypeId), 55 para = new SqlParameter("@StateId",rb.StateId), 56 para = new SqlParameter("@Remark",rb.Remark) 57 }; 58 count = sh.RunSql("AddRoom", sp); 59 } 60 catch (Exception ex) 61 { 62 throw ex; 63 } 64 return count; 65 } 66 67 68 69 /// <summary> 70 /// 查询所有客房信息(查看客房信息用到,带搜索) 71 /// </summary> 72 /// <param name="message"></param> 73 /// <returns></returns> 74 public DataSet GetAllRoom(string message) 75 { 76 try 77 { 78 SqlParameter[] sp ={ 79 para = new SqlParameter("@message",message) 80 }; 81 ds = sh.GetDataSet("GetAllRoom", sp); 82 } 83 catch (Exception ex) 84 { 85 throw ex; 86 } 87 return ds; 88 } 89 90 91 /// <summary> 92 /// 查询所有状态为空闲的房间(删除客房时用到) 93 /// </summary> 94 /// <returns></returns> 95 public DataSet GetRoom() 96 { 97 try 98 { 99 ds = sh.GetDataSet("GetRoom"); 100 } 101 catch (Exception ex) 102 { 103 throw ex; 104 } 105 return ds; 106 } 107 108 109 /// <summary> 110 /// 删除客房表(根据房间编号) 111 /// </summary> 112 /// <param name="Number"></param> 113 /// <returns></returns> 114 public int DelRoom(string Number) 115 { 116 int count = 0; 117 try 118 { 119 SqlParameter[] sp ={ 120 para = new SqlParameter("@Number",Number) 121 }; 122 count = sh.RunSql("DelRoom", sp); 123 } 124 catch (Exception ex) 125 { 126 throw ex; 127 } 128 return count; 129 } 130 } 131} 132
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:酒店管理系统(ExtJs)源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号