예제 #1
0
        public ActionResult Update(int idPoint = 0)
        {
            PointModel point = MgtPoint.GetInstance().GetPointById(idPoint).ToModel();

            point.ListTypePointOptions = MgtTypePoint.GetInstance().GetAllItems();
            point.ListCourseOptions    = MgtRace.GetInstance().GetAllItems();
            return(View(point));
        }
예제 #2
0
        public ActionResult Create(int id = 0)
        {
            PointModel point = new PointModel();

            point.ListTypePointOptions = MgtTypePoint.GetInstance().GetAllItems();
            point.IdCourse             = id;
            point.Ordre = MgtPoint.GetInstance().GetAllWithCourseAndTypePointByCourse(id).Count;
            return(View(point));
        }
예제 #3
0
        public ActionResult Edit(int id = 0)
        {
            var result = MgtTypePoint.GetInstance().GetTypePoint(id).ToModel();

            if (result == null)
            {
                return(HttpNotFound());
            }

            return(View(result));
        }
예제 #4
0
        public ActionResult Delete(int idPoint)
        {
            var            result    = MgtPoint.GetInstance().GetPointById(idPoint).ToModel();
            RaceModel      race      = MgtRace.GetInstance().GetRace(result.IdCourse).ToModel();
            TypePointModel typePoint = MgtTypePoint.GetInstance().GetTypePoint(result.IdTypePoint).ToModel();

            result.LibelleCourse    = race.Title;
            result.LibelleTypePoint = typePoint.Libelle;

            if (result == null)
            {
                return(HttpNotFound());
            }

            return(View(result));
        }
예제 #5
0
 public ActionResult Create(TypePointModel typePoint)
 {
     try
     {
         if (ModelState.IsValid && MgtTypePoint.GetInstance().AddTypePoint(typePoint.ToBo()))
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         }
     }
     catch
     {
         return(View());
     }
 }
예제 #6
0
 public ActionResult Edit(TypePointModel typePoint)
 {
     try
     {
         var result = MgtTypePoint.GetInstance().UpdateTypePoint(typePoint.ToBo());
         if (result)
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         }
     }
     catch
     {
         return(View());
     }
 }
예제 #7
0
 public ActionResult Create(PointModel point)
 {
     try
     {
         if (ModelState.IsValid && MgtPoint.GetInstance().AddPoint(point.ToBo()))
         {
             return(RedirectToAction("Index", new { id = point.IdCourse }));
         }
         else
         {
             point.ListTypePointOptions = MgtTypePoint.GetInstance().GetAllItems();
             return(View(point));
         }
     }
     catch
     {
         point.ListTypePointOptions = MgtTypePoint.GetInstance().GetAllItems();
         return(View(point));
     }
 }
예제 #8
0
        public ActionResult Index()
        {
            List <TypePointModel> result = MgtTypePoint.GetInstance().GetAllItems().ToModels();

            return(View(result));
        }