Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BarSupplies barSupplies = db.BarSupplies.Find(id);

            db.BarSupplies.Remove(barSupplies);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "idCost,id_Postavchuka,id_Napo,Date,Number,Unit,Pric,Sum")] BarSupplies barSupplies)
 {
     if (ModelState.IsValid)
     {
         db.Entry(barSupplies).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_Napo        = new SelectList(db.DrinksВar, "id_Napo", "Nazva_Napo", barSupplies.id_Napo);
     ViewBag.id_Postavchuka = new SelectList(db.Supplier, "id_Supplier", "Nazva_Postavchuca", barSupplies.id_Postavchuka);
     return(View(barSupplies));
 }
Exemplo n.º 3
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BarSupplies barSupplies = db.BarSupplies.Find(id);

            if (barSupplies == null)
            {
                return(HttpNotFound());
            }
            return(View(barSupplies));
        }
Exemplo n.º 4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BarSupplies barSupplies = db.BarSupplies.Find(id);

            if (barSupplies == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_Napo        = new SelectList(db.DrinksВar, "id_Napo", "Nazva_Napo", barSupplies.id_Napo);
            ViewBag.id_Postavchuka = new SelectList(db.Supplier, "id_Supplier", "Nazva_Postavchuca", barSupplies.id_Postavchuka);
            return(View(barSupplies));
        }