public async Task <IActionResult> Delete(int id)
        {
            var status = await _bankRepo.DeleteAsync(SD.BankAPIPath, id);

            if (status)
            {
                return(Json(new { success = true, message = " Delete Successful" }));
            }
            return(Json(new { success = false, message = " Delete UnSuccessful" }));
        }
Пример #2
0
        public async Task <ActionResult> DeleteAsync(int id)
        {
            try
            {
                deleteImgBank(id);
                await banks.DeleteAsync(id);

                await banks.saveAsync();
            }
            catch (Exception ex)
            {
                ViewBag.err = ex;
                return(View("Error"));
            }
            return(RedirectToAction("Banks", "Home"));
        }