Пример #1
0
        public ActionResult Create(Resource resource)
        {
            if (ModelState.IsValid)
            {
                db.Resources.Add(resource);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(resource));
        }
Пример #2
0
        public ActionResult Create(Company company)
        {
            if (ModelState.IsValid)
            {
                context.Companies.Add(company);
                context.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(company));
        }
        public ActionResult Create(Group group)
        {
            if (ModelState.IsValid)
            {
                db.Groups.Add(group);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(group));
        }
        public ActionResult Create(Category category)
        {
            if (ModelState.IsValid)
            {
                db.Categories.Add(category);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(category));
        }
        public ActionResult Create(Project project)
        {
            if (ModelState.IsValid)
            {
                db.Projects.Add(project);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(project));
        }
        public ActionResult Create(Person person)
        {
            if (ModelState.IsValid)
            {
                context.People.Add(person);
                context.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(person));
        }