Beispiel #1
0
        // GET: Evaluation
        public ActionResult Index(string searchTerm = null)
        {
            if (searchTerm != null)
            {
                var lowerSearchTerm = searchTerm.ToLower();
                var model           = ListOfProject.Where(p => p.Name.ToLower().StartsWith(lowerSearchTerm))
                                      .Take(10);

                return(View(model));
            }
            return(View(ListOfProject));
        }
Beispiel #2
0
 public ActionResult Edit(int id, FormCollection collection)
 {
     try
     {
         //Exercise 8 - Course 8
         // TODO: Add update logic here
         var evaluation = ListOfProject.Single(e => e.Id == id);
         if (TryUpdateModel(evaluation))
         {
             return(RedirectToAction("Index"));
         }
         return(View(evaluation));
     }
     catch
     {
         return(View());
     }
 }