private void btnUpload_Click(object sender, EventArgs e) { try { //파일을 /bin/debug/ 폴더에 업로드하고 텍스트박스의 파일명을 DB에 저장할 이름으로 변경하는 기능 txtPictureBinding(txtPictureLink1); txtPictureBinding(txtPictureLink2); txtPictureBinding(txtPictureLink3); UploadMuseumVO item = new UploadMuseumVO(); TrainmuseumService ts = new TrainmuseumService(); item.museumTitle = txtTitle.Text; item.userID = lblWriter.Text; item.spectation = txtSpectation.Text; item.museumContents = txtContents.Text; item.carType = cbxCarType.SelectedValue.ToString(); item.status = cbxStatus.SelectedValue.ToString(); item.fuelType = cbxFuelType.SelectedValue.ToString(); item.carSize = cbxCarSize.SelectedValue.ToString(); item.photoFile1 = txtPictureLink1.Text; item.photoFile2 = txtPictureLink2.Text; item.photoFile3 = txtPictureLink3.Text; ts.Insert(item); MessageBox.Show("업로드가 완료되었습니다."); this.Close(); ts.SelectAll(); } catch { MessageBox.Show("업로드가 실패했습니다."); return; } }
private void Form1_Load(object sender, EventArgs e) { DataTable dt = ld.InfoLoadData(); MuseumTreeView(dt); dtAll = ts.SelectAll(); dtAll2 = ts.BoardSelectAll(); MuseumPictureView(dtAll, listView1); }