Ejemplo n.º 1
0
 public Rental(PostRental postRental)
 {
     Description = postRental.Description;
     NumberOfRooms = postRental.NumberOfRooms;
     Price = postRental.Price;
     Address = (postRental.Address ?? string.Empty).Split('\n').ToList();
 }
Ejemplo n.º 2
0
 public Rental(PostRental postRental)
 {
     NumberOfRooms = postRental.NumberOfRooms;
     Description   = postRental.Description;
     Price         = postRental.Price;
     Address       = (postRental.Address ?? string.Empty).Split('\n').ToList();
 }
Ejemplo n.º 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"));
        }
Ejemplo n.º 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"));
        }
Ejemplo n.º 6
0
 public async Task<ActionResult> Post(PostRental postRental)
 {
     var rental = new Rental(postRental);
     await Context.Rentals.InsertOneAsync(rental);
     return RedirectToAction("Index");
 }
Ejemplo n.º 7
0
        public ActionResult Edit(string id, PostRental postRental)
        {
            try
            {

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 9
0
 public ActionResult Post(PostRental postRental)
 {
     var rental = new Rental(postRental);
     Context.Rentals.Insert(rental);
     return RedirectToAction("Index");
 }