Ejemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (titletxt.Text.Trim() == "" || contenttxt.Text.Trim() == "")
     {
         if (MessageBox.Show("모든 항목을 입력해 주세요.", "", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.Retry)
         {
             titletxt.Text   = "";
             contenttxt.Text = "";
         }
     }
     else
     {
         GetConnection();
         string       id   = Login.id;
         string       name = "자유게시판";
         string       sql  = "insert into board(id,boardname,title, content, date) values ('" + id + "','" + name + "','" + titletxt.Text + "','" + contenttxt.Text + "', Now())";
         MySqlCommand cmd  = new MySqlCommand(sql, conn);
         conn.Open();
         cmd.ExecuteNonQuery();
         conn.Close();
         MessageBox.Show("게시글이 작성되었습니다.");
         this.Hide();
         Free free = new Free();
         free.ShowDialog();
         this.Close();
     }
 }
Ejemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Hide();
            Free free = new Free();

            free.ShowDialog();
            Close();
        }