Esempio n. 1
0
        public ActionResult Create(Reader reader)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    db.Reader.Add(reader);
                    db.SaveChanges();
                }
                catch { }

                return RedirectToAction("Index");
            }

            return View(reader);
        }
Esempio n. 2
0
        public ActionResult Edit(Reader reader)
        {
            if (ModelState.IsValid)
            {
                //try
                //{
                    db.Entry(reader).State = EntityState.Modified;
                    db.SaveChanges();
                //}
                //catch { }

                return RedirectToAction("Index");
            }
            return View(reader);
        }