Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Hide();
            MyWriting writing = new MyWriting();

            writing.ShowDialog();
            Close();
        }
Ejemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            GetConnection();
            name = MyWriting.boardname;
            string       sql = "delete from board where boardname='" + name + "' and content='" + contenttxt.Text + "'";
            MySqlCommand cmd = new MySqlCommand(sql, conn);

            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
            MessageBox.Show("게시글이 삭제되었습니다.");
            Hide();
            MyWriting writing = new MyWriting();

            writing.ShowDialog();
            Close(); // 삭제 후 돌아가기
        }
Ejemplo n.º 3
0
        private void button4_Click(object sender, EventArgs e)
        {
            GetConnection();
            name = MyWriting.boardname;
            string       sql = "update board set title='" + titletxt.Text + "',content='" + contenttxt.Text + "' where boardname='" + name + "' and id='" + idtxt.Text + "'";
            MySqlCommand cmd = new MySqlCommand(sql, conn);

            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
            MessageBox.Show("게시글이 수정되었습니다.");
            Hide();
            MyWriting writing = new MyWriting();

            writing.ShowDialog();
            Close(); // 수정 후 돌아가기
        }