Christoc.Modules.DnnChat.Components.RoomController.GetRoom C# (CSharp) Method

GetRoom() public method

public GetRoom ( System.Guid roomId, int moduleId ) : Room
roomId System.Guid
moduleId int
return Room
        public Room GetRoom(Guid roomId, int moduleId)
        {
            Room t;
            using (var ctx = DataContext.Instance())
            {
                var rep = ctx.GetRepository<Room>();
                t = rep.GetById(roomId, moduleId);
            }
            return t;
        }

Same methods

RoomController::GetRoom ( string roomName ) : Room

Usage Example

Example #1
0
 protected void ddlRooms_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     divRoomSettings.Visible = true;
     //TODO: load the room into the edit interface.
     var rc = new RoomController();
     if (ddlRooms.SelectedValue != "-1")
     {
         var r = rc.GetRoom(new Guid(ddlRooms.SelectedValue), ModuleId);
         if (r != null)
         {
             txtRoomId.Text = r.RoomId.ToString();
             txtRoomName.Text = r.RoomName;
             txtRoomDescription.Text = r.RoomDescription;
             txtRoomPassword.Text = r.RoomPassword;
             txtRoomWelcome.Text = r.RoomWelcome;
             chkPrivateRoom.Checked = r.Private;
             chkEnabled.Checked = r.Enabled;
         }
     }
 }
All Usage Examples Of Christoc.Modules.DnnChat.Components.RoomController::GetRoom