Exemplo n.º 1
0
        public ActionResult Create(cor_rem_action com_rem_action)
        {
            if (ModelState.IsValid)
            {
                var db = new qhsedbEntities();
                db.cor_rem_action.Add(com_rem_action);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(com_rem_action));
        }
Exemplo n.º 2
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var            db           = new qhsedbEntities();
            cor_rem_action CorRemAction = db.cor_rem_action.Find(id);

            if (CorRemAction == null)
            {
                return(HttpNotFound());
            }
            return(View(CorRemAction));
        }
Exemplo n.º 3
0
        public JsonResult Edit(cor_rem_action CorRemAction)
        {
            try
            {
                var db = new qhsedbEntities();
                if (ModelState.IsValid)
                {
                    CorRemAction.id = CorRemAction.id;
                    db.Entry(CorRemAction).State = EntityState.Modified;


                    db.SaveChanges();
                }



                return(Json("Edited Corrective Remedial Action System", JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(e.Message, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 4
0
        public ActionResult Delete(int?id)

        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var            db           = new qhsedbEntities();
            cor_rem_action CorRemAction = db.cor_rem_action.Find(id);

            if (CorRemAction == null)
            {
                return(HttpNotFound());
            }



            var CorRemActionRow = db.cor_rem_action.Find(id);

            db.cor_rem_action.Remove(CorRemActionRow);

            db.SaveChanges();
            return(RedirectToAction("Index"));
        }