Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Customer_id,Customer_name,password,Address")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Branch_code,Branch_pin,Branch_address,Branch_name")] Branch branch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(branch).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(branch));
 }
 public ActionResult Edit([Bind(Include = "Courier_id,Weight,Courier_type")] Courier courier)
 {
     if (ModelState.IsValid)
     {
         db.Entry(courier).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Courier_id = new SelectList(db.Bookings, "Booking_id", "From_add", courier.Courier_id);
     return(View(courier));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "Booking_id,From_add,Amount,Destination,Branch_code,Customer_id")] Booking booking)
 {
     if (ModelState.IsValid)
     {
         db.Entry(booking).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Branch_code = new SelectList(db.Branches, "Branch_code", "Branch_address", booking.Branch_code);
     ViewBag.Booking_id  = new SelectList(db.Couriers, "Courier_id", "Courier_type", booking.Booking_id);
     ViewBag.Customer_id = new SelectList(db.Customers, "Customer_id", "Customer_name", booking.Customer_id);
     return(View(booking));
 }