public ActionResult Edit([Bind(Include = "EmployeeId,FirstName,LastName,Email,PhoneNumber,JobTitle,DateOfBirth,Password")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(employee)); }
public ActionResult Edit([Bind(Include = "TenantId,FirstName,LastName,Address,Email,PhoneNumber,MaritalStatus,Password,DateOfBirth")] Tenant tenant) { if (ModelState.IsValid) { db.Entry(tenant).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tenant)); }
public ActionResult Edit([Bind(Include = "BuildingId,Address,PostalCode,City,Province,YearBuilt,EmployeeId")] Building building) { if (ModelState.IsValid) { db.Entry(building).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "FirstName", building.EmployeeId); return(View(building)); }
public ActionResult Edit([Bind(Include = "AppointmentId,AppointmentDate,AppointmentTime,EmployeeId,TenantId,Description")] Appointment appointment) { if (ModelState.IsValid) { db.Entry(appointment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "FirstName", appointment.EmployeeId); ViewBag.TenantId = new SelectList(db.Tenants, "TenantId", "FirstName", appointment.TenantId); return(View(appointment)); }
public ActionResult Edit([Bind(Include = "ApartmentId,BuildingId,ApartmentNumber,Rooms,Price,Status,Description,TenantId")] Apartment apartment) { if (ModelState.IsValid) { db.Entry(apartment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BuildingId = new SelectList(db.Buildings, "BuildingId", "Address", apartment.BuildingId); ViewBag.TenantId = new SelectList(db.Tenants, "TenantId", "FirstName", apartment.TenantId); return(View(apartment)); }
public ActionResult Edit([Bind(Include = "MessageId,MessageTitle,MessageDate,Description,TenantId,EmployeeId")] Message message) { if (ModelState.IsValid) { db.Entry(message).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "FirstName", message.EmployeeId); ViewBag.TenantId = new SelectList(db.Tenants, "TenantId", "FirstName", message.TenantId); return(View(message)); }