Esempio n. 1
0
        /// <summary>
        /// Returns all Rooms currently in this Group
        /// </summary>
        /// <param name="GroupId"></param>
        /// <returns></returns>
        public Rooms ALLRooms(int GroupId)
        {
            try
            {
                Rooms X = new Rooms();
                string sSQL = "Select g.RoomId FROM tblGroupRoomRel g " +
                    "left outer join tblRoom r ON r.Id = g.RoomId " +
                    "WHERE g.GroupId = " + GroupId +
                    " ORDER BY r.Name";

                DataTable DT = GetDataTable(sSQL);
                foreach(DataRow R in DT.Rows)
                {
                    Room Ro = GetRoom(Convert.ToInt32((object)R[0]));

                    if(Ro != null)
                        X.Add(Ro);
                }
                DT.Dispose();
                return X;
            }
            catch(Exception Err)
            {
                throw new ApplicationException(Err.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Returns all Rooms currently in the System
        /// </summary>
        /// <returns></returns>
        public Rooms ALLRooms()
        {
            try
            {

                Rooms X = new Rooms();
                string sSQL = "Select * FROM tblRoom ORDER BY Name";
                DataTable DT = GetDataTable(sSQL);
                foreach(DataRow R in DT.Rows)
                {
                    Room Ro = GetRoom(Convert.ToInt32((object)R[0]));
                    if(Ro != null)
                        X.Add(Ro);
                }
                DT.Dispose();
                return X;
            }
            catch(Exception Err)
            {
                throw new ApplicationException(Err.Message);
            }
        }