Example #1
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));
        }