Beispiel #1
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     using (var confirm = new Authorize()) //Ensure deletions aren't done accidentally
     {
         var result = confirm.ShowDialog();
         if (result == DialogResult.OK)
         {
             OdbcCommand query = new OdbcCommand("DELETE from client where id = '" + ClientID + "'", Utilities.kis_clients);
             query.ExecuteNonQuery();
             Close();
         }
     }
 }
 private void btnDelete_Click(object sender, EventArgs e)
 {
     using (var confirm = new Authorize()) //Deleting a service also deletes records of its use, so require confirmation
     {
         var result = confirm.ShowDialog();
         if (result == DialogResult.OK)
         {
             Service     current = (Service)cmbService.SelectedItem;
             OdbcCommand query   = new OdbcCommand("DELETE from service where id = '" + current.ID + "'", Utilities.kis_clients);
             query.ExecuteNonQuery();
             Close();
         }
     }
 }
Beispiel #3
0
 //unlock a record that is stuck locked (e.g. if a hard crash occurred while a record was open)
 private void btnUnlock_Click(object sender, EventArgs e)
 {
     using (var confirm = new Authorize()) //Get the user to confirm that they haven't just double-opened the record before unlocking
     {
         var result = confirm.ShowDialog();
         if (result == DialogResult.OK)
         {
             OdbcCommand query = new OdbcCommand("UPDATE client SET edit_locked = 0 WHERE id = " + ClientID, Utilities.kis_clients);
             query.ExecuteNonQuery();
             Close();
             new ClientRecord(ClientID);
         }
     }
 }