예제 #1
0
 public DataTable Search(ClaimSearchRequest request)
 {
     using (var db = CreateCatalog())
     {
         return db.Claims.Search(request);
     }
 }
예제 #2
0
        public ActionResult Search(ClaimSearchRequest request)
        {
            ViewData["claimCode"] = request.ClaimCode;
            ViewData["jobCardNumber"] = request.JobCardNumber;
            ViewData["externalNumber"] = request.ExternalNumber;
            ViewData["dealerName"] = request.DealerName;
            ViewData["vinNumber"] = request.VinNumber;
            ViewData["chassisNumber"] = request.ChassisNumber;
            ViewData["limit"] = request.Limit;

            var claimSvc = new ClaimLogic(Ticket);
            var results = claimSvc.Search(request);

            if (results.Rows.Count == 1)
            {
                int claimId = results.Rows[0].Get<int>("Id");
                return RedirectToAction("Display", new { id = claimId, controller = "WarrantyClaim", area = "Claim" });
            }

            ViewData.Model = results;
            ViewData.Add("resultsCount", results.Rows.Count);

            return View();
        }