Пример #1
0
        public ActionResult Create([Bind(Include = "BuildingId,Address1,SiteId,Name")] Building building)
        {
            if (ModelState.IsValid)
            {
                building = HRBusinessService.CreateBuilding(UserOrganisationId, building);
                return(RedirectToAction("Index"));
            }
            var viewModel = new BuildingViewModel
            {
                Sites    = new SelectList(HRBusinessService.RetrieveSites(UserOrganisationId), "SiteId", "Name"),
                Building = building
            };

            return(View(viewModel));
        }