public ActionResult Edit([Bind(Include = "CabNo,CabType,Capacity")] CabData cabData)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cabData).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cabData));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ID,Topic,Comment")] SuggestionModel suggestionModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(suggestionModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(suggestionModel));
 }
 public ActionResult Edit([Bind(Include = "CustomerID,CustomerName,MobileNo,DOB,RangeOfTravel,Email")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "ClassID,Name,MyAge")] ClassOne classOne)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classOne).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(classOne));
 }
 public ActionResult Edit([Bind(Include = "DriverID,DriverName,MobileNo,CabRefId")] Driver driver)
 {
     if (ModelState.IsValid)
     {
         db.Entry(driver).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CabRefId = new SelectList(db.CabDatas, "CabNo", "CabNo", driver.CabRefId);
     return(View(driver));
 }
 public ActionResult Edit([Bind(Include = "CabRefId,CustomerRefId,DriverRefId")] Cab_Cust cab_Cust)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cab_Cust).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CabRefId      = new SelectList(db.CabDatas, "CabNo", "CabNo", cab_Cust.CabRefId);
     ViewBag.CustomerRefId = new SelectList(db.Customers, "CustomerID", "CustomerName", cab_Cust.CustomerRefId);
     ViewBag.DriverRefId   = new SelectList(db.Drivers, "DriverID", "DriverName", cab_Cust.DriverRefId);
     return(View(cab_Cust));
 }