public virtual object[] GetTimeSheets(HttpContext context) { TimeSheetCollection timesheets = new TimeSheetCollection(); using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); if (SecurityManager.CheckPermision(cn, WellKnownRSID.TimeSheetRoot, BPMPermision.Read)) { timesheets = cn.GetTimeSheets(); } } List <object> rv = new List <object>(); foreach (TimeSheet timesheet in timesheets) { rv.Add(new { Name = timesheet.Name }); } return(rv.ToArray()); }
public ActionResult Index() { // Fake timesheets for now... var timesheets = new TimeSheetCollection(); var ts1 = new TimeSheet(); ts1.Date = new System.DateTime(2014, 1, 21); ts1.WorkSubject = "Mise en place du projet, versionnement sur Git, stylisation avec Bootstrap"; ts1.HoursWorked = 5.25; timesheets.Add(ts1); var ts2 = new TimeSheet(); ts2.Date = new System.DateTime(2014, 1, 22); ts2.WorkSubject = "Déploiement sur Azure, migration à VS2013"; ts2.HoursWorked = 6.50; timesheets.Add(ts2); return(View(timesheets)); }