public ActionResult Edit([Bind(Include = "CustomerID,CustomerFirstName,CustomerLastName,Email,PhoneNumber,Password,Age")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "BrokerID,Name")] Broker broker)
 {
     if (ModelState.IsValid)
     {
         db.Entry(broker).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(broker));
 }
 public ActionResult Edit([Bind(Include = "DealID,PropertyID,CustomerID,BrokerID,Price,Commition,Categorty")] Deal deal)
 {
     if (ModelState.IsValid)
     {
         db.Entry(deal).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(deal));
 }
 public ActionResult Edit([Bind(Include = "PropertyID,Adresse,NumOfRooms,Price,Type,Elevator,Balcony,Parking,Category,SQfeet,About")] Property property)
 {
     if (ModelState.IsValid)
     {
         db.Entry(property).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(property));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "PropertyID,PropertyName,PropertyType,Stock,NumofRooms,city,Feautres,price")] Property property)
 {
     if (ModelState.IsValid)
     {
         db.Entry(property).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Home"));
     }
     return(View(property));
 }
示例#6
0
 public ActionResult Edit([Bind(Include = "DealID,CustomerID,PropertyID,Active")] Deal deal)
 {
     if (ModelState.IsValid)
     {
         db.Entry(deal).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "CustomerFirstName", deal.CustomerID);
     ViewBag.PropertyID = new SelectList(db.Properties, "PropertyID", "PropertyName", deal.PropertyID);
     return(View(deal));
 }