예제 #1
0
        public ActionResult ViewBills()
        {
            if (Convert.ToString(Session["key"]) != "patient")
            {
                return(RedirectToAction("Login", "Home"));
            }
            Account_Api  accApi   = new Account_Api();
            AccountModel accModel = new AccountModel();

            accModel.patient_ID = (int)Session["UserId"];
            var model = accApi.GetAccountsByBillID(accModel);

            return(View("~/Views/Patient/PatientViewAccount.cshtml", model));
        }
예제 #2
0
        public ActionResult ViewBillsWithID(int id)
        {
            if (Convert.ToString(Session["key"]) != "patient")
            {
                return(RedirectToAction("Login", "Home"));
            }
            Account_Api  accApi   = new Account_Api();
            AccountModel accModel = new AccountModel();

            accModel.patient_ID = (int)Session["UserId"];
            var model = accApi.GetAccountsByBillID(accModel).Where(a => a.appointment_ID == id);

            if (model.Count() != 0)
            {
                return(View("~/Views/Patient/PatientViewAccount.cshtml", model));
            }
            else
            {
                ViewBag.info = "Billing is not yet generated";
                return(View("~/Views/Patient/NoReports.cshtml"));
            }
        }
        public ActionResult GetPaymentsWithID(int id)
        {
            if (Convert.ToString(Session["key"]) != "admin")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Patient_Api patientApi = new Patient_Api();

            Account_Api  accApi   = new Account_Api();
            AccountModel accModel = new AccountModel();

            accModel.patient_ID = (int)Session["UserId"];
            var model     = accApi.GetAccountsByBillID(accModel);
            var billingID = model.Where(a => a.appointment_ID == id).FirstOrDefault();

            if (billingID != null)
            {
                var paymentsModel       = patientApi.GetPatientPayments((int)Session["UserId"]);
                List <PaymentModel> pay = null;
                if (paymentsModel.Count() != 0)
                {
                    var pp = paymentsModel.Where(p => p.bill_ID == billingID.bill_ID).FirstOrDefault();
                    if (pp != null)
                    {
                        pay.Add(pp);
                        return(View("~/Views/Patient/PatientViewPayments.cshtml", pay));
                    }
                    ViewBag.info = "Billing is not yet generated";
                    return(View("~/Views/Patient/NoReports.cshtml"));
                }
                ViewBag.info = "Billing is not yet generated";
                return(View("~/Views/Patient/NoReports.cshtml"));
            }
            ViewBag.info = "Billing is not yet generated";
            return(View("~/Views/Patient/NoReports.cshtml"));
        }