- 分享
- 0
- 人气
- 7
- 主题
- 13
- 帖子
- 1837
- UID
- 76124
- 积分
- 2113
- 阅读权限
- 20
- 注册时间
- 2007-5-6
- 最后登录
- 2018-4-22
- 在线时间
- 1487 小时
|
- /// <summary>
- /// Retrive the a set of bookings information from database base on the pass-in criteria.
- /// </summary>
- /// <param name="roomid">A Room ID. 0 to search all.</param>
- /// <param name="from">A minute stamp value. The begining of a time range to be searched.</param>
- /// <param name="to">A minute stamp value. The ending of a time range to be searched.</param>
- /// <param name="host">Host of booking. Empty ("") to search all.</param>
- /// <param name="part">Participants of booking. Empty ("") to search all.</param>
- /// <param name="purposeid">A Purpose ID. 0 to search all.</param>
- /// <param name="rem">Remarks of booking. Empty ("") to search all.</param>
- /// <param name="active">Search Enabled=1.</param>
- /// <param name="canceled">Search Enabled=0.</param>
- /// <param name="userid">A User ID. 0 to search all.</param>
- /// <returns>Bookings information.</returns>
- public static DB.viwBookingDataTable GetBookings( int roomid, long from, long to, string host, string part, int purposeid, string rem, bool active, bool canceled, int userid )
- {
- string sql = "SELECT * FROM "+db.viwBooking.TableName+" WHERE 1=1 ";
- if( roomid!=0 ) sql += "AND "+db.viwBooking._tblbooking_RoomIDColumn.ColumnName +" = "+roomid+" ";
- sql += "AND ( ";
- sql += "("+db.viwBooking.BookingFromColumn.ColumnName +" >= "+from+" AND "+db.viwBooking.BookingFromColumn.ColumnName +" <= "+to+") OR ";
- sql += "("+db.viwBooking.BookingToColumn.ColumnName +" >= "+from+" AND "+db.viwBooking.BookingToColumn.ColumnName +" <= "+to+") ";
- sql += ") ";
- if( host!="" ) sql += "AND "+db.viwBooking.BookingHostColumn.ColumnName +" LIKE '"+FixLikeStr(host)+"' ";
- if( part!="" ) sql += "AND "+db.viwBooking.BookingParticipantColumn.ColumnName +" LIKE '"+FixLikeStr(part)+"' ";
- if( purposeid!=0 ) sql += "AND "+db.viwBooking._tblbooking_PurposeIDColumn.ColumnName +" = "+purposeid+" ";
- if( rem!="" ) sql += "AND "+db.viwBooking.BookingRemColumn.ColumnName +" LIKE '"+FixLikeStr(rem)+"' ";
- if( active && !canceled ) sql += "AND "+db.viwBooking.BookingEnabledColumn.ColumnName +" = 1 ";
- else if( !active && canceled ) sql += "AND "+db.viwBooking.BookingEnabledColumn.ColumnName +" = 0 ";
- if( userid!=0 ) sql += "AND "+db.viwBooking._tblbooking_UserIDColumn.ColumnName +" = "+userid+" ";
- sql += "ORDER BY "+db.viwBooking.BookingFromColumn.ColumnName;
- //
- DB.viwBookingDataTable dt = new SmartMeeting.DataAccess.DB.viwBookingDataTable();
- if( ExecuteQuery(sql,dt) ) return dt;
- else return new DB.viwBookingDataTable();
- }
复制代码
死jason kow 你的东西那么 pro 我怎样跟 啊!!!!!
|
|