I am using DHTMLX Scheduler
in my MVC4 application. I need to set the reminder in scheduler.
If the user set the reminder for a particular appointment for example before 2 days, automatically email alert should be sent to the user.
Is it possible to include the reminder in scheduler Or Whether any other option is there to add reminder?
And My code for scheduler is
public ActionResult CalendarView(int id, tblUser user, int? Userid)
{
var scheduler = new DHXScheduler(this);
scheduler.Skin = DHXScheduler.Skins.Flat;
scheduler.Data.Loader.PreventCache();
scheduler.EnableDynamicLoading(SchedulerDataLoader.DynamicalLoadingMode.Week);
scheduler.Extensions.Add(SchedulerExtensions.Extension.Recurring);
//scheduler.Extensions.Add(SchedulerExtensions.Extension.ActiveLinks);
//scheduler.Extensions.Add(SchedulerExtensions.Extension.Collision);
scheduler.Extensions.Add(SchedulerExtensions.Extension.Limit);
scheduler.LoadData = true;
scheduler.EnableDataprocessor = true;
scheduler.Config.show_loading = true;
int idays = System.DateTime.Now.Day - 1;
int imonths = System.DateTime.Now.Month;
int iyears = System.DateTime.Now.Year;
int hours = System.DateTime.Now.Hour;
int minute = System.DateTime.Now.Minute;
int second = System.DateTime.Now.Second;
scheduler.TimeSpans.Add(new DHXBlockTime()
{
StartDate = new DateTime(2014, 2, 10),
EndDate = new DateTime(iyears, imonths, idays + 1, hours, minute, second),
});
Session["BUId"] = id;
var parameter = new SqlParameter[1];
parameter[0] = new SqlParameter { ParameterName = "UserId", Value = id };
List<Appt> cm = new List<Appt>();
using (SYTEntities context = new SYTEntities())
{
cm = context.Database.SqlQuery<Appt>("exec spHoliday @UserId", parameter).ToList();
}
foreach (var cp in cm)
{
iyear = cp.HolidayDate.Year;
imonth = cp.HolidayDate.Month;
iday = cp.HolidayDate.Day;
scheduler.TimeSpans.Add(new DHXMarkTime()
{
StartDate = new DateTime(iyear, imonth, iday), //new DateTime(2015, 8, 06), //hl.HolidayDate ?? default(DateTime),
EndDate = new DateTime(iyear, imonth, iday + 1),
// Day = DayOfWeek.Friday,
CssClass = "red_section",
HTML = "hos",
SpanType = DHXTimeSpan.Type.BlockEvents
});
}
scheduler.BeforeInit.Add("schedulerClient.init()");
return View(scheduler);
}