Пример #1
0
 public ActionResult Edit([Bind(Include = "LeaseID,PropertyID,StartDate,DurationMonths,RateMonthly")] Lease lease)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lease).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PropertyID = new SelectList(db.Properties, "ID", "Street", lease.PropertyID);
     return(View(lease));
 }
 public ActionResult Edit([Bind(Include = "ID,Name,Street,City,State,Zip,Phone,Email")] Landlord landlord)
 {
     if (ModelState.IsValid)
     {
         landlord.Phone           = SetPhoneNumberWithDashes(landlord.Phone);
         db.Entry(landlord).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(landlord));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "ID,PropertyID,Name,Phone,Email,RegistrationDate")] Tenant tenant)
 {
     if (ModelState.IsValid)
     {
         tenant.Phone           = SetPhoneNumberWithDashes(tenant.Phone);
         db.Entry(tenant).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PropertyID = new SelectList(db.Properties, "ID", "Street", tenant.PropertyID);
     return(View(tenant));
 }