Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            poruka poruka = db.porukas.Find(id);

            db.porukas.Remove(poruka);
            db.SaveChanges();
            return(RedirectToAction("Index", ""));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "idporuka,temaPoruke,tijeloPoruke,datumPoruke,posiljateljPoruke")] poruka poruka)
 {
     if (ModelState.IsValid)
     {
         db.Entry(poruka).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", ""));
     }
     return(View(poruka));
 }
Example #3
0
 public ActionResult Create([Bind(Include = "idporuka,temaPoruke,tijeloPoruke,datumPoruke,posiljateljPoruke")] poruka poruka)
 {
     if (ModelState.IsValid)
     {
         int noviId = (from st in db.porukas select st).Max(x => x.idporuka) + 1;
         poruka.idporuka = noviId;
         db.porukas.Add(poruka);
         db.SaveChanges();
         return(RedirectToAction("poslano", "porukas"));
     }
     return(View(poruka));
 }
Example #4
0
        // GET: porukas/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            poruka poruka = db.porukas.Find(id);

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