Example #1
0
        public bool DeleteRoom(int roomId, out string error)
        {
            error = string.Empty;

            try
            {
                var entity = DiscussionClassRoomRepository.GetById(roomId);

                if (entity == null)
                {
                    error = "Room entity not found";
                    return(false);
                }

                DiscussionClassRoomRepository.Delete(entity);

                DiscussionClassRoomRepository.UnitOfWork.CommitAndRefreshChanges();

                return(true);
            }
            catch (Exception ex)
            {
                error = Utils.FormatError(ex);
                Logger.Error("delete room", roomId, ex, CommonEnums.LoggerObjectTypes.Discussion);
                return(false);
            }
        }
Example #2
0
 public DiscussionClassRoomDTO GetClassRoomDTO(int roomId)
 {
     return(roomId < 0 ? new DiscussionClassRoomDTO() : DiscussionClassRoomRepository.GetById(roomId).Entity2ClassRoomDto());
 }