Esempio n. 1
0
        /*
         *   // GET: Suppliers
         * public ActionResult Index()
         * {
         *  return View(db.Suppliers.ToList());
         * }
         *
         * // GET: Suppliers/Details/5
         * public ActionResult Details(int? id)
         * {
         *  if (id == null)
         *  {
         *      return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
         *  }
         *  Supplier supplier = db.Suppliers.Find(id);
         *  if (supplier == null)
         *  {
         *      return HttpNotFound();
         *  }
         *  return View(supplier);
         * }
         *
         * // GET: Suppliers/Create
         * public ActionResult Create()
         * {
         *  return View();
         * }
         *
         * // POST: Suppliers/Create
         * // To protect from overposting attacks, please enable the specific properties you want to bind to, for
         * // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
         * [HttpPost]
         * [ValidateAntiForgeryToken]
         * public ActionResult Create([Bind(Include = "Id,Name,Code,ContactNo,Email,Image,Address,SupplierType")] Supplier supplier)
         * {
         *  if (ModelState.IsValid)
         *  {
         *      db.Suppliers.Add(supplier);
         *      db.SaveChanges();
         *      return RedirectToAction("Index");
         *  }
         *
         *  return View(supplier);
         * }
         *
         * // GET: Suppliers/Edit/5
         * public ActionResult Edit(int? id)
         * {
         *  if (id == null)
         *  {
         *      return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
         *  }
         *  Supplier supplier = db.Suppliers.Find(id);
         *  if (supplier == null)
         *  {
         *      return HttpNotFound();
         *  }
         *  return View(supplier);
         * }
         *
         * // POST: Suppliers/Edit/5
         * // To protect from overposting attacks, please enable the specific properties you want to bind to, for
         * // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
         * [HttpPost]
         * [ValidateAntiForgeryToken]
         * public ActionResult Edit([Bind(Include = "Id,Name,Code,ContactNo,Email,Image,Address,SupplierType")] Supplier supplier)
         * {
         *  if (ModelState.IsValid)
         *  {
         *      db.Entry(supplier).State = EntityState.Modified;
         *      db.SaveChanges();
         *      return RedirectToAction("Index");
         *  }
         *  return View(supplier);
         * }
         *
         * // GET: Suppliers/Delete/5
         * public ActionResult Delete(int? id)
         * {
         *  if (id == null)
         *  {
         *      return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
         *  }
         *  Supplier supplier = db.Suppliers.Find(id);
         *  if (supplier == null)
         *  {
         *      return HttpNotFound();
         *  }
         *  return View(supplier);
         * }
         *
         * // POST: Suppliers/Delete/5
         * [HttpPost, ActionName("Delete")]
         * [ValidateAntiForgeryToken]
         * public ActionResult DeleteConfirmed(int id)
         * {
         *  Supplier supplier = db.Suppliers.Find(id);
         *  db.Suppliers.Remove(supplier);
         *  db.SaveChanges();
         *  return RedirectToAction("Index");
         * }
         */


        #endregion

        // GET: Items
        public ActionResult List()
        {
            List <Supplier> suppliers = _supplierBll.List();

            return(View(suppliers));
        }