public ActionResult Edit([Bind(Include = "typeId,typeName,maxUsers")] EquipmentTypes equipmentTypes)
 {
     if (ModelState.IsValid)
     {
         db.Entry(equipmentTypes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(equipmentTypes));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "functionId,functionName")] Functions functions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(functions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(functions));
 }
 public ActionResult Edit([Bind(Include = "rentId,renterId,rentTimeStart,rentTimeEnd,rentName,rentDescription")] HabourRenting habourRenting)
 {
     if (ModelState.IsValid)
     {
         db.Entry(habourRenting).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.renterId = new SelectList(db.Users, "userId", "userName", habourRenting.renterId);
     return(View(habourRenting));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "userId,userName,passwordHash,email,emailConfirmed,securityStamp,phoneNumber,phoneNumberConfirmed,twoFactorEnabled,LockoutEnadDateUtc,accessFailedCount,functionId,Name,Surname")] Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.functionId = new SelectList(db.Functions, "functionId", "functionName", users.functionId);
     return(View(users));
 }
 public ActionResult Edit([Bind(Include = "equipmentId,equipmentName,equipmentType")] SailingEquipment sailingEquipment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sailingEquipment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.equipmentType = new SelectList(db.EquipmentTypes, "typeId", "typeName", sailingEquipment.equipmentType);
     return(View(sailingEquipment));
 }
Ejemplo n.º 6
0
 public ActionResult Edit([Bind(Include = "postId,postText,userPosting,postDate,postImage,userPostingId")] Posts posts)
 {
     if (ModelState.IsValid)
     {
         db.Entry(posts).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.userPostingId = new SelectList(db.Users, "userId", "userName", posts.userPostingId);
     return(View(posts));
 }
 public ActionResult Edit([Bind(Include = "rentId,renterId,equipmentId,rentTimeStart,rentTimeEnd,rentName,rentDescription")] RentModel rentingEquipment)
 {
     if (ModelState.IsValid)
     {
         var edited = new RentingEquipment
         {
             rentId          = rentingEquipment.renterId,
             renterId        = rentingEquipment.renterId,
             equipmentId     = rentingEquipment.equipmentId,
             rentName        = rentingEquipment.rentName,
             rentTimeStart   = rentingEquipment.rentTimeStart,
             rentTimeEnd     = rentingEquipment.rentTimeEnd,
             rentDescription = rentingEquipment.rentDescription
         };
         db.Entry(edited).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.equipmentId = new SelectList(db.SailingEquipment, "equipmentId", "equipmentName", rentingEquipment.equipmentId);
     ViewBag.renterId    = new SelectList(db.Users, "userId", "userName", rentingEquipment.renterId);
     return(View(rentingEquipment));
 }
Ejemplo n.º 8
0
 public void Update(T item)
 {
     Context.Entry(item).State = EntityState.Modified;
 }