示例#1
0
        public ActionResult Create([Bind(Include = "Id,DisplayMember")] ChlorineLevel chlorineLevel)
        {
            if (ModelState.IsValid)
            {
                _repository.Insert(chlorineLevel);
                //db.ChlorineLevelSet.Add(chlorineLevel);
                //db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(chlorineLevel));
        }
示例#2
0
        public ActionResult Edit([Bind(Include = "Id,DisplayMember")] ChlorineLevel chlorineLevel)
        {
            if (ModelState.IsValid)
            {
                _repository.Update(chlorineLevel);
                //db.Entry(chlorineLevel).State = EntityState.Modified;
                //db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(chlorineLevel));
        }
示例#3
0
        // GET: ChlorineLevels/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            ChlorineLevel chlorineLevel = _repository.FindById(id.Value);

            //ChlorineLevel chlorineLevel = db.ChlorineLevelSet.Find(id);

            if (chlorineLevel == null)
            {
                return(HttpNotFound());
            }
            return(View(chlorineLevel));
        }