private void publisherAddBtn_Click(object sender, EventArgs e) { if (AddPublisherName.Text != "") { if (bookDAO.insertPublisher(AddPublisherName.Text)) { MessageBox.Show("출판사 추가 완료"); AddPublisherName.Text = ""; selectPublisherList(); } else { MessageBox.Show("출판사 추가 실패"); } } else { MessageBox.Show("추가할 출판사를 입력해주세요."); AddPublisherName.Focus(); } }
private void publisherAddBtn_Click(object sender, EventArgs e) { if (AddPublisherName.Text.Trim() != "") { if (MessageBox.Show("정말 출판사를 추가하시겠습니까?", "출판사 추가", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (bookDAO.insertPublisher(replaceAll(AddPublisherName.Text))) { MessageBox.Show("출판사 추가 완료"); AddPublisherName.Text = ""; selectPublisherList(); } else { MessageBox.Show("출판사 추가 실패"); } } } else { MessageBox.Show("추가할 출판사를 입력해주세요."); AddPublisherName.Focus(); } }
private void AddPublisherName_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (AddPublisherName.Text.Trim() != "") { if (bookDAO.insertPublisher(replaceAll(AddPublisherName.Text))) { MessageBox.Show("출판사 추가 완료"); AddPublisherName.Text = ""; selectPublisherList(); } else { MessageBox.Show("출판사 추가 실패"); } } else { MessageBox.Show("추가할 출판사를 입력해주세요."); AddPublisherName.Focus(); } } }