Esempio n. 1
0
        public ActionResult <Trip> GetTrip(string tripId)
        {
            ObjectId _id = ObjectId.Parse(tripId);
            string   id  = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;

            return(_tripService.GetTrip(id, _id));
        }
Esempio n. 2
0
        public async Task <ActionResult <TripResDTO> > GetTrip(int id)
        {
            var trip = await _tripService.GetTrip(id);

            if (trip == null)
            {
                return(NotFound());
            }

            return(Ok(trip));
        }
Esempio n. 3
0
        public ActionResult DeleteTrip(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Index"));
            }

            var tripService = new TripService();
            var tripDelete  = tripService.GetTrip(id.Value);

            return(View(tripDelete));
        }
Esempio n. 4
0
        public ActionResult UpdateTrip(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Index"));
            }

            SetDropdownsInViewBags();

            var tripService = new TripService();
            var trip        = tripService.GetTrip(id.Value);

            return(View(trip));
        }
Esempio n. 5
0
 public Trip GetTrip(int id)
 {
     return(tripService.GetTrip(id));
 }