public async Task <IActionResult> Edit(int id, [Bind("Id,Title,CreatorId,ChannelId,CreateDate")] Conversation conversation) { if (id != conversation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(conversation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConversationExists(conversation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CreatorId"] = new SelectList(_context.Users, "Id", "EMail", conversation.CreatorId); return(View(conversation)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,UsersId,ParticipantsId,ReportType,Notes,CreateDate")] Report report) { if (id != report.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(report); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReportExists(report.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ParticipantsId"] = new SelectList(_context.Participants, "Id", "Type", report.ParticipantsId); ViewData["UsersId"] = new SelectList(_context.Users, "Id", "EMail", report.UsersId); return(View(report)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ConversationId,MessageType,Message1,AttachmentThumbUrl,AttachmentUrl,CreateDate,UsersId")] Message message) { if (id != message.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(message); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MessageExists(message.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ConversationId"] = new SelectList(_context.Conversations, "Id", "ChannelId", message.ConversationId); ViewData["UsersId"] = new SelectList(_context.Users, "Id", "EMail", message.UsersId); return(View(message)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ConversationId,UsersId,Type")] Participant participant) { if (id != participant.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(participant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParticipantExists(participant.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ConversationId"] = new SelectList(_context.Conversations, "Id", "ChannelId", participant.ConversationId); ViewData["UsersId"] = new SelectList(_context.Users, "Id", "EMail", participant.UsersId); return(View(participant)); }