Beispiel #1
0
        public IActionResult Create(AddPlantRoomViewModel addPlantRoomViewModel)
        {
            if (ModelState.IsValid)
            {
                PlantRooms newPlantRoom = new PlantRooms
                {
                    Name = addPlantRoomViewModel.Name
                };

                context.PlantRooms.Add(newPlantRoom);
                context.SaveChanges();

                return(Redirect("/PlantRoom"));
            }

            return(View(addPlantRoomViewModel));
        }
Beispiel #2
0
        public IActionResult Create()
        {
            AddPlantRoomViewModel addPlantRoomViewModel = new AddPlantRoomViewModel();

            return(View(addPlantRoomViewModel));
        }