Esempio n. 1
0
        /// <summary>
        /// 新增和修改
        /// </summary>
        /// <param name="room">房间对象</param>
        /// <param name="temp">1为新增,2为修改</param>
        /// <returns>是否成功</returns>
        public bool SaveRoom(RoomInfo room, int temp)//
        {
            int r = -1;

            if (temp == 1)
            {
                r = dal.AddRoomInfo(room);
            }
            else if (temp == 2)
            {
                r = dal.UpdateRoomInfo(room);
            }
            return(r > 0 ? true : false);
        }
Esempio n. 2
0
 public bool AddOrUpdateRoomInfo(RoomInfo roomInfo, int temp)
 {
     if (temp == 1)
     {
         return(dal.AddRoomInfo(roomInfo) > 0);
     }
     else if (temp == 2)
     {
         return(dal.UpdateRoomInfo(roomInfo) > 0);
     }
     return(false);
 }
Esempio n. 3
0
        /// <summary>
        /// 新增或者修改房间信息
        /// </summary>
        /// <returns></returns>
        public bool SaveRoomInfo(RoomInfo ri, int flag)
        {
            int r = -1;

            if (flag == 1)
            {
                r = dal.AddRoomInfo(ri);
            }
            else if (flag == 2)
            {
                r = dal.UpdateRoomInfo(ri);
            }

            return(r > 0);
        }