示例#1
0
 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));
     }
 }
示例#2
0
 public bool editStatistic(int StatisticID, Statistic statistic)
 {
     try
     {
         _entities.Entry(statistic).State = EntityState.Modified;
         _entities.SaveChanges();
     }
     catch
     {
         return false;
     }
     return true;
 }
示例#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;
 }
示例#4
0
 public ActionResult Delete(int id, Statistic statistic)
 {
     if (statisticDAO.deleteStatistic(id))
         return RedirectToAction("Index");
     else return View("Delete", statisticDAO.getStatistic(id));
 }