Employee action (full code)

Employee action (full code)

public ActionResult Employee()
{
            var scheduler = new DHXScheduler(this);
 
    #region check rights
            if (!RoleIs("Employee"))
            {
                return RedirectToAction("Index", "System");
            }
    #endregion
 
    #region configuration
 
            scheduler.Extensions.Add(SchedulerExtensions.Extension.Cookie);
            scheduler.Extensions.Add(SchedulerExtensions.Extension.Tooltip);
            scheduler.Templates.tooltip_text = "<b>Task:</b> {text}<br/><b>Start date:</b> '+scheduler.templates.tooltip_date_format(start)+'<br/><b>End date:</b> '+scheduler.templates.tooltip_date_format(end) +'";
    #endregion
 
    #region views
            scheduler.Views.Clear();
            scheduler.Views.Add(new WeekAgendaView());
            scheduler.Views.Add(new MonthView());
            scheduler.InitialView = scheduler.Views[0].Name;//week agenda view should be active by default
    #endregion
 
    #region data
            scheduler.SetEditMode(EditModes.Forbid);       
            scheduler.LoadData = true;
            scheduler.DataAction = "Tasks";
            scheduler.Data.Loader.PreventCache();
            scheduler.InitialDate = new DateTime(2011, 10, 7);
    #endregion
 
            return View(scheduler);
}

comments powered by Disqus