Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HeatList heatList = db.HeatLists.Find(id);

            db.HeatLists.Remove(heatList);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "HeatListID,Status,Time,Name")] HeatList heatList)
 {
     if (ModelState.IsValid)
     {
         db.Entry(heatList).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(heatList));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "HeatListID,Status,Time,Name")] HeatList heatList)
        {
            if (ModelState.IsValid)
            {
                db.HeatLists.Add(heatList);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(heatList));
        }
Ejemplo n.º 4
0
        // GET: HeatLists/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HeatList heatList = db.HeatLists.Find(id);

            if (heatList == null)
            {
                return(HttpNotFound());
            }
            return(View(heatList));
        }
Ejemplo n.º 5
0
        // GET: HeatLists/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HeatList heatList = db.HeatLists.Find(id);

            if (heatList == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new HeatCoupleViewModel
            {
                heatlist = heatList,
                couples  = (from couple in db.Couples
                            where couple.HeatList.Name.Contains(heatList.Name)
                            select couple).ToList()
            };

            return(View(viewModel));
        }