public void UpdateTitle(UpdateTitleViewModel viewModel) { var user = GetCurrentUser(); var bookmarksRepo = new BookmarksRepository(_connectionString); if (!bookmarksRepo.UserOwnsBookmark(user.Id, viewModel.BookmarkId)) { return; } bookmarksRepo.UpdateBookmark(viewModel.Title, viewModel.BookmarkId); }
public IActionResult UpdateTitle(Guid?achieverId) { var achiever = this._context.Achievers.FirstOrDefault(p => p.Id == achieverId); if (achiever != null) { var model = new UpdateTitleViewModel() { Id = achiever.Id, Title = achiever.Title, PostExpiry = achiever.PostExpiry, TemplateName = achiever.TemplateName }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(Guid?adId) { var ad = this._context.Ads.FirstOrDefault(p => p.Id == adId); if (ad != null) { var model = new UpdateTitleViewModel() { Id = ad.Id, Description = ad.Description, Title = ad.Title, PostExpiry = ad.PostExpiry, TemplateName = ad.TemplateName }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(Guid?threadId) { var thread = this._context.Threads.FirstOrDefault(p => p.Id == threadId); if (thread != null) { var model = new UpdateTitleViewModel() { Id = thread.Id, Description = thread.Description, Title = thread.Title, UpdatedAt = thread.UpdatedAt, TemplateName = thread.TemplateName }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(Guid?pollquestionId) { var pollquestion = this._context.PollQuestions.FirstOrDefault(p => p.Id == pollquestionId); if (pollquestion != null) { var model = new UpdateTitleViewModel() { Id = pollquestion.Id, Description = pollquestion.Description, Title = pollquestion.Title, PostExpiry = pollquestion.PostExpiry, TemplateName = pollquestion.TemplateName }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(Guid?courseId) { var course = this._context.Courses.FirstOrDefault(p => p.Id == courseId); if (course != null) { var model = new UpdateTitleViewModel() { Id = course.Id, Description = course.Description, Title = course.Title, PostExpiry = course.PostExpiry, TemplateName = course.TemplateName }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(Guid?productId) { var products = this._context.Products.FirstOrDefault(p => p.Id == productId); if (products != null) { var model = new UpdateTitleViewModel() { Id = products.Id, Description = products.Description, Name = products.Name, PostExpiry = products.PostExpiry }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(Guid?categoryId) { var category = this._context.Categories.FirstOrDefault(p => p.Id == categoryId); if (category != null) { var model = new UpdateTitleViewModel() { Id = category.Id, Description = category.Description, Name = category.Name, PostExpiry = category.PostExpiry }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(Guid?postId) { var post = this._context.Posts.FirstOrDefault(p => p.Id == postId); if (post != null) { var model = new UpdateTitleViewModel() { Id = post.Id, Description = post.Description, Company = post.Company, Position = post.Position, Location = post.Location, ToDate = post.ToDate }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(UpdateTitleViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var post = this._context.Posts.FirstOrDefault(p => p.Id == model.Id); if (post != null) { post.Company = model.Company; post.Description = model.Description; post.ToDate = model.ToDate; post.Position = model.Position; post.Location = model.Location; this._context.Posts.Update(post); this._context.SaveChanges(); } return(RedirectToAction("Index")); }
public IActionResult UpdateTitle(Guid?schooleventId) { var schoolevent = this._context.SchoolEvents.FirstOrDefault(p => p.Id == schooleventId); if (schoolevent != null) { var model = new UpdateTitleViewModel() { Id = schoolevent.Id, Description = schoolevent.Description, Title = schoolevent.Title, PostExpiry = schoolevent.PostExpiry, EventStart = schoolevent.EventStart, EventEnd = schoolevent.EventEnd, TemplateName = schoolevent.TemplateName }; return(View(model)); } return(RedirectToAction("Create")); }
public IActionResult UpdateTitle(UpdateTitleViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var achiever = this._context.Achievers.FirstOrDefault(p => p.Id == model.Id); if (achiever != null) { achiever.PostExpiry = model.PostExpiry; achiever.Title = model.Title; achiever.TemplateName = model.TemplateName; this._context.Achievers.Update(achiever); this._context.SaveChanges(); } return(RedirectToAction("Index")); }
public IActionResult UpdateTitle(UpdateTitleViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var thread = this._context.Threads.FirstOrDefault(p => p.Id == model.Id); if (thread != null) { thread.UpdatedAt = model.UpdatedAt; thread.Title = model.Title; thread.Description = model.Description; thread.TemplateName = model.TemplateName; this._context.Threads.Update(thread); this._context.SaveChanges(); } return(RedirectToAction("Index")); }
public IActionResult UpdateTitle(UpdateTitleViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var pollquestion = this._context.PollQuestions.FirstOrDefault(p => p.Id == model.Id); if (pollquestion != null) { pollquestion.Title = model.Title; pollquestion.Description = model.Description; pollquestion.PostExpiry = model.PostExpiry; pollquestion.TemplateName = model.TemplateName; this._context.PollQuestions.Update(pollquestion); this._context.SaveChanges(); } return(RedirectToAction("Index")); }
public IActionResult UpdateTitle(UpdateTitleViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var category = this._context.Categories.FirstOrDefault(p => p.Id == model.Id); if (category != null) { category.Name = model.Name; category.Description = model.Description; category.PostExpiry = model.PostExpiry; this._context.Categories.Update(category); this._context.SaveChanges(); } return(RedirectToAction("Index")); }
public IActionResult UpdateTitle(UpdateTitleViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var product = this._context.Products.FirstOrDefault(p => p.Id == model.Id); if (product != null) { product.Name = model.Name; product.Description = model.Description; product.PostExpiry = model.PostExpiry; this._context.Products.Update(product); this._context.SaveChanges(); } return(RedirectToAction("Index")); }
public IActionResult UpdateTitle(UpdateTitleViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var course = this._context.Courses.FirstOrDefault(p => p.Id == model.Id); if (course != null) { course.Title = model.Title; course.Description = model.Description; course.PostExpiry = model.PostExpiry; course.TemplateName = model.TemplateName; this._context.Courses.Update(course); this._context.SaveChanges(); } return(RedirectToAction("Index")); }
public IActionResult UpdateTitle(UpdateTitleViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var schoolevent = this._context.SchoolEvents.FirstOrDefault(p => p.Id == model.Id); if (schoolevent != null) { schoolevent.Title = model.Title; schoolevent.Description = model.Description; schoolevent.PostExpiry = model.PostExpiry; schoolevent.TemplateName = model.TemplateName; schoolevent.EventStart = model.EventStart; schoolevent.EventEnd = model.EventEnd; this._context.SchoolEvents.Update(schoolevent); this._context.SaveChanges(); } return(RedirectToAction("Index")); }
public UpdateTitlePage() { InitializeComponent(); TitleEntry.TextChanged += TitleEntry_TextChanged; BindingContext = new UpdateTitleViewModel(); }