public ActionResult LOList()
 {
     var list = db.LearningObjects;
     if (list.Count == 0)
     {
         MessageOnPage emptyListMessage = new MessageOnPage("List of learning objects", "Learning objects list is empty");
         return RedirectToAction("MessagePage", "Home", emptyListMessage);
     }
     else
     {
         return View(list);
     }
 }
 public ActionResult CoursesList()
 {
     var list = db.Courses;
     if (list.Count == 0)
     {
         MessageOnPage emptyListMessage = new MessageOnPage("List of courses is empty", "List of courses is empty");
         return RedirectToAction("MessagePage", "Home", emptyListMessage);
     }
     else
     {
         return View(list);
     }
 }
 public ActionResult EditLO(string id)
 {
     var LO = db.GetLOByID(id);
     if (LO != null)
     {
         return View(LO);
     }
     else
     {
         MessageOnPage errorMessage = new MessageOnPage("Error", "No LO in base with id: " + id);
         return RedirectToAction("MessagePage", "Home", errorMessage);
     }
 }
 public ActionResult MessagePage(MessageOnPage msg)
 {
     return View(msg);
 }
 public ActionResult NewLO(LearningObject incomingLO)
 {
     if (ModelState.IsValid)
     {
         //return RedirectToAction("MessagePage", new { title = "Succes",  message = "LO succesfully added to DB"});
         try
         {
             db.CreateLO(incomingLO);
             MessageOnPage msg = new MessageOnPage("Succes", "LO succesfully added to DB");
             return RedirectToAction("MessagePage", "Home", msg);
         }
         catch (Exception ex)
         {
             string exceptionMessage = ex.Message;
             string wholeMessage = @"<script language=""javascript"">alert('\n" + "Error during saving to database\n" + exceptionMessage + @"\n')</script>";
             Response.Write(wholeMessage);
         }
     }
     return View(incomingLO);
 }