public void SetUserConfigViewModel(MyHomeUserConfigViewModel viewModel) { var config = db.MyHome_UserConfigs.FirstOrDefault(x => x.UserId == viewModel.UserID); if (config == null) { return; } config.BackgroundImage = viewModel.BackgroundImage; config.ShowWeather = viewModel.ShowWeather; config.ShowVisitorsAdminHome = viewModel.ShowVisitorsAdminHome; config.ShowDateAndTime = viewModel.ShowDateAndTime; config.ShowBookmarks = viewModel.ShowBookmarks; config.ShowBanner = viewModel.ShowBanner; config.IsEditable = viewModel.IsEditable; config.ShowBlog = viewModel.ShowBlog; config.BlogTitle = viewModel.BlogTitle; config.BookmarksTitle = viewModel.BookmarksTitle; config.Greeting = viewModel.Greeting; config.WebsiteName = viewModel.WebsiteName; //config.DefaultFavoriteImage = viewModel.BackgroundImage; //config.DefaultBlogPostImage = viewModel.DefaultBlogPostImage; //config.AddNewFavoriteImage = viewModel.AddNewFavoriteImage; db.SaveChanges(); }
public ActionResult _HomeSettingsForm(MyHomeUserConfigViewModel viewModel) { myHomeService.SetUserConfigViewModel(viewModel); return(RedirectToAction("Index")); }
public void _HomeSettingsForm(MyHomeUserConfigViewModel viewModel) { myHomeService.SetUserConfigViewModel(viewModel); }