Пример #1
0
        public ActionResult Create(CompanyModel company)
        {
            // server-side validation
            if (company.IsValidToAdd())
            {
                var companyToAdd = company.ToCompany(CompanyAction.Add);
                company.Id = companyToAdd.Id;
                MvcApplication.CompanyBusinessLogic.Add(companyToAdd);
                MvcApplication.Companies.Add(company);
            }

            return(RedirectToAction("Index"));
        }