Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Pyetja pyetja = db.Pyetjas.Find(id);

            db.Pyetjas.Remove(pyetja);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "PyetjaID,Pyejta,Opcioni1,Opcioni2,Opcioni3,Opcioni4,PergjigjjaESakte")] Pyetja pyetja)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pyetja).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pyetja));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "PyetjaID,Pyejta,Opcioni1,Opcioni2,Opcioni3,Opcioni4,PergjigjjaESakte")] Pyetja pyetja)
        {
            if (ModelState.IsValid)
            {
                db.Pyetjas.Add(pyetja);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pyetja));
        }
Exemple #4
0
        // GET: Pyetjas/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Pyetja pyetja = db.Pyetjas.Find(id);

            if (pyetja == null)
            {
                return(HttpNotFound());
            }
            return(View(pyetja));
        }