public async Task <IActionResult> Edit(int id, [Bind("StatusDealId,StatusDealName,Weight")] StatusDeal statusDeal) { if (id != statusDeal.StatusDealId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(statusDeal); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StatusDealExists(statusDeal.StatusDealId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(statusDeal)); }
public async Task <IActionResult> Create([Bind("StatusDealId,StatusDealName,Weight")] StatusDeal statusDeal) { if (ModelState.IsValid) { _context.Add(statusDeal); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(statusDeal)); }