public async Task <IActionResult> Edit(int id, [Bind("Id,GiftCertId,RedemptionDate,LastModifiedBy,CreatedDate,ModifiedDate,Active,Remarks")] GcRedemption gcRedemption) { if (id != gcRedemption.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gcRedemption); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GcRedemptionExists(gcRedemption.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["GiftCertId"] = new SelectList(_context.GiftCert, "Id", "Id", gcRedemption.GiftCertId); return(View(gcRedemption)); }
public async Task <IActionResult> Create([Bind("Id,GiftCertId,RedemptionDate,LastModifiedBy,CreatedDate,ModifiedDate,Active,Remarks")] GcRedemption gcRedemption) { if (ModelState.IsValid) { _context.Add(gcRedemption); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GiftCertId"] = new SelectList(_context.GiftCert, "Id", "Id", gcRedemption.GiftCertId); return(View(gcRedemption)); }