public HttpResponseMessage Delete(int Id) { _svc.Delete(Id); SuccessResponse response = new SuccessResponse(); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public async Task <IActionResult> DeleteConfirmed(int id) { Appointment appointment = _service.Get(id); _service.Delete(appointment.id); return(RedirectToAction(nameof(Index))); }
public ActionResult Delete(string ap_patient, string ap_dept, string date) { DateTime da = DateTime.Parse(date); AppointmentService pa = new AppointmentService(); var res = pa.Delete(ap_patient, ap_dept, da); // return RedirectToAction(nameof(Index)); return(Json(res, JsonRequestBehavior.AllowGet)); }
public override void ExtraDelete(User patient) { AppointmentService service = new AppointmentService(); List <Appointment> result = service.GetAll(r => r.Doctor.Id == patient.Id).ToList(); foreach (var item in result) { service.Delete(item); } }
public async Task DeleteShouldThrowExceptionsCorrectly(int appointmentId) { this.SetupSqlite(); await this.SeedDatabase(); using var context = new ApplicationDbContext(this.ContextOptions); var repository = new EfDeletableEntityRepository <Appointment>(context); var appointmentService = new AppointmentService(repository); await Assert.ThrowsAsync <ArgumentNullException>(() => appointmentService.Delete(appointmentId)); }
public IActionResult Delete(string id) { var Appointment = _AppointmentService.Get(id); if (Appointment == null) { return(NotFound()); } _AppointmentService.Delete(Appointment.Id); return(NoContent()); }
public async Task DeleteShouldWorkCorrectly(int appointmentId) { this.SetupSqlite(); await this.SeedDatabase(); using var context = new ApplicationDbContext(this.ContextOptions); var repository = new EfDeletableEntityRepository <Appointment>(context); var appointmentService = new AppointmentService(repository); var deleteResult = await appointmentService.Delete(appointmentId); Assert.True(deleteResult != null); }
public override void ExtraDelete(Doctor doctor) { AppointmentService service = new AppointmentService(); List <Appointment> result = service.GetAll(r => r.Doctor.Id == doctor.Id).ToList(); foreach (var item in result) { service.Delete(item); } UserService UserSevice = new UserService(); UserSevice.Delete(UserSevice.GetById(doctor.UserId)); }
// GET: Appointments/Delete/5 public ActionResult Delete(int id) { if (id == null) { return(NotFound()); } Appointment appointment = appService.Delete(id); if (appointment == null) { return(NotFound()); } return(View(appointment)); }
private void deleteAppointmentButton_Click(object sender, EventArgs e) { var selectedAppointment = GetItemFromSelectedRow(appointmentGridView); if (selectedAppointment == null) { return; } var id = selectedAppointment.Id; appointmentService.Delete(id); reminderService.DeleteByAppointmentId(id); List <AppointmentAggregate> newAppointmentList = appointments.ToList(); newAppointmentList.Remove(appointments.First(p => p.Id == id)); initBindingSource(newAppointmentList); appointmentBindingSource.ResetBindings(false); }
public void Delete(Appointment entity) => _appointmentService.Delete(entity);
public ActionResult DeleteConfirmed(int id) { appService.Delete(id); appService.Save(); return(RedirectToAction(nameof(Index))); }
public ActionResult DeleteConfirmed(Guid id) { _appointmentService.Delete(id); return(RedirectToAction("Index")); }