Hi everyone,
I wanted to add 3 Pages.. If Supervisor login will direct to supersior page, if engineer login will direct to engineer's page and so on.
Here is the code:
protected override void OnPreInit(EventArgs e) {
base.OnPreInit(e);
Page.MasterPageFile = (Session["role"].ToString() == "ME") ? "ME.Master" : "ME.Master";
}
protected List<preventiveRecord> listPrevRecord(string criteria) {
List<preventiveRecord> lpr = new List<preventiveRecord>();
switch (criteria) {
case "dueTomorrow": lpr = sdc.preventiveRecords.Where(a => a.preventive.Site == Session["site"].ToString() && a.Date_Due == DateTime.Today.AddDays(1) && a.Date_Done == null).ToList(); break;
case "allNearestFuture":
foreach (preventive p in sdc.preventives.Where(a => a.Site == Session["site"].ToString())) {
lpr.Add(p.preventiveRecords.Single(b => b.Date_Due == p.preventiveRecords.Where(a => a.Date_Due > DateTime.Today).Min(a => a.Date_Due)));
}
//lpr = sdc.preventiveRecords.Where(a => a.preventive.Site == Session["site"].ToString() && a.Date_Due > DateTime.Today).ToList();
break;
}
return lpr;
}
thanks and regards