Esempio n. 1
0
        public ActionResult Provider(int providerID)
        {
            var provider = ProviderService.GetByPK(providerID);

            if (provider == null)
            {
                return(null);
            }
            return(View(new ProviderVM {
                Provider = provider,
                Vendors = ExamService.GetAll(x => x.Available && x.ExamProviders.Any(e => e.Provider_ID == providerID))
                          .Select(e => e.Vendor).IsActive().Distinct().ToList()
            }));
        }
Esempio n. 2
0
        public ActionResult Search(int vendorId, string number)
        {
            if (vendorId == 0)
            {
                return(NotFound());
            }
            var vendor = VendorService.GetByPK(vendorId);

            if (vendor == null)
            {
                return(NotFound());
            }
            var model = new ExamSearchVM {
                Vendor = vendor,
                Number = number,
                Exams  = number.IsEmpty()
                                        ? new List <Exam>()
                                        : ExamService.GetAll(x => x.Vendor_ID == vendorId && x.Exam_TC.Contains(number) && x.Available).Take(20).ToList()
            };

            return(View(model));
        }
 public IEnumerable <ExamViewModel> Get()
 {
     return(ExamService.GetAll());
 }