示例#1
0
        public ActionResult SaveEdited(ProjectInformations projectInformations)
        {
            var projectInformationsInDb = _context.ProjectInformations.Single(x => x.Id == projectInformations.Id);

            projectInformationsInDb.Name = projectInformations.Name;

            _context.SaveChanges();

            return(RedirectToAction("Index", "Projects"));
        }
示例#2
0
        public ActionResult SaveNew(ProjectInformations projectInformations)
        {
            if (!ModelState.IsValid)
            {
                return(View("New"));
            }

            _context.ProjectInformations.Add(projectInformations);

            _context.SaveChanges();

            return(RedirectToAction("Index", "Projects"));
        }