Beispiel #1
0
        public IActionResult Delete(Income income)
        {
            _incomeRepository.DeleteIncome(income);

            Accountancy accountancy = new Accountancy();

            _accountancyRepository.CreateOrEditIncome(accountancy);

            return(RedirectToAction(nameof(Index)));
        }
        public ActionResult DeleteIncome(int IncomeId)
        {
            Income deletedIncome = repositoryIncome.DeleteIncome(IncomeId);

            if (deletedIncome != null)
            {
                TempData["message"] = string.Format("{0} was deleted",
                                                    deletedIncome.DescriptionIncome);
            }
            return(RedirectToAction("IndexIncome"));
        }
Beispiel #3
0
 public JsonResult DeleteIncome([System.Web.Http.FromBody] tblIncomeSource income)
 {
     if (Session["role"] == null)
     {
         Session["userId"] = null;
         Session["role"]   = null;
         return(Json(false, JsonRequestBehavior.AllowGet));
     }
     else if (Session["role"].ToString() == "Super Admin")
     {
         return(Json(incomeRepository.DeleteIncome(income), JsonRequestBehavior.AllowGet));
     }
     else
     {
         Session["userId"] = null;
         Session["role"]   = null;
         return(Json(false, JsonRequestBehavior.AllowGet));
     }
 }