Exemplo n.º 1
0
        public JsonResult InsertBaseBoards([FromBody] List <BaseBoard> baseBoards)
        {
            if (baseBoards == null)
            {
                baseBoards = new List <BaseBoard>();
            }

            //Loop and insert records.
            foreach (BaseBoard baseBoard in baseBoards)
            {
                _context.BaseBoards.Add(baseBoard);
            }

            int insertedRecords = _context.SaveChanges();

            return(Json(insertedRecords));
        }
Exemplo n.º 2
0
        public IActionResult UpdateBS(int id, string devicename, int revision)
        {
            var buildSheet = _context.BuildSheets.Where(bs => bs.ProductName.ToLower() == devicename.ToLower()).FirstOrDefault();

            if (buildSheet != null)
            {
                buildSheet.TesterParameterId = id;
                _context.Update(buildSheet);
                _context.SaveChanges();
                TempData["AddBuildSheetConfirmation"] = "Build Sheet has been updated";
            }
            else
            {
                TempData["AddBuildSheetConfirmation"] = "No buildsheet found to update";
            }

            return(RedirectToAction("Details", new { name = devicename, revision = revision }));
            //return RedirectToAction("Details", new { name = devicename, revision });
        }