示例#1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            MealChart mealchart = db.MealCharts.Find(id);

            db.MealCharts.Remove(mealchart);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 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));
 }
示例#3
0
        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));
        }
示例#4
0
        // 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));
        }
示例#5
0
        // 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));
        }