public ViewResult Details(HotTours hot_tour) { return View("Thanks", hot_tour); }
public void SaveHotTour(HotTours b) { var context = new TourEntities1(); if (b.Id == 0) { context.HotTours.Add(b); } else { HotTours dbEntry = context.HotTours.Find(b.Id); if (dbEntry != null) { dbEntry.Description = b.Description; dbEntry.Price = b.Price; dbEntry.Category = b.Category; dbEntry.ImageData = b.ImageData ?? dbEntry.ImageData; dbEntry.ImageMimeType = b.ImageMimeType; dbEntry.AmountPeople = b.AmountPeople; dbEntry.DepartureDay = b.DepartureDay; dbEntry.Food = b.Food; dbEntry.Period = b.Period; dbEntry.TourType = b.TourType; dbEntry.Location = b.Location; dbEntry.HotelId = b.HotelId; } } context.SaveChanges(); }