コード例 #1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            DSTree dSTree = db.DSTree.Find(id);

            db.DSTree.Remove(dSTree);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "DSTreeGUID,ModGUID,ID,PID,FactorName,FactorNameCn,Operator,OperatorCn,FactorValue,FactorValueCn,Describe,DescribeCn,Result,ResultCn,CoverCount,ErroCount")] DSTree dSTree)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dSTree).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dSTree));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "DSTreeGUID,ModGUID,ID,PID,FactorName,FactorNameCn,Operator,OperatorCn,FactorValue,FactorValueCn,Describe,DescribeCn,Result,ResultCn,CoverCount,ErroCount")] DSTree dSTree)
        {
            if (ModelState.IsValid)
            {
                dSTree.DSTreeGUID = Guid.NewGuid();
                db.DSTree.Add(dSTree);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(dSTree));
        }
コード例 #4
0
        // GET: DSTrees/Details/5
        public ActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DSTree dSTree = db.DSTree.Find(id);

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