public ActionResult Header(AboutHeaderEditViewModel vm) { EditAboutHeaderCommand command = new EditAboutHeaderCommand { Header = new AboutHeader { Title = vm.Title, SubTitle = vm.SubTitle, LinkText = vm.LinkText, LinkUrl = vm.LinkUrl } }; if (vm.BackgroundImage != null) { var result = SaveAs(vm.BackgroundImage, PlatformConfiguration.UploadedSettingsPath); if (result != null && result.ResultCode == CommandResultCode.Success) { command.File = result.File; } } Command.Execute(command); return(RedirectToAction("Index")); }
public ActionResult Header() { GetAboutHeaderQueryResult result = Query.For <GetAboutHeaderQueryResult>().With(new EmptyCriterion()); AboutHeaderEditViewModel vm = new AboutHeaderEditViewModel { Title = result.Header.Title, SubTitle = result.Header.SubTitle, LinkText = result.Header.LinkText, LinkUrl = result.Header.LinkUrl, BackgroundImageUrl = result.BackgroundImageUrl }; return(View(vm)); }