コード例 #1
0
 //
 // GET: /School/
 public virtual ActionResult Edit()
 {
     var educationOrg = _schoolRepository.GetSchool().EducationOrganization;
     var schoolModel = new SchoolModel();
     _toVmMapper.Map(educationOrg, schoolModel);
     return View(schoolModel);
 }
コード例 #2
0
        public virtual ActionResult Edit(SchoolModel schoolModel)
        {
            if (!ModelState.IsValid)
                return View(schoolModel);

            var school = _schoolRepository.GetSchool().EducationOrganization;
            _toEntityMapper.Map(schoolModel, school);
            _schoolRepository.Save();

            return RedirectToAction(MVC.Home.Index());
        }
コード例 #3
0
        public void WhenIInputValidDetailsForMySchool()
        {
            var salt = Guid.NewGuid();
            _schoolModel = new SchoolModel
            {
                NameOfInstitution = "Name " + salt, 
                StateOrganizationId = "State " + salt, 
                WebSite = "website " + salt
            };

            _homePage = _schoolPage.Save(_schoolModel);
            _schoolPage = _homePage.TopMenu.GoToSchoolPage();
            _updatedModel = _schoolPage.Read.ModelFromPage();
        }