public ActionResult Edit([Bind(Include = "Id,SalesPerson,Product,SalesPrice")] MatrixDemo matrixDemo) { if (ModelState.IsValid) { _context.Entry(matrixDemo).State = EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(matrixDemo)); }
public void TestShouldReturnCorrectInputMatrixSize() { var console = new ConsoleWrapper(); console.LinesToRead.Add("6"); string expected = console.ReadLine(); int actual = MatrixDemo.InputMatrixSize(6); Assert.AreEqual(expected, actual); }
public ActionResult Create([Bind(Include = "Id,SalesPerson,Product,SalesPrice")] MatrixDemo matrixDemo) { if (ModelState.IsValid) { _context.MatrixDemo.Add(matrixDemo); _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(matrixDemo)); }
// GET: MatrixDemoes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MatrixDemo matrixDemo = _context.MatrixDemo.Find(id); if (matrixDemo == null) { return(HttpNotFound()); } return(View(matrixDemo)); }