Beispiel #1
0
 public IActionResult DatTourTuyChon(TourTuyChonViewModel tourTC)
 {
     if (ModelState.IsValid)
     {
         this._dattourService.DatTourTuyChon(tourTC);
         return(View("/Views/Home/Index.cshtml"));
     }
     return(View());
 }
Beispiel #2
0
 public TourTuyChon(TourTuyChonViewModel tourTuyChonViewModel)
 {
     this.ID           = tourTuyChonViewModel.ID;
     this.TenKH        = tourTuyChonViewModel.TenKH;
     this.Email        = tourTuyChonViewModel.Email;
     this.Sdt          = tourTuyChonViewModel.Sdt;
     this.Mien         = tourTuyChonViewModel.Mien;
     this.Songuoidi    = tourTuyChonViewModel.Songuoidi;
     this.Ngaykhoihanh = tourTuyChonViewModel.Ngaykhoihanh;
     this.Ghichu       = tourTuyChonViewModel.Ghichu;
     this.Xacnhan      = tourTuyChonViewModel.Xacnhan;
 }
        public void DatTourTuyChon(TourTuyChonViewModel tourTC)
        {
            var newTour = new TourTuyChonViewModel
            {
                TenKH        = tourTC.TenKH,
                Email        = tourTC.Email,
                Sdt          = tourTC.Sdt,
                Mien         = tourTC.Mien,
                Songuoidi    = tourTC.Songuoidi,
                Ngaykhoihanh = tourTC.Ngaykhoihanh,
                Ghichu       = tourTC.Ghichu,
                Xacnhan      = 0
            };
            var newTourTuyChon = new TourTuyChon(newTour);

            _db.TourTuyChons.Add(newTourTuyChon);
            _db.SaveChanges();
        }