public ActionResult Delete(string id) { try { InvoiceHelper.Delete(id); return(RedirectToAction("Index")); } catch (Exception ex) { return(RedirectToAction("Index", new { message = ex.Message })); } }
public ActionResult Delete(int invId, string deleteReason) { #region Check Rights bool hasRights = false; hasRights = AdminHelper.CheckUserAction(ScreenEnum.InvoiceList, ActionEnum.Delete); if (!hasRights) { return(Json("You are UnAuthorized to do this action", JsonRequestBehavior.AllowGet)); } #endregion string isDeleted = InvoiceHelper.Delete(invId, deleteReason); return(Json(isDeleted, JsonRequestBehavior.AllowGet)); }