コード例 #1
0
        public ActionResult Update(int id)
        {
            var house     = HousesManager.GetByID(id);
            var viewModel = new HouseUpdateResponseViewModel(house);

            return(View("~/Views/Houses/AddOrUpdate.cshtml", viewModel));
        }
コード例 #2
0
        public ActionResult Create(HouseUpdateRequestViewModel requestModel)
        {
            var house = new House();

            requestModel.UpdateHouseModel(house);

            bool success = HousesManager.Save(house);

            var viewModel = new HouseUpdateResponseViewModel(house);

            viewModel.UpdateSuccess = success;

            return(RedirectToAction("Details", new { id = house.ID }));
        }
コード例 #3
0
        public ActionResult Update(int id, HouseUpdateRequestViewModel requestModel)
        {
            var house = HousesManager.GetByID(id);

            requestModel.UpdateHouseModel(house);

            bool success = HousesManager.Save(house);

            var viewModel = new HouseUpdateResponseViewModel(house);

            viewModel.UpdateSuccess = success;

            return(View("~/Views/Houses/AddOrUpdate.cshtml", viewModel));
        }