示例#1
0
 public ActionResult AddMilling(MillingCutter milling)
 {
     if (ModelState.IsValid)
     {
         db.MillingCutters.Add(milling);
         db.SaveChanges();
         return(RedirectToAction("MillingForm"));
     }
     else
     {
         return(View());
     }
 }
示例#2
0
 public ActionResult EditMilling(MillingCutter milling)
 {
     if (ModelState.IsValid)
     {
         db.Entry(milling).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("MillingForm"));
     }
     else
     {
         return(View());
     }
 }
示例#3
0
        public ActionResult DeleteMilling(int?id)
        {
            welcomInscription();
            if (id == null)
            {
                return(HttpNotFound());
            }

            MillingCutter b = db.MillingCutters.Find(id);

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

            return(View(b));
        }
示例#4
0
        public ActionResult EditMilling(int?id)
        {
            welcomInscription();
            if (id == null)
            {
                return(HttpNotFound());
            }

            MillingCutter milling = db.MillingCutters.Find(id);

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

            ViewBag.Id = milling.Id;
            return(View(milling));
        }
示例#5
0
        public ActionResult DeleteConfirmed(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }

            MillingCutter b = db.MillingCutters.Find(id);

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

            db.MillingCutters.Remove(b);
            db.SaveChanges();
            return(RedirectToAction("MillingForm"));
        }