Exemplo n.º 1
0
        public ActionResult Delete(int id, Patient patient)
        {
            try
            {
                db.Entry(patient).State = EntityState.Deleted;
                db.SaveChanges();

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Exemplo n.º 2
0
        public ActionResult Create(Patient patient)
        {
            try
            {
                db.Patients.Add(patient);
                db.SaveChanges();

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Exemplo n.º 3
0
        public ActionResult Edit(int id, Patient patient)
        {
            try
            {
                db.Entry(patient).State = EntityState.Modified;
                db.SaveChanges();

                return RedirectToAction("Index");
            }
            catch
            {
                throw;
                return View();
            }
        }