public ActionResult DeleteConfirmed(int id) { DefLandlord defLandlord = db.DefLandlords.Find(id); db.DefLandlords.Remove(defLandlord); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,LandlordName,WebSite,Email,Address,Industry,FK_CreatorID,CreationDate,LastModifiedDate")] DefLandlord defLandlord) { if (ModelState.IsValid) { db.Entry(defLandlord).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(defLandlord)); }
// GET: DefLandlords/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DefLandlord defLandlord = db.DefLandlords.Find(id); if (defLandlord == null) { return(HttpNotFound()); } return(View(defLandlord)); }
public ActionResult Create([Bind(Include = "ID,LandlordName,WebSite,Email,Address,Industry,FK_CreatorID,CreationDate,LastModifiedDate")] DefLandlord defLandlord) { if (ModelState.IsValid) { defLandlord.FK_CreatorID = User.Identity.GetUserId(); DateTime nowTimestamp = DateTime.Now; defLandlord.CreationDate = nowTimestamp; defLandlord.LastModifiedDate = nowTimestamp; db.DefLandlords.Add(defLandlord); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(defLandlord)); }