Example #1
0
        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)));
        }
Example #2
0
        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());
            }
        }
Example #3
0
        // 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());
            }
        }