public IActionResult Delete(int?id) { ActionResult <Schedule> schedule = _business.GetById(id); if (schedule.Value == null) { return(NotFound("Consulta não encontrada")); } _business.Delete(schedule.Value); return(Ok()); }
private void repositoryItemDelete_Click(object sender, EventArgs e) { if (gridView1.FocusedRowHandle == GridControl.NewItemRowHandle) { return; } if (XtraMessageBox.Show(this, "Bạn chắn chắn xóa dòng này?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { var row = gridView1.GetFocusedDataRow(); // get data on one row bool result = schedulueBusiness.Delete((int)row["PatientScheduleID"]); // delete in schedule paramater (datatype)row["ScheduleID"] if (result) { gridView1.DeleteSelectedRows(); } else { XtraMessageBox.Show(this, "Xóa thất bại", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public Result Delete(int id) { return(_scheduleBusiness.Delete(id)); }