private async Task DeleteAppointmentAsync(SchedulerDeleteEventArgs args) { AppointmentDto item = (AppointmentDto)args.Item; await AppointmentService.DeleteAsync(item.ScheduleId, item.AppointmentId); SchedulerService.Appointments.Remove(item); }
public async Task <IActionResult> Delete([FromRoute] Guid id) { try { await appointmentService.DeleteAsync(id); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task KendoCall(string action, string jsonData) { if (action == "edit") { var result = JsonSerializer.Deserialize <AppointmentDto>(jsonData, JsonOptions); await OnEditCallback.InvokeAsync(result); } else if (action == "move") { var result = JsonSerializer.Deserialize <AppointmentDto>(jsonData, JsonOptions); await AppointmentService.EditAsync(UpdateAppointmentRequest.FromDto(result)); } else if (action == "delete") { var result = JsonSerializer.Deserialize <AppointmentDto>(jsonData, JsonOptions); await AppointmentService.DeleteAsync(result.AppointmentId); SchedulerService.Appointments.Remove(SchedulerService.Appointments.First(x => x.AppointmentId == result.AppointmentId)); CallJSMethod(); } }
private async Task DeleteAppointment() { await AppointmentService.DeleteAsync(Appointment.AppointmentId); await OnAppointmentChanged.InvokeAsync(Appointment.Title); }