コード例 #1
0
        //
        // GET: /StockPickTypes/Edit/5

        public ActionResult Edit(int id = 0)
        {
            StockPickType stockpicktype = db.StockPickTypes.Find(id);

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

            return(View(stockpicktype));
        }