public List <CollectionView> AllConsultationDrugs()
 {
     using (var clinicrepo = new CollectionRepository())
     {
         return
             (clinicrepo.Getall().ToList()
              .Select(
                  x =>
                  new CollectionView()
         {
             collectionID = x.collectionID,
             PatientName = x.PatientName,
             Prescription = x.Prescription,
             Collected = x.Collected,
             PaymentType = x.PaymentType
         })
              .ToList());
     }
 }
 public List <CollectionView> GetPendingDrugs()
 {
     using (var clinicrepo = new CollectionRepository())
     {
         List <CollectionDrugs> notcollected = clinicrepo.Getall().FindAll(x => x.Collected == false);
         return
             (notcollected.ToList()
              .Select(
                  x =>
                  new CollectionView()
         {
             collectionID = x.collectionID,
             PatientName = x.PatientName,
             Prescription = x.Prescription,
             Collected = x.Collected
         })
              .ToList());
     }
 }
 public List <CollectionView> GetCollectedDrugs()
 {
     using (var clinicrepo = new CollectionRepository())
     {
         List <CollectionDrugs> collected = clinicrepo.Getall().FindAll(x => x.Collected == true);
         return
             (collected.ToList()
              .Select(
                  x =>
                  new CollectionView()
         {
             collectionID = x.collectionID,
             PatientName = x.PatientName,
             Prescription = x.Prescription,
             Collected = x.Collected,
             PaymentType = x.PaymentType
         })
              .ToList());
     }
 }