예제 #1
0
 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));
 }
예제 #2
0
        public void TestShouldReturnCorrectInputMatrixSize()
        {
            var console = new ConsoleWrapper();

            console.LinesToRead.Add("6");

            string expected = console.ReadLine();
            int    actual   = MatrixDemo.InputMatrixSize(6);

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        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));
        }
예제 #4
0
        // 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));
        }