public async Task <IActionResult> Create(Tour model) { if (!ModelState.IsValid) { return(View(model)); } await _repository.Create(model); return(RedirectToAction("Index")); }
public void CreateTour(Tour tour, HttpPostedFileBase tourThumb, HttpPostedFileBase KrPanoZip) { using (TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = IsolationLevel.ReadCommitted, Timeout = CommonConfiguration.Configuration.TransactionScope_Timeout })) { var tourId = _tourRepository.Create(tour); tour.AssetTourThumbnailId = ProcessIncomingImage(tour.ClientId, tour.CreateUserId.Value, tour.AssetTourThumbnailId, null, tourThumb); tour.KrPanoTourId = ProcessIncomingKrPano(tour, tour.KrPanoTourId, null, KrPanoZip); if (tour.AssetTourThumbnailId != null && _tourRepository.UpdateEntity(tour) > 0 && tour.Id > 0) { transaction.Complete(); } } }