Exemplo n.º 1
0
        public JsonResult Delete(DoctorviewModel model)
        {
            int deleteIndex = 0;

            try
            {
                deleteIndex = DoctorManager.Delete(model.DoctorId);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(deleteIndex > 0 ? Reload() : ErroResult("Failed To Delete"));
        }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (Program.DeleteConfirm("Do you want delete this doctor? All patient actions who belongs to this doctor also be deleted."))
            {
                DoctorManager.Delete(doct); // Veritabanından doktoru sil

                MessageBox.Show("Doctor successfully deleted!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

                refreshDoctors();         // Combobox'ı güncelle

                changeVisible(false);     // formu gizle
                chkStatus.Checked = true; // formu boş hale al
                cbxDoctors.Text   = "";   // Combobox'taki ismi sil
            }
        }