public async Task <IActionResult> Edit(int id, [Bind("Id,IdGroup,IdRole,User1,Password,Name,LastName,MLastName,Email,Phone,Status,LnToken,DateUpdate,DateCreate")] User user) { if (id != user.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdGroup"] = new SelectList(_context.Group, "Id", "Name", user.IdGroup); ViewData["IdRole"] = new SelectList(_context.Role, "Id", "Name", user.IdRole); return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,IdUser,IdNews,Status")] ImportantNews importantNews) { if (id != importantNews.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(importantNews); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ImportantNewsExists(importantNews.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdNews"] = new SelectList(_context.News, "Id", "Id", importantNews.IdNews); ViewData["IdUser"] = new SelectList(_context.User, "Id", "Email", importantNews.IdUser); return(View(importantNews)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,RegistrationDate,Status")] Client client) { if (id != client.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(client); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(client.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(client)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,IdCategory,DatePublished,Name,Url,Description,Text,Status,IdOpinion,IdClassification,IsHeadline")] News news) { if (id != news.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(news); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NewsExists(news.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdCategory"] = new SelectList(_context.Category, "Id", "Name", news.IdCategory); ViewData["IdClassification"] = new SelectList(_context.Classification, "Id", "Name", news.IdClassification); ViewData["IdOpinion"] = new SelectList(_context.Opinion, "Id", "Id", news.IdOpinion); return(View(news)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Term,IsTrending,Status")] TermToSearch termToSearch) { if (id != termToSearch.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(termToSearch); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TermToSearchExists(termToSearch.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(termToSearch)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,IdPublisherIndicator,Status")] Publisher publisher) { if (id != publisher.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(publisher); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PublisherExists(publisher.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdPublisherIndicator"] = new SelectList(_context.PublisherIndicator, "Id", "Id", publisher.IdPublisherIndicator); return(View(publisher)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,IdClient,Name,Status,TimeVideo")] Group @group) { if (id != @group.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(@group); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GroupExists(@group.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdClient"] = new SelectList(_context.Client, "Id", "Name", @group.IdClient); return(View(@group)); }