示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            FactorRh factorRh =
                db.FactorRhs.Find(id);

            db.FactorRhs.Remove(factorRh);

            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult Create(FactorRh factorRh)
        {
            if (ModelState.IsValid)
            {
                db.FactorRhs.Add(factorRh);

                var response =
                    DBHelper.SaveChanges(db);

                if (response.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.
                AddModelError(
                    string.Empty,
                    response.Message);
            }

            return(View(factorRh));
        }
示例#3
0
        public ActionResult Edit(FactorRh factorRh)
        {
            if (ModelState.IsValid)
            {
                db.Entry(factorRh).State =
                    EntityState.Modified;

                var response =
                    DBHelper.SaveChanges(db);

                if (response.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.
                AddModelError(
                    string.Empty,
                    response.Message);
            }

            return(View(factorRh));
        }