コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SteelMarkModel steelmarkmodel = db.SteelMarkModel.Find(id);

            db.SteelMarkModel.Remove(steelmarkmodel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Delete(int id = 0)
        {
            SteelMarkModel steelmarkmodel = db.SteelMarkModel.Find(id);

            if (steelmarkmodel == null)
            {
                return(HttpNotFound());
            }
            return(View(steelmarkmodel));
        }
コード例 #3
0
 public ActionResult Edit(SteelMarkModel steelmarkmodel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(steelmarkmodel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(steelmarkmodel));
 }
コード例 #4
0
        public ActionResult Create(SteelMarkModel steelmarkmodel)
        {
            if (ModelState.IsValid)
            {
                db.SteelMarkModel.Add(steelmarkmodel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(steelmarkmodel));
        }
コード例 #5
0
        public ActionResult Edit(int id = 0)
        {
            if (Session["acc"] == null)
            {
                Response.Redirect("/Account/Login");
                return(null);
            }
            SteelMarkModel steelmarkmodel = db.SteelMarkModel.Find(id);

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