private void backBtn_Click(object sender, EventArgs e) { this.Close(); if (formType == 0) { userHome.Location = new Point(this.Location.X, this.Location.Y); userHome.Show(); } else { itemRetrieve.Location = new Point(this.Location.X, this.Location.Y); itemRetrieve.Show(); } }
private void addBtn_Click(object sender, EventArgs e) { using (MySqlConnection con = new MySqlConnection(Database.getConnection())) { MySqlCommand com = con.CreateCommand(); try { con.Open(); string sql = @"INSERT INTO task_history (taskSeq, content, rgstDate) VALUES " + "(" + task.seq + ", '" + contentBox.Text + "' , NOW())"; com.CommandText = sql; com.ExecuteNonQuery(); sql = @"UPDATE task SET updateRead=1 " + "WHERE seq=" + task.seq; com.CommandText = sql; com.ExecuteNonQuery(); } catch { MessageBox.Show("데이터베이스 연결오류"); } con.Close(); this.Close(); itemRetrieve.Location = new Point(this.Location.X, this.Location.Y); itemRetrieve.Show(); } }