public ActionResult Create([Bind(Include = "ID,ErrorDefine,ErrorDescription,Date,Person")] DTwoTable dTwoTable, string errorNo) { var userModel = common.getCurrentUserModel(); dTwoTable.Company = userModel.Company; dTwoTable.ErrorNo = errorNo; if (ModelState.IsValid) { db.DTwoTable.Add(dTwoTable); try { db.SaveChanges(); } catch (DbEntityValidationException ex) { return(View(dTwoTable)); } return(RedirectToAction("DSteps", "EightStep", new { errorNo = errorNo })); } return(View(dTwoTable)); }
public ActionResult DeleteConfirmed(int id) { DTwoTable dTwoTable = db.DTwoTable.Find(id); db.DTwoTable.Remove(dTwoTable); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: DTwoTables/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DTwoTable dTwoTable = db.DTwoTable.Find(id); if (dTwoTable == null) { return(HttpNotFound()); } return(View(dTwoTable)); }
public ActionResult Edit([Bind(Include = "ID,ErrorDefine,ErrorDescription,Date,Person,ErrorNo")] DTwoTable dTwoTable) { var userModel = common.getCurrentUserModel(); dTwoTable.Company = userModel.Company; if (ModelState.IsValid) { db.Entry(dTwoTable).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbEntityValidationException ex) { return(View(dTwoTable)); } return(RedirectToAction("DSteps", "EightStep", new { errorNo = dTwoTable.ErrorNo })); } return(View(dTwoTable)); }