public string GetReports() { WarningIterator iterator = ReportIterator(); List <Report> reportsList = new List <Report>(); for (Warning warning = iterator.First(); !iterator.IsFinished; warning = iterator.Next()) { reportsList.Add((Report)warning._warning); } return(new JavaScriptSerializer().Serialize(reportsList)); }
//se o utilizador for do tipo Common mostra o respetivo menu inicial public ActionResult Index() { WarningIterator alertIterator = AlertIterator(); WarningIterator reportIterator = ReportIterator(); ViewBag.alertIterator = alertIterator; ViewBag.reportIterator = reportIterator; Notifications(); return(View()); }
public WarningIterator ReportIterator() { WarningCollection reportCollection = new WarningCollection(); Report[] reports = db.GetReports(); for (int i = 0; i < reports.Length; i++) { reportCollection[i] = new Warning(reports[i]); } WarningIterator reportIterator = reportCollection.CreateIterator() as WarningIterator; return(reportIterator); }
public WarningIterator AlertIterator() { WarningCollection alertCollection = new WarningCollection(); Alert[] alerts = db.GetAlerts(); for (int i = 0; i < alerts.Length; i++) { alertCollection[i] = new Warning(alerts[i]); } WarningIterator alertIterator = alertCollection.CreateIterator() as WarningIterator; return(alertIterator); }