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

            db.DthModels.Remove(dthModels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "DthId,DthEmployee,DthTimeEntered,DthTimeCleared")] DthModels dthModels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dthModels).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DthEmployee = new SelectList(db.EmployeeModels, "Id", "FirstName", dthModels.DthEmployee);
     return(View(dthModels));
 }
コード例 #3
0
        // GET: DthModels/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DthModels dthModels = db.DthModels.Find(id);

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

            if (dthModels == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DthEmployee = new SelectList(db.EmployeeModels, "Id", "FirstName", dthModels.DthEmployee);
            return(View(dthModels));
        }