Esempio n. 1
0
 private void NewEmployeeForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (firstStep && fid != -100)
     {
         if (dc.deleteRequest(fid))
         {
             string w = dc.wait();
             if (w != "OK")
             {
                 MetroFramework.MetroMessageBox.Show(this, "ERROR\n" + w, "SORRY !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
             }
             MetroFramework.MetroMessageBox.Show(this, dc.get(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Esempio n. 2
0
        private void performDelete()
        {
            DataGridViewRow row = dataGrid.CurrentRow;
            string          q   = "DELETE FROM employee WHERE id='" + row.Cells["id"].Value.ToString() + "'";

            if (oc.insert(q))
            {
                df++;
            }
            else
            {
                df = 0;
                return;
            }
            dc.deleteRequest(Convert.ToInt32(row.Cells["fid"].Value.ToString().Substring(3)));
            dc.wait();
            if (dc.get() == "Deleted!")
            {
                df++;
            }
        }