private void btnDelete_Click(object sender, EventArgs e)
        {
            DialogResult dlr = MessageBox.Show("Do you want to delete this service ? ", "Notify", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dlr == DialogResult.Yes)
            {
                ServiceDAO.DeleteService(txtServiceName.Text);
                this.Dispose();
                //FrmServices a = new FrmServices();
                //a.ShowDialog();
            }
        }
Exemplo n.º 2
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         if (serviceDAO.DeleteService(id))
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View("Delete"));
         }
     }
     catch
     {
         return(View("Delete"));
     }
 }
 // SERVICE DELETE's PROCESS
 public ActionResult ServiceDelete(string id) => IsLoggedIn() && ServiceDAO.DeleteService(id) ? Content("OK") : Content("Error");