public async Task <IActionResult> Edit(int id, [Bind("ID,Date,Username,Heading,Companies,Rating,Feedback,Agree,Disagree")] CompaniesFeedback companiesFeedback) { if (id != companiesFeedback.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(companiesFeedback); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompaniesFeedbackExists(companiesFeedback.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("CompaniesAndOrganizations", "Home", "feedback")); } return(RedirectToAction("CompaniesAndOrganizations", "Home", "feedback")); }
// GET: CompaniesFeedbacks/Create public IActionResult Create() { CompaniesFeedback co = new CompaniesFeedback(); co.Date = DateTime.Now; co.Username = User.Identity.Name; return(View(co)); }
public async Task <IActionResult> Create([Bind("ID,Date,Username,Heading,Companies,Rating,Feedback,Agree,Disagree")] CompaniesFeedback companiesFeedback) { if (ModelState.IsValid) { _context.Add(companiesFeedback); await _context.SaveChangesAsync(); return(RedirectToAction("CompaniesAndOrganizations", "Home", "feedback")); } return(RedirectToAction("CompaniesAndOrganizations", "Home", "feedback")); }