public async Task <IActionResult> Delete(int id, TheirDebt theirDebt) { if (id != theirDebt.Id) { return(RedirectToAction(nameof(Index))); } await _theirDebitRepository.DeleteAsync(theirDebt); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Create(TheirDebt theirDebt) { if (theirDebt == null) { return(RedirectToAction(nameof(Index))); } try { await _theirDebitRepository.AddAsync(theirDebt); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
// POST: TheirDebit/EDIT public async Task <IActionResult> Edit(int id, TheirDebt theirDebt) { if (id != theirDebt.Id) { return(RedirectToAction(nameof(Index))); } try { await _theirDebitRepository.UpdateAsync(theirDebt); return(RedirectToAction(nameof(Index))); } catch (Exception) { return(View()); } }