Example #1
0
        public ActionResult ConfirmDecision(String decision, String Department, Int64 id)
        {
            ApricotContext Db = new ApricotContext();

            BillRepository billrepo = new BillRepository(Db);
            Bill           bill     = billrepo.GetByBillID(id);

            if (decision == "yes")
            {
                bill.Bill_Status = Data.Models.ApricotEnums.BillSatusEnum.APPROVED;
                billrepo.UpdateBill(bill);

                FinanceManagerBL fmbl = new FinanceManagerBL(Db);
                fmbl.AlloteFinanceManager(id, Department);

                NotificationBL notibl = new NotificationBL(Db);
                notibl.NotificationOfApproval(id);
            }

            else if (decision == "no")
            {
                bill.Bill_Status = Data.Models.ApricotEnums.BillSatusEnum.REJECTED;
                billrepo.UpdateBill(bill);

                NotificationBL notibl = new NotificationBL(Db);
                notibl.NotificationOfRejection(bill.Bill_ID);
            }

            return(RedirectToAction("Index", "Manager"));
        }