public async Task <IActionResult> PutTranscationMode(int id, TranscationMode transcationMode) { if (id != transcationMode.TranscationModeId) { return(BadRequest()); } _context.Entry(transcationMode).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TranscationModeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TranscationMode> > PostTranscationMode(TranscationMode transcationMode) { _context.TranscationModes.Add(transcationMode); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTranscationMode", new { id = transcationMode.TranscationModeId }, transcationMode)); }
public async Task <IActionResult> Edit(int id, [Bind("TranscationModeId,Transcation")] TranscationMode transcationMode) { if (id != transcationMode.TranscationModeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(transcationMode); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TranscationModeExists(transcationMode.TranscationModeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(PartialView(transcationMode)); }
public async Task <IActionResult> Create([Bind("TranscationModeId,Transcation")] TranscationMode transcationMode) { if (ModelState.IsValid) { _context.Add(transcationMode); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(PartialView(transcationMode)); }