public ActionResult DeleteConfirmed(long id)
        {
            ApartmentOwner apartmentOwner = db.ApartmentOwners.Find(id);

            db.ApartmentOwners.Remove(apartmentOwner);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ApartmentOwnerID,ApartmentOwnerName,ApartmentOwnerNumber,OwnerStartDate,OwnerEndDate")] ApartmentOwner apartmentOwner)
 {
     if (ModelState.IsValid)
     {
         db.Entry(apartmentOwner).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(apartmentOwner));
 }
        public ActionResult Create([Bind(Include = "ApartmentOwnerID,ApartmentOwnerName,ApartmentOwnerNumber,OwnerStartDate,OwnerEndDate")] ApartmentOwner apartmentOwner)
        {
            if (ModelState.IsValid)
            {
                db.ApartmentOwners.Add(apartmentOwner);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(apartmentOwner));
        }
        // GET: ApartmentOwners/Delete/5
        public ActionResult Delete(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ApartmentOwner apartmentOwner = db.ApartmentOwners.Find(id);

            if (apartmentOwner == null)
            {
                return(HttpNotFound());
            }
            return(View(apartmentOwner));
        }