public ActionResult PrintCertificate(int MedcertificateId)
        {
            PatientConsultationDetails med = new PatientConsultationDetails();

            med.MedCert = ee.GetallMedCert().Find(x => x.MedcertificateId == MedcertificateId);
            return(new PdfResult(med, "PrintCertificate"));
        }
        public ActionResult PrintAllCertificates()
        {
            MedCertificateBusiness mb = new MedCertificateBusiness();

            // With no Model and default view name.  Pdf is always the default view name
            //return new PdfResult();
            return(new PdfResult(mb.GetallMedCert(), "PrintAllCertificates"));
        }
        public ActionResult Index(string sortOrder, string currentFilter, int PatientId)
        {
            ViewBag.CurrentSort  = sortOrder;
            ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date";

            var mode = new ExtraMedModel();

            mode.med   = ee.GetallMedCert(PatientId);
            mode.medId = PatientId;

            //var name = ee.GetMedbyId(PatientId);
            string name = "";

            name         = pb.GetPatient(PatientId).FullName + " " + pb.GetPatient(PatientId).Surname;
            ViewBag.Name = name;

            switch (sortOrder)
            {
            case "name_desc":
                mode.med = ee.GetallMedCert(PatientId).OrderByDescending(x => x.PatintName).ToList();
                break;

            case "Date":
                mode.med = ee.GetallMedCert(PatientId).OrderBy(x => x.Date).ToList();
                break;

            case "date_desc":
                mode.med = ee.GetallMedCert(PatientId).OrderByDescending(x => x.Date).ToList();
                break;

            default:      // Name ascending
                mode.med = ee.GetallMedCert(PatientId).OrderByDescending(x => x.PatintName).ToList();
                break;
            }

            return(View(mode));
        }