Exemple #1
0
 public Rental(PostRental postRental)
 {
     Description = postRental.Description;
     NumberOfRooms = postRental.NumberOfRooms;
     Price = postRental.Price;
     Address = (postRental.Address ?? string.Empty).Split('\n').ToList();
 }
Exemple #2
0
 public Rental(PostRental postRental)
 {
     NumberOfRooms = postRental.NumberOfRooms;
     Description   = postRental.Description;
     Price         = postRental.Price;
     Address       = (postRental.Address ?? string.Empty).Split('\n').ToList();
 }
Exemple #3
0
        public ActionResult Post(PostRental postRental)
        {
            var rental = new Rental(postRental);

            _rentalRepository.Insert(rental);
            return(RedirectToAction("Index"));
        }
        public ActionResult Post(PostRental postRental)
        {
            var rental = new Rental(postRental);

            Context.Rentals.InsertOne(rental);
            return(RedirectToAction("Index"));
        }
Exemple #5
0
        public async Task <ActionResult> Post(PostRental postRental)
        {
            var rental = new Rental(postRental);
            //Context.Rentals.Insert(rental);
            //ContextNew.Rentals.InsertOne(rental);
            await ContextNew.Rentals.InsertOneAsync(rental);

            return(RedirectToAction("Index"));
        }
Exemple #6
0
 public async Task<ActionResult> Post(PostRental postRental)
 {
     var rental = new Rental(postRental);
     await Context.Rentals.InsertOneAsync(rental);
     return RedirectToAction("Index");
 }
Exemple #7
0
        public ActionResult Edit(string id, PostRental postRental)
        {
            try
            {

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Exemple #8
0
 // GET: Rentals/Edit/5        
 public async Task<ActionResult> Edit(string id)
 {
     var filter = new BsonDocument("_id", new ObjectId(id));
     var rental = await Context.Rentals.Find(filter).FirstOrDefaultAsync();
     var postRental = new PostRental
     {
         //TODO: Edit is not ready yet
     };
     return View(rental);
 }
 public ActionResult Post(PostRental postRental)
 {
     var rental = new Rental(postRental);
     Context.Rentals.Insert(rental);
     return RedirectToAction("Index");
 }