public async Task <IActionResult> Edit(int id, [Bind("PkDirectChatId,FkDirectChatEmployer,DirectChatMessage,DirectChatTimeSent,DirectChatSender,DirectChatStatus,DirectChatTimeRead")] TblChatDirect tblChatDirect) { if (id != tblChatDirect.PkDirectChatId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblChatDirect); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblChatDirectExists(tblChatDirect.PkDirectChatId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FkDirectChatEmployer"] = new SelectList(_context.Users, "Id", "Id", tblChatDirect.FkDirectChatEmployer); return(View(tblChatDirect)); }
public async Task <IActionResult> Create([Bind("PkDirectChatId,FkDirectChatEmployer,DirectChatMessage,DirectChatTimeSent,DirectChatSender,DirectChatStatus,DirectChatTimeRead")] TblChatDirect tblChatDirect) { if (ModelState.IsValid) { _context.Add(tblChatDirect); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FkDirectChatEmployer"] = new SelectList(_context.Users, "Id", "Id", tblChatDirect.FkDirectChatEmployer); return(View(tblChatDirect)); }