Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Popust1 popust1 = db.Popust1.Find(id);

            db.Popust1.Remove(popust1);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Popust")] Popust1 popust1)
 {
     if (ModelState.IsValid)
     {
         db.Entry(popust1).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(popust1));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,Popust")] Popust1 popust1)
        {
            if (ModelState.IsValid)
            {
                db.Popust1.Add(popust1);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(popust1));
        }
Пример #4
0
        // GET: Popust1/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Popust1 popust1 = db.Popust1.Find(id);

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