Ejemplo n.º 1
0
        public HttpResponseMessage Delete(int Id)
        {
            _svc.Delete(Id);
            SuccessResponse response = new SuccessResponse();

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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());
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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));
        }
Ejemplo n.º 9
0
        // 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));
        }
Ejemplo n.º 10
0
        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)));
 }
Ejemplo n.º 13
0
 public ActionResult DeleteConfirmed(Guid id)
 {
     _appointmentService.Delete(id);
     return(RedirectToAction("Index"));
 }