Пример #1
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("رکورد جاری پاک شود؟", "پاک کردن رکورد", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         db.deletePerson(person.getId());
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
Пример #2
0
        public void updatePerson(Personnel person)
        {
            string sql = "UPDATE personnel SET name = '" + person.getName() +
                         "', start = '" + person.getStart() +
                         "', work = " + person.getWork() +
                         ", rest = " + person.getRest() +
                         ", xp_id = " + person.getXpId() +
                         " WHERE id = " + person.getId() + ";";

            connection.Open();
            SQLiteCommand command = new SQLiteCommand(sql, connection);

            command.ExecuteNonQuery();
            connection.Close();
        }