public ActionResult Edit(int idTour, int id, Statistic statistic)
 {
     if (statisticDAO.editStatistic(idTour, statistic))
         return RedirectToAction("Index");
     else
     {
         ViewDataSelectList(-1);
         return View("Edit", statisticDAO.getStatistic(id));
     }
 }
Beispiel #2
0
 public bool editStatistic(int StatisticID, Statistic statistic)
 {
     try
     {
         _entities.Entry(statistic).State = EntityState.Modified;
         _entities.SaveChanges();
     }
     catch
     {
         return false;
     }
     return true;
 }
Beispiel #3
0
 public bool addStatistic(int TourID, Statistic statistic)
 {
     try
     {
         statistic.Tour = GetStatisticTour(TourID);
         _entities.Statistics.Add(statistic);
         _entities.SaveChanges();
     }
     catch
     {
         return false;
     }
     return true;
 }
 public ActionResult Delete(int id, Statistic statistic)
 {
     if (statisticDAO.deleteStatistic(id))
         return RedirectToAction("Index");
     else return View("Delete", statisticDAO.getStatistic(id));
 }