public void UpdateTrip(Trip trip) { TripRepository.Update(trip); SaveTrip(); }
public void CreateTrip(Trip trip) { TripRepository.Add(trip); this.SaveTrip(); }
public void DeleteTrip(Trip trip) { TripRepository.Delete(trip); SaveTrip(); }
public ActionResult Create(CreateViewModel createViewModel) { if (!ModelState.IsValid) { return View(createViewModel); } var trip = new Trip() { Name = createViewModel.Name, Description = createViewModel.Description, TripCode = createViewModel.TripCode, NumberOfDay = createViewModel.NumberOfDay != null ? createViewModel.NumberOfDay.Value : 0 }; TripService.CreateTrip(trip); TempData["TripId"] = trip.TripId; TempData["TripName"] = trip.Name; TempData["Message"] = TripsMessage.CreateSuccess; return RedirectToAction("index", "trips"); }