public ActionResult DeleteConfirmed(Guid id) { MealChart mealchart = db.MealCharts.Find(id); db.MealCharts.Remove(mealchart); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,MemberId,Date,Monning,Middday,Evennig,serialNo")] MealChart mealchart) { if (ModelState.IsValid) { db.Entry(mealchart).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MemberId = new SelectList(db.Members, "Id", "Name", mealchart.MemberId); return(View(mealchart)); }
public ActionResult Create([Bind(Include = "Id,MemberId,Date,Monning,Middday,Evennig,serialNo")] MealChart mealchart) { if (ModelState.IsValid) { mealchart.Id = Guid.NewGuid(); db.MealCharts.Add(mealchart); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MemberId = new SelectList(db.Members, "Id", "Name", mealchart.MemberId); return(View(mealchart)); }
// GET: /MealChart/Details/5 public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MealChart mealchart = db.MealCharts.Find(id); if (mealchart == null) { return(HttpNotFound()); } return(View(mealchart)); }
// GET: /MealChart/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MealChart mealchart = db.MealCharts.Find(id); if (mealchart == null) { return(HttpNotFound()); } ViewBag.MemberId = new SelectList(db.Members, "Id", "Name", mealchart.MemberId); return(View(mealchart)); }