public ActionResult ViewBilling()
        {
            if (Convert.ToString(Session["key"]) != "admin")
            {
                return(RedirectToAction("Login", "Home"));
            }
            Admin_Api adminApi = new Admin_Api();
            var       model    = adminApi.GetAllAccounts();

            return(View("~/Views/Administrator/AdminViewBilling.cshtml", model.OrderByDescending(m => m.bill_ID)));
        }
        public ActionResult AddAccountDetail(AccountModel accModel)
        {
            if (Convert.ToString(Session["key"]) != "admin")
            {
                return(RedirectToAction("Login", "Home"));
            }

            accModel.generatedDate_Time = DateTime.Now;
            accModel.paid_Amount        = 0;
            Admin_Api adminApi = new Admin_Api();

            adminApi.AddAccountDetail(accModel);

            var model = adminApi.GetAllAccounts();

            return(View("~/Views/Administrator/AdminViewBilling.cshtml", model.OrderByDescending(m => m.bill_ID)));
        }
        public ActionResult GetAccountsByDropDown(AccountModel accountModel)
        {
            if (Convert.ToString(Session["key"]) != "admin")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Admin_Api adminApi = new Admin_Api();
            var       model    = adminApi.GetAllAccounts();

            if (accountModel.account_ID == 1)
            {
                ViewBag.AccountDropDrown = new SelectList(model.Select(a => a.account_ID));
            }
            else if (accountModel.account_ID == 2)
            {
                ViewBag.AccountDropDrown = new SelectList(model.Select(a => a.patient_ID));
            }
            else if (accountModel.account_ID == 3)
            {
                ViewBag.AccountDropDrown = new SelectList(model.Select(a => a.payment_ID));
            }
            return(View("~/Views/Administrator/AdminViewAccounts.cshtml"));
        }