Beispiel #1
0
 private async void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         decimal id = Convert.ToDecimal(dgvScan.CurrentRow.Cells[0].FormattedValue);
         ScanDAO.getInstance().delete(id, table);
         dateTimePicker.Value = DateTime.Now;
         await reloadDGVAsync();
     }
     catch
     {
     }
 }
Beispiel #2
0
        async Task  addNew()
        {
            String message = "successfully";

            try
            {
                var model = getScanModel();
                ScanDAO.getInstance().add(model);
                txtInput.Focus();
                await reloadDGVAsync();
            }catch (Exception e)
            {
                message = e.Message;
            }
            MessageBox.Show(message);
        }