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

            db.StockIssueTypes.Remove(stockIssueType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "StockIssueTypeId,Name,Type")] StockIssueType stockIssueType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stockIssueType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(stockIssueType));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "StockIssueTypeId,Name,Type")] StockIssueType stockIssueType)
        {
            if (ModelState.IsValid)
            {
                db.StockIssueTypes.Add(stockIssueType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(stockIssueType));
        }
コード例 #4
0
        // GET: StockIssueTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StockIssueType stockIssueType = db.StockIssueTypes.Find(id);

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