public List <MedicalCertificateModel> GetallMedCert(int PatientId)
        {
            PatientRepository pr = new PatientRepository();

            using (var medrepo = new MedicalCertificateRepository())
            {
                return(medrepo.GetallCertificate().FindAll(med => med.PatientId == PatientId).Select(x => new MedicalCertificateModel()
                {
                    MedcertificateId = x.MedcertificateId,
                    Date = x.Date,
                    PatintName = x.PatintName.ToUpper(),
                    OpinonIllness = x.OpinonIllness,
                    Fitnessproblem = x.Fitnessproblem,
                    StartingDate = x.StartingDate,
                    Enddate = x.Enddate,
                    Comment = x.Comment,
                    Doctorname = x.Doctorname,
                    Address = x.Address,
                    PatientId = x.PatientId,
                    resultFile = pr.GetById(x.PatientId).File,
                    FileName = pr.GetById(x.PatientId).FileName,
                    FileType = GlenwoodMed.Model.ViewModels.FileType.Avatar,
                    datecreated = x.datecreated
                }).ToList());
            }
        }
        public int CountCertificates()
        {
            int count = 0;

            var medrepo = new MedicalCertificateRepository();

            foreach (var c in medrepo.GetallCertificate())
            {
                count++;
            }

            return(count);
        }
예제 #3
0
 public List <MedicalCertificateModel> GetallMedCert()
 {
     using (var medrepo = new MedicalCertificateRepository())
     {
         return(medrepo.GetallCertificate().Select(x => new MedicalCertificateModel()
         {
             MedcertificateId = x.MedcertificateId,
             Date = x.Date,
             PatintName = x.PatintName.ToUpper(),
             OpinonIllness = x.OpinonIllness,
             Fitnessproblem = x.Fitnessproblem,
             StartingDate = x.StartingDate,
             Enddate = x.Enddate,
             Comment = x.Comment,
             //Doctorname = x.Doctorname,
             // Address = x.Address,
             PatientId = x.PatientId
         }).ToList());
     }
 }
 public List <MedicalCertificateModel> GetAllCertificates()
 {
     using (var medrepo = new MedicalCertificateRepository())
     {
         return(medrepo.GetallCertificate().Select(x => new MedicalCertificateModel()
         {
             MedcertificateId = x.MedcertificateId,
             Date = x.Date,
             PatintName = x.PatintName.ToUpper(),
             OpinonIllness = x.OpinonIllness,
             Fitnessproblem = x.Fitnessproblem,
             StartingDate = x.StartingDate,
             Enddate = x.Enddate,
             Comment = x.Comment,
             PatientId = x.PatientId,
             resultFile = pr.GetById(x.PatientId).File,
             FileName = pr.GetById(x.PatientId).FileName,
             FileType = GlenwoodMed.Model.ViewModels.FileType.Avatar
         }).ToList());
     }
 }