public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,Phone,BestDate")] BookTestDrive bookTestDrive)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bookTestDrive).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bookTestDrive));
 }
 public ActionResult Edit([Bind(Include = "Id,Make,Model,Year,Price,Kms,EnginLitres,Transmission,Fuel_Type,IsUsed,Color,CustomerID,Image")] SellRequest sellRequest)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sellRequest).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerID = new SelectList(db.Customers, "Id", "Name", sellRequest.CustomerID);
     return(View(sellRequest));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "Id,AccountNumber,Amount,PurchaseDate,PaymentType,Customer_Name,Car_Model")] Payment payment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(payment).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     ViewBag.Car_Model     = new SelectList(db.Cars, "Id", "Make", payment.Car_Model);
     ViewBag.Customer_Name = new SelectList(db.Customers, "Id", "Name", payment.Customer_Name);
     return(View(payment));
 }
 public ActionResult Edit([Bind(Include = "Id,Name,Email,Message,Reply")] ChatBox chatBox)
 {
     if (ModelState.IsValid)
     {
         chatBox.Name            = Session["chatname"].ToString();
         chatBox.Email           = Session["chatmail"].ToString();
         chatBox.Message         = Session["chatmessage"].ToString();
         db.Entry(chatBox).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Admin", "Customers"));
     }
     return(View(chatBox));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "Id,Name,Address,City,Email,Password")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         if (Session["LoginCustomerName"].Equals("Admin"))
         {
             return(RedirectToAction("Index", "Customers", null));
         }
         else
         {
             return(RedirectToAction("Details", "Customers", new { id = Session["LoggedCustomerID"] }));
         }
     }
     return(View(customer));
 }
示例#6
0
 public ActionResult Edit([Bind(Include = "Id,Make,Model,Year,Price,Kms,EnginLitres,Transmission,Fuel_Type,IsUsed,Color,CustomerID,Image")] Car car)
 {
     if (ModelState.IsValid)
     {
         db.Entry(car).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         if (Session["LoginCustomerName"].Equals("Admin"))
         {
             return(RedirectToAction("List"));
         }
         else
         {
             return(RedirectToAction("ApprovedSellList", new { id = car.CustomerID }));
         }
     }
     ViewBag.CustomerID = new SelectList(db.Customers, "Id", "Name", car.CustomerID);
     return(View(car));
 }