Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Tezgah tezgah = db.Tezgahs.Find(id);

            db.Tezgahs.Remove(tezgah);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        //
        // GET: /Tezgah/Delete/5

        public ActionResult Delete(int id = 0)
        {
            Tezgah tezgah = db.Tezgahs.Find(id);

            if (tezgah == null)
            {
                return(HttpNotFound());
            }
            return(View(tezgah));
        }
Exemplo n.º 3
0
 public ActionResult Edit(Tezgah tezgah)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tezgah).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tezgah));
 }
Exemplo n.º 4
0
        public ActionResult Create(Tezgah tezgah)
        {
            if (ModelState.IsValid)
            {
                db.Tezgahs.Add(tezgah);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tezgah));
        }