예제 #1
0
        private async Task DeleteAppointmentAsync(SchedulerDeleteEventArgs args)
        {
            AppointmentDto item = (AppointmentDto)args.Item;
            await AppointmentService.DeleteAsync(item.ScheduleId, item.AppointmentId);

            SchedulerService.Appointments.Remove(item);
        }
예제 #2
0
        public async Task <IActionResult> Delete([FromRoute] Guid id)
        {
            try
            {
                await appointmentService.DeleteAsync(id);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
예제 #3
0
        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);
        }