public async Task <IActionResult> PutReport(int id, Report report) { if (id != report.Id) { return(BadRequest()); } _context.Entry(report).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReportExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create([Bind("Id,Title,CreatorId,ChannelId,CreateDate")] Conversation conversation) { if (ModelState.IsValid) { _context.Add(conversation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CreatorId"] = new SelectList(_context.Users, "Id", "EMail", conversation.CreatorId); return(View(conversation)); }
public async Task <IActionResult> Create([Bind("Id,UsersId,ParticipantsId,ReportType,Notes,CreateDate")] Report report) { if (ModelState.IsValid) { _context.Add(report); await _context.SaveChangesAsync(); 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> Create([Bind("Id,ConversationId,MessageType,Message1,AttachmentThumbUrl,AttachmentUrl,CreateDate,UsersId")] Message message) { if (ModelState.IsValid) { _context.Add(message); await _context.SaveChangesAsync(); 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> Create([Bind("Id,ConversationId,UsersId,Type")] Participant participant) { if (ModelState.IsValid) { _context.Add(participant); await _context.SaveChangesAsync(); 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)); }