Beispiel #1
0
 public IList <Package> GetAll()
 {
     using (var context = new LandingAgencyModel())
     {
         return(context.Package.ToList());;
     }
 }
Beispiel #2
0
 public IList <Product> GetProducts(int packageId)
 {
     using (var context = new LandingAgencyModel())
     {
         return(context.PackageProduct.Where(p => p.PackageId == packageId).Select(p => p.Product).ToList());
     }
 }
 public Reservation GetReservationById(int id)
 {
     using (var context = new LandingAgencyModel())
     {
         return(context.Reservation.First(c => c.ReservationId == 1));
     }
 }
 public IList <Reservation> GetAll()
 {
     using (var context = new LandingAgencyModel())
     {
         return(context.Reservation.ToList());
     }
 }
Beispiel #5
0
 public Package GetPackageById(int id)
 {
     using (var context = new LandingAgencyModel())
     {
         var package = context.Package.First(c => c.PackageId == id);
         package.Products = GetProducts(package.PackageId);
         return(package);
     }
 }
        public void Post([FromBody] Reservation res)
        {
            LandingAgencyModel LAM         = new LandingAgencyModel();
            Reservation        reservation = new Reservation();

            reservation.DurationStay    = res.DurationStay;
            reservation.AmountTravelers = res.AmountTravelers;
            reservation.Package         = res.Package;
            reservation.Client          = res.Client;

            LAM.Reservation.Add(reservation);
            LAM.SaveChanges();
        }
Beispiel #7
0
        public IList <Package> GetPackageByDescription(string description)
        {
            using (var context = new LandingAgencyModel())
            {
                var packages = context.Package.ToList();

                if (description != null)
                {
                    packages.RemoveAll(item => !item.PackageName.Contains(description));
                }

                return(packages);
            }
        }
Beispiel #8
0
 public IList <ClientType> GetAll()
 {
     using (var context = new LandingAgencyModel()) {
         return(context.ClientType.ToList());
     }
 }