public ActionResult Edit([Bind(Include = "Id,CompanyId,Street,Town,Postcode,Lat,Lon,ImageFilename")] CompanyLocation companyLocation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(companyLocation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CompanyId = new SelectList(db.Companies, "Id", "Name", companyLocation.CompanyId);
     return(View(companyLocation));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Count,BikeId,CompanyLocationId")] CompanyBike companyBike)
 {
     if (ModelState.IsValid)
     {
         db.Entry(companyBike).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BikeId            = new SelectList(db.Bikes, "Id", "Model", companyBike.BikeId);
     ViewBag.CompanyLocationId = new SelectList(db.CompanyLocations, "Id", "Street", companyBike.CompanyLocationId);
     return(View(companyBike));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "Id,StartDate,EndDate,UserId,CompanyBikeId,Feedback")] Booking booking)
 {
     if (ModelState.IsValid)
     {
         if (booking.Feedback < 1 || booking.Feedback > 5)
         {
             return(View(booking));
         }
         db.Entry(booking).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(booking));
 }
Exemplo n.º 4
0
 public Membership Update(Membership membership)
 {
     bikeDbContext.Entry(membership).State = EntityState.Modified;
     return(membership);
 }
Exemplo n.º 5
0
 public Customer Update(Customer customer)
 {
     bikeDbContext.Entry(customer).State = EntityState.Modified;
     return(customer);
 }
Exemplo n.º 6
0
 public Purchase Update(Purchase purchase)
 {
     bikeDbContext.Entry(purchase).State = EntityState.Modified;
     return(purchase);
 }