public async Task <IActionResult> MakeCottageNonVisible(int cottid) { var cottage = await _cottageRepository.GetAsync(cottid); cottage.IsVisibleToClient = false; await _cottageRepository.SaveAsync(); return(await LoadAllCottages()); }
public async Task <IActionResult> SubmitCottageEditForm(CottageFormViewModel vm) { var cottage = await _cottageRepository.GetAsync(vm.Cottage.Id); cottage.Description = vm.Cottage.Description; cottage.Name = vm.Cottage.Name; cottage.PricePerNight = vm.Cottage.PricePerNight; cottage.IsVisibleToClient = vm.Cottage.IsVisibleToClient; await _cottageRepository.SaveAsync(); return(RedirectToAction("LoadAllCottages", "Admin")); }