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

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

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

                    // loanRequest.LoanDate = loanRequest.LoanDate;
                    db.SaveChanges();
                }



                return(Json("Edited Hazard NM 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();
            hazard_nm_fin_rep hazard_nm_fin_rep = db.hazard_nm_fin_rep.Find(id);

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



            var hazard_nm_fin_repRow = db.hazard_nm_fin_rep.Find(id);

            db.hazard_nm_fin_rep.Remove(hazard_nm_fin_repRow);

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