示例#1
0
        public IActionResult LastMaaserGiven(int id)
        {
            MaaserRepository rep = new MaaserRepository(_connString, User.Identity.Name);
            var x = rep.GetLastMaaserGiven(id);

            return(Json(x));
        }
示例#2
0
        public IActionResult AddMaaserGiven(MaaserGiven maaserGiven)
        {
            MaaserRepository rep = new MaaserRepository(_connString, User.Identity.Name);

            rep.AddMaaserGiven(maaserGiven);
            //MaaserGiven x = new MaaserGiven();
            //x = maaserGiven;
            return(Json(maaserGiven.Id));
        }
示例#3
0
        public IActionResult AddMoney(MoneyEarned money)
        {
            if (money.Amount < 0)
            {
                return(Json(new { money = "error" }));
            }
            MaaserRepository rep = new MaaserRepository(_connString, User.Identity.Name);

            rep.AddAmount(money);
            var total = rep.GetStillOwe();

            return(Json(new { money, total }));
            //return Json(money);
        }
示例#4
0
        public IActionResult Index()
        {
            MaaserRepository rep = new MaaserRepository(_connString, User.Identity.Name);
            IndexViewModel   vm  = new IndexViewModel
            {
                MaaserGiven      = rep.GetMaaserGiven(),
                MoneyEarned      = rep.GetMoneyEarned(),
                TotalEarned      = rep.GetTotalEarned(),
                TotalMaaserGiven = rep.GetTotalMaaserGiven(),
                TotalOwe         = rep.GetStillOwe()
            };

            return(View(vm));
        }
示例#5
0
        public IActionResult ViewMaaserGiven()
        {
            MaaserRepository rep = new MaaserRepository(_connString, User.Identity.Name);

            return(View(rep.GetMaaserGiven()));
        }