示例#1
0
        public ActionResult Tour()
        {
            TourBL tourBL = new TourBL();
            TourVM tour   = new TourVM();

            tour.tourList = tourBL.GetTour();

            return(View(tour));
        }
示例#2
0
        public ActionResult DeleteConcert(int id)
        {
            TourBL      tourBL   = new TourBL();
            List <Tour> postList = tourBL.GetTour();
            Tour        tour     = postList.Where(u => u.TourId == id).Single();

            tourBL.DeleteConcert(tour);

            TourVM t = new TourVM();

            t.tourList = tourBL.GetTour();

            return(RedirectToAction("Tour", "Home", t));
        }
示例#3
0
        public void Put(Guid id, [FromBody] TourVM tour)
        {
            var t = _uow.Tours.Get(id);

            t.Name           = tour.Name;
            t.Image          = tour.Image;
            t.Images         = tour.Images;
            t.Description    = tour.Description;
            t.DepartureDate  = tour.DepartureDate;
            t.DepartureId    = tour.DepartureId;
            t.DestinationId  = tour.DestinationId;
            t.Slot           = tour.Slot;
            t.ViewCount      = tour.ViewCount;
            t.TourCategoryId = tour.TourCategoryId;
            _uow.Tours.Update(t);
            var result = _uow.SaveChanges();
        }
示例#4
0
 public void Post([FromBody] TourVM tour)
 {
     _uow.Tours.Add(_mapper.Map <Tour>(tour));
     _uow.SaveChanges();
 }