Exemplo n.º 1
0
 public ActionResult DeleteConfirmed(int id)
 {
     Trace.WriteLine("POST /Type/Delete/" + id);
     Projekt.Models.Type type = db.Types.Find(id);
     db.Types.Remove(type);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Exemplo n.º 2
0
        public ActionResult Edit([Bind(Include = "TypeId, TypeName")] Projekt.Models.Type type)
        {
            Trace.WriteLine("POST /Type/Edit/" + type.TypeId);
            if (ModelState.IsValid)
            {
                db.Entry(type).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            return(View(type));
        }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "TypeId, TypeName")] Projekt.Models.Type type)
        {
            Trace.WriteLine("POST /Type/Create");
            if (ModelState.IsValid)
            {
                db.Types.Add(type);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(type));
        }
Exemplo n.º 4
0
        // GET: Todos/Delete/5
        public ActionResult Delete(int?id)
        {
            Trace.WriteLine("GET /Type/Delete/" + id);
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Projekt.Models.Type type = db.Types.Find(id);
            if (type == null)
            {
                return(HttpNotFound());
            }
            return(View(type));
        }