// GET: PropertyFloorTypes/Delete/5 public ActionResult Delete(int?id) { PropertyFloorType propertyFloorType = db.PropertyFloorTypes.Find(id); propertyFloorType.IsDeleted = true; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "FloorTypeTitle,IsActive")] PropertyFloorType propertyFloorType) { if (ModelState.IsValid) { propertyFloorType.IsDeleted = false; propertyFloorType.EntryDate = DateTime.Now; propertyFloorType.ByUserID = 1; db.PropertyFloorTypes.Add(propertyFloorType); db.SaveChanges(); return(RedirectToAction("Index")); } InitPage("Create"); return(View("PropertyFloorType", propertyFloorType)); }
// GET: PropertyFloorTypes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PropertyFloorType propertyFloorType = db.PropertyFloorTypes.Find(id); if (propertyFloorType == null) { return(HttpNotFound()); } InitPage("Edit"); return(View("PropertyFloorType", propertyFloorType)); }
public ActionResult Edit([Bind(Include = "PropertyFloorTypeID,FloorTypeTitle,IsActive")] PropertyFloorType propertyFloorType) { if (ModelState.IsValid) { var row = db.PropertyFloorTypes.Find(propertyFloorType.PropertyFloorTypeID); if (row != null) { row.FloorTypeTitle = propertyFloorType.FloorTypeTitle; row.IsActive = propertyFloorType.IsActive; db.SaveChanges(); return(RedirectToAction("Index")); } } InitPage("Edit"); return(View("PropertyFloorType", propertyFloorType)); }