private void roomTile_Click(object sender, EventArgs e) { // 해당 타일을 클릭하는 경우, 즉 학생이 접속하는 경우에 해당 Button joinRoom_tile = (MetroTile)sender; int joinRoomNo = Int32.Parse(joinRoom_tile.Name.Split('_')[1]); // 클릭한 타일의 Name 값에 방 번호가 저장되어 있음 if (this.userDTO.Accessno == 1) // 교수는 다른 방에 들어가지 못하도록 우선적으로 막음. { MessageBox.Show("학생만 다른 방에 들어갈 수 있습니다.", "방 들어가기", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DialogResult stuFormResult; RoomDAO roomDAO = new RoomDAO(); RoomDTO joinRoomDTO = new RoomDTO(); joinRoomDTO = roomDAO.GetJoinRoomDTO(joinRoomNo); if (!joinRoomDTO.Name.Equals("")) { using (StudentDownloadForm studentDownloadForm = new StudentDownloadForm(userDTO, joinRoomDTO)) { stuFormResult = studentDownloadForm.ShowDialog(); } // 학생이 방에 들어가는 로직을 만들어야 함. // 여기는 학생이 로그인 시 userDTO를 같이 넘겨줘야함 } else { MessageBox.Show("해당 방은 없는 방입니다. 방 목록을 새로고침 합니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Warning); ShowAllRoomList(); } }
public FileDownloadForm(ClientSocketWork clientSocketWork, string fileName, string newFileName, StudentDownloadForm stuForm) { InitializeComponent(); this.clientSocketWork = clientSocketWork; this.requestFileName = fileName; this.stuForm = stuForm; this.newFileName = newFileName; }
public ClientSocketWork(UserDTO userDTO, StudentDownloadForm stuForm) { this.clientFileControl = new ClientFileControl(); this.userDTO = userDTO; this.stuForm = stuForm; }