public IEnumerable<IResult> SchedulerClosedDaysEdited(object sender, AppointmentEditedEventArgs e) { AppClosedDay savingAppointment = ((AppClosedDay)e.Appointment); if (e.Appointment.IsNotNull()) { //SaveBusinessClosedDay this.SchedulerIsBusy = true; var reqSave = new SaveBusinessClosedDayRequest(savingAppointment); yield return reqSave; if (reqSave.Error != null) { //this.SchedulerDialogViewModel.Cancel(); yield return HandleExceptionResult.Display(reqSave.Error); this.SchedulerIsBusy = false; yield break; } this.SchedulerClosedDaysEditingId = Guid.Empty; this.SchedulerIsBusy = false; yield break; } }
public IEnumerable<IResult> SchedulerClosedDaysCreated(object sender, AppointmentCreatedEventArgs e) { AppClosedDay savingAppointment = ((AppClosedDay)e.CreatedAppointment); if (savingAppointment.IsNotNull()) { //SaveBuisnessClosedDay this.SchedulerIsBusy = true; // Workaround savingAppointment.Start = savingAppointment.IsAllDayEvent ? DateEx.GetStartOfDay(savingAppointment.Start) : savingAppointment.Start; savingAppointment.End = savingAppointment.IsAllDayEvent ? DateEx.GetEndOfDay(savingAppointment.End) : savingAppointment.End; var reqSave = new SaveBusinessClosedDayRequest(savingAppointment); yield return reqSave; if (reqSave.Error != null) { yield return HandleExceptionResult.Display(reqSave.Error); this.SchedulerIsBusy = false; yield break; } savingAppointment.IsNew = false; this.SchedulerIsBusy = false; yield break; } }