Exemplo n.º 1
0
        //[ValidateAntiForgeryToken]
        public IActionResult Create(OuterMemoryInterfaceViewModel model)
        {
            var motherBoardInterface = new OuterMemoryInterface()
            {
                Name = model.Name
            };

            var result = _motherBoardInterfaceService.CreateOuterMemoryInterface(motherBoardInterface);

            if (result.Succedeed)
            {
                return(Json(motherBoardInterface));
            }

            return(Json(result));
        }
Exemplo n.º 2
0
        //[ValidateAntiForgeryToken]
        public ActionResult Edit(OuterMemoryInterfaceViewModel model)
        {
            var motherBoardInterface = _motherBoardInterfaceService.GetOuterMemoryInterface(model.Id);

            if (motherBoardInterface == null)
            {
                return(NotFound());
            }

            motherBoardInterface.Name = model.Name;
            var result = _motherBoardInterfaceService.UpdateOuterMemoryInterface(motherBoardInterface);

            if (result.Succedeed)
            {
                return(Json(motherBoardInterface));
            }

            return(Json(result));
        }