Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbMethod tbMethod = db.tbMethod.Find(id);

            db.tbMethod.Remove(tbMethod);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "MethodId,UserId,Name,Type,IsClosed")] tbMethod tbMethod)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbMethod).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.tbUsers, "UserId", "FirstName", tbMethod.UserId);
     return(View(tbMethod));
 }
Esempio n. 3
0
        // GET: Methods/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbMethod tbMethod = db.tbMethod.Find(id);

            if (tbMethod == null)
            {
                return(HttpNotFound());
            }
            return(View(tbMethod));
        }
Esempio n. 4
0
        // GET: Methods/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbMethod tbMethod = db.tbMethod.Find(id);

            if (tbMethod == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserId = new SelectList(db.tbUsers, "UserId", "FirstName", tbMethod.UserId);
            return(View(tbMethod));
        }