コード例 #1
0
        public ActionResult Update(Articolo model)
        {
            if (ModelState.IsValid)
            {
                _oArticoloRepo.Update(model);
                this.DatabaseFactory.GetContext().SaveChanges();

            }
            return RedirectToAction("Index");
        }
コード例 #2
0
        public ActionResult Delete(Articolo model)
        {
            if (model != null && ModelState.IsValid)
            {
                // Aggiorno l'operazione
                Articolo oArticolo = _oArticoloRepo.GetEdit().SingleOrDefault(x => x.ID == model.ID);
                if (oArticolo != null)
                    _oArticoloRepo.Delete(oArticolo);
            }

            this.DatabaseFactory.GetContext().SaveChanges();
            return RedirectToAction("Index");
        }
コード例 #3
0
        public ActionResult Create()
        {
            Articolo oArticolo = new Articolo();

            return View(oArticolo);
        }