Posted By

Dmix on 04/01/15


Tagged

calendar event control events scheduler aspnet MVC loading razor mvc5 timespans blocked


Versions (?)

Dynamic Loading of Blocked/Marked Timespans in Event Calendar (DHTMLX Scheduler .NET)


 / Published in: C#
 

URL: http://blog.scheduler-net.com/post/asp-net-calendar-control-example-loading-blocked-timespans.aspx

A coherent tutorial that explains how you can manage visibility of reserved time spans for different users in one appointment calendar in ASP.NET. The web control used - DHTMLX Scheduler .NET v.3.3

  1. public ContentResult Data()
  2. {
  3. var context = new ApplicationDbContext();
  4. var appUserId = User.Identity.GetUserId();
  5.  
  6. var apps = context.SchedulerEvents.Where(e => e.UserId == appUserId).ToList();
  7. return new SchedulerAjaxData(apps);
  8. }
  9.  
  10. public ActionResult Save(int? id, FormCollection actionValues)
  11. {
  12. var action = new DataAction(actionValues);
  13. var context = new ApplicationDbContext();
  14. try
  15. {
  16. var changedEvent = DHXEventsHelper.Bind<SchedulerEvent>(actionValues);
  17.  
  18. changedEvent.UserId = User.Identity.GetUserId();
  19. ….
  20. }
  21. catch
  22. {
  23. action.Type = DataActionTypes.Error;
  24. }
  25.  
  26. return (new AjaxSaveResponse(action));
  27. }

Report this snippet  

You need to login to post a comment.