예제 #1
0
        private void _acceptBtn_Click(object sender, EventArgs e)
        {
            Destination destination = new Destination();

            destination.name = _destinationTb.Text.Trim();
            destination.city = (_citiesCbb.SelectedItem as BusinessEntity.VietNamCities.City).name;

            for (int i = 0; i < _tourSitesTempLv.Items.Count; i++)
            {
                TourSite toursite = new TourSite();
                toursite.name        = _tourSitesTempLv.Items[i].Text;
                toursite.Destination = destination;
                destination.TourSites.Add(toursite);
            }

            for (int i = 0; i < _hotelBindingSource.Count; i++)
            {
                var hotel = _hotelBindingSource.List[i] as Hotel;
                hotel.Destination = destination;
                destination.Hotels.Add(hotel);
            }

            _destinationPresenter.addDestination(destination);
            clearAllTb();
        }
예제 #2
0
        private void addTourSite()
        {
            TourSite toursite = new TourSite();

            toursite.name           = _tourSiteName.Text.Trim();
            toursite.destination_id = _destination.id;
            _presenter.addTourSite(toursite);
        }
 public void deleteTourSite(TourSite toursite)
 {
     _bus.deletaById(toursite.id);
 }
 public void addTourSite(TourSite toursite)
 {
     _bus.add(toursite);
     this.loadTourSiteByDesinationId(toursite.destination_id);
 }
예제 #5
0
 public void update(TourSite toursite)
 {
     _unitOfWork.TourSiteRepository.Update(toursite);
     _unitOfWork.Save();
 }
예제 #6
0
 public void add(TourSite toursite)
 {
     _unitOfWork.TourSiteRepository.Insert(toursite);
     _unitOfWork.Save();
 }