Exemplo n.º 1
0
        //
        // GET: /TestResult/
        public ActionResult Index(int?page, int Id, int pageSize = 5, string test = "")
        {
            //search by name
            List <HIVTestResultModel> myList = ee.GetAllTest().FindAll(x => x.PatientId == Id).ToList();
            var search = myList.OrderBy(x => x.Date).Where(x => x.PatientName.ToLower().Contains(test.ToLower()) ||
                                                           test == null).ToList();

            // var search = from a in ee.GetAllTest() where a.PatientId == id orderby a.Date descending select a;

            if (Request.HttpMethod != "GET")
            {
                page = 1;
            }

            int pageNumber = (page ?? 1);

            List <HIVTestResultModel>      pm    = search;
            PagedList <HIVTestResultModel> model = new PagedList <HIVTestResultModel>(pm, pageNumber, pageSize);

            ViewBag.ee      = ee.Count();
            TempData["msg"] = ee.CountNeg();

            return(View("Index", pm.ToPagedList(pageNumber, pageSize)));
        }
        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"));
        }