public ActionResult DeleteConfirmed(int id) { datetimerecords datetimerecords = db.datetimedetails.Find(id); db.datetimedetails.Remove(datetimerecords); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,Date1,Date2,function,result")] datetimerecords datetimerecords) { if (ModelState.IsValid) { db.Entry(datetimerecords).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(datetimerecords)); }
// GET: datetimerecords/Create /* * public ActionResult Create() * { * return View(); * } * * // POST: datetimerecords/Create * // To protect from overposting attacks, enable the specific properties you want to bind to, for * // more details see https://go.microsoft.com/fwlink/?LinkId=317598. * /*[HttpPost] * [ValidateAntiForgeryToken] * public ActionResult Create([Bind(Include = "id,Date1,Date2,function,result")] datetimerecords datetimerecords) * { * if (ModelState.IsValid) * { * db.datetimedetails.Add(datetimerecords); * db.SaveChanges(); * return RedirectToAction("Index"); * } * * return View(datetimerecords); * } */ // GET: datetimerecords/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } datetimerecords datetimerecords = db.datetimedetails.Find(id); if (datetimerecords == null) { return(HttpNotFound()); } return(View(datetimerecords)); }