public ActionResult Delete(Guid id) { try { string currencyId = string.Empty; currencyId = currencyRepository.DeleteCurrency(id, LogInManager.LoggedInUserId); if (!string.IsNullOrWhiteSpace(currencyId)) { return(Json(new { IsSuccess = true, data = new { CurrencyId = currencyId } }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { IsSuccess = false, errorMessage = "Currency details not deleted successfully." }, JsonRequestBehavior.AllowGet)); } } catch (Exception e) { Utility.Utility.LogError(e, "Delete"); return(Json(new { IsSuccess = false, errorMessage = e.Message })); } }
public bool DeleteCurrency(long currencyAccountId) { try { return(_currencyAccountRepository.DeleteCurrency(currencyAccountId)); } catch (Exception ex) { ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message); return(false); } }
public ActionResult Delete(int id, [Bind(Include = "currencyId,shortName,largeName,country")] CurrencyEditViewModel model) { try { // TODO: Add delete logic here var repo = new CurrencyRepository(); repo.DeleteCurrency(model); return(RedirectToAction("Index")); } catch { return(View()); } }