Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Zasob zasob = db.Zasobs.Find(id);

            db.Zasobs.Remove(zasob);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id,id_firma,nazwa")] Zasob zasob)
 {
     if (ModelState.IsValid)
     {
         db.Entry(zasob).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_firma = new SelectList(db.Firmas, "id", "nazwa", zasob.id_firma);
     return(View(zasob));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "id,id_firma,nazwa")] Zasob zasob)
        {
            if (ModelState.IsValid)
            {
                db.Zasobs.Add(zasob);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.id_firma = new SelectList(db.Firmas, "id", "nazwa", zasob.id_firma);
            return(View(zasob));
        }
Exemplo n.º 4
0
        // GET: Zasob/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Zasob zasob = db.Zasobs.Find(id);

            if (zasob == null)
            {
                return(HttpNotFound());
            }
            return(View(zasob));
        }
Exemplo n.º 5
0
        // GET: Zasob/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Zasob zasob = db.Zasobs.Find(id);

            if (zasob == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_firma = new SelectList(db.Firmas, "id", "nazwa", zasob.id_firma);
            return(View(zasob));
        }