public ActionResult DeleteConfirmed(long id) { SocialPlan socialplan = db.SocialPlannen.Find(id); db.SocialPlannen.Remove(socialplan); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SocialPlanID,Title")] SocialPlan socialplan) { if (ModelState.IsValid) { db.Entry(socialplan).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(socialplan)); }
public ActionResult Create([Bind(Include = "SocialPlanID,Title")] SocialPlan socialplan) { if (ModelState.IsValid) { socialplan.UserName = this.User.Identity.Name; db.SocialPlannen.Add(socialplan); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(socialplan)); }
// GET: /TestSocialPlan/Delete/5 public ActionResult Delete(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SocialPlan socialplan = db.SocialPlannen.Find(id); if (socialplan == null) { return(HttpNotFound()); } return(View(socialplan)); }
public ActionResult Save(SocialPlan socialPlan) { //Indien nieuw plan if (socialPlan.SocialPlanID == 0) { //Username zetten socialPlan.UserName = this.User.Identity.Name; //opslaan } //Bestaand plan else { //wijzigen } //db.SaveChangesAsync(); return(null); }