public ActionResult UpdatePrice(string ConsultId, int usernewid)
        {
            var id        = pb.GetPatients().Find(x => x.PatientId == usernewid);
            var consultid = db.GetConsultations().Find(x => x.ConsultId == ConsultId);

            ViewBag.name            = id.FullName + " " + id.Surname;
            ViewBag.balance         = consultid.TotalPrice - consultid.Amountpaid;
            ViewBag.Total           = consultid.TotalPrice;
            Session["useroldnewid"] = usernewid;
            Session["ConsultId"]    = ConsultId;
            return(PartialView());
        }
        public ActionResult PatientConsultation()
        {
            DataContext context     = new DataContext();
            var         userStore   = new UserStore <GlenwoodMed.Data.ApplicationUser>(context);
            var         userManager = new UserManager <GlenwoodMed.Data.ApplicationUser>(userStore);

            var user = System.Web.HttpContext.Current.User.Identity.GetUserId();

            if (user != null)
            {
                var rcontext  = new IdentityDbContext();
                var allUsers  = userManager.Users.ToList();
                var getid     = allUsers.Find(x => x.Id == user.ToString());
                var patientid = pb.GetPatients().Find(x => x.NationalId == getid.NationalId.ToString());
                //Find Patient with the associated consultation
                pd._Consultation = cb.GetConsultations().FindAll(x => x.PatientId == Convert.ToInt32(patientid.PatientId)).OrderByDescending(x => x.ConsultId).ToList();
                //Find patient and display details
                pd.Patient = pb.GetPatients().Find(x => x.PatientId == patientid.PatientId);
            }
            else
            {
                Response.Write("Invalid Entry This page is dependent on another page");
            }
            return(View(pd));
        }
        public ActionResult PrintHistory(int PatientId)
        {
            ConsultationBusiness cb = new ConsultationBusiness();
            var con = new Consultation();

            PatientConsultationDetails pd = new PatientConsultationDetails();

            // pass in Model, then View name

            //Find Patient with the associated consultation
            pd._Consultation = cb.GetConsultations().FindAll(x => x.PatientId == PatientId).OrderByDescending(x => x.ConsultId).ToList();
            //Find patient and display details
            pd.Patient = pb.GetPatients().Find(x => x.PatientId == PatientId);
            //pd._Xray = tb.GetAll().Where(x => x.PatientId == PatientId).ToList();
            pd._HIV = htb.GetAllTest().Where(x => x.PatientId == PatientId).ToList();
            //rm._HIV =
            // With no Model and default view name.  Pdf is always the default view name
            //return new PdfResult();
            return(new PdfResult(pd, "PrintHistory"));
        }
Esempio n. 4
0
        public ActionResult Create(string ConsultId)
        {
            var pr = new PatientBusiness();
            var cb = new ConsultationBusiness();
            var rl = new ReferalBus();

            if (ConsultId != null)
            {
                var rlp   = cb.GetConsultations().Find(x => x.ConsultId == ConsultId);
                var model = new ReferralModel
                {
                    Patient_name   = rlp.patientfullname,
                    PatientId      = rlp.PatientId,
                    Patient_age    = pr.GetPatient(rlp.PatientId).Age,
                    Patient_number = pr.GetPatient(rlp.PatientId).Telephone,
                    diagnotics     = rlp.Notes + "  " + rlp.Description
                };

                return(View(model));
            }
            return(View());
        }