Пример #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            Suggeste suggeste = db.Suggestes.Find(id);

            db.Suggestes.Remove(suggeste);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Suggeset,FK_UserID")] Suggeste suggeste)
 {
     if (ModelState.IsValid)
     {
         db.Entry(suggeste).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FK_UserID = new SelectList(db.Users, "Id", "Username", suggeste.FK_UserID);
     return(View(suggeste));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,Suggeset,FK_UserID")] Suggeste suggeste)
        {
            if (ModelState.IsValid)
            {
                db.Suggestes.Add(suggeste);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.FK_UserID = new SelectList(db.Users, "Id", "Username", suggeste.FK_UserID);
            return(View(suggeste));
        }
Пример #4
0
        // GET: Suggestes/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Suggeste suggeste = db.Suggestes.Find(id);

            if (suggeste == null)
            {
                return(HttpNotFound());
            }
            return(View(suggeste));
        }
Пример #5
0
        // GET: Suggestes/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Suggeste suggeste = db.Suggestes.Find(id);

            if (suggeste == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FK_UserID = new SelectList(db.Users, "Id", "Username", suggeste.FK_UserID);
            return(View(suggeste));
        }