Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146911 | Aug 25,2019 05:42 PM UTC | Oct 23,2019 08:56 AM UTC | Blazor | 9 |
![]() |
Tags: Scheduler |
<EjsSchedule TValue="AppointmentData" Height="650px" SelectedDate="new DateTime(2018, 5, 14)">
<ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings>
</EjsSchedule>
@code{
List<AppointmentData> DataSource = new List<AppointmentData>
{
new AppointmentData { Id = 1, Subject = "Paris", StartTime = new DateTime(2018, 5, 13, 10, 0, 0) , EndTime = new DateTime(2018, 5, 13, 12, 0, 0) },
new AppointmentData { Id = 2, Subject = "Germany", StartTime = new DateTime(2018, 5, 15, 10, 0, 0) , EndTime = new DateTime(2018, 5, 15, 12, 0, 0) }
};
public class AppointmentData
{
public int Id { get; set; }
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
}
}
public void OnActionCompleted(ActionEventArgs<AppointmentData> args)
{
if (args.RequestType == "eventCreated")
{
args.AddedRecords.ForEach(app =>
{
var newEvent = new AppointmentData();
newEvent.StartTime = app.StartTime.ToLocalTime();
newEvent.EndTime = app.EndTime.ToLocalTime();
newEvent.Subject = app.Subject;
newEvent.Description = app.Description;
newEvent.Id = app.Id;
db.CalendarEvents.Add(newEvent);
});
db.SaveChanges();
}
…
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.