public ActionResult Queue()
        {
            var claimSvc = new ClaimLogic(Ticket);
            var results = claimSvc.GetQueue();

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

            return View();
        }
        public ActionResult DisplayStatusHistory(int id)
        {
            var claimSvc = new ClaimLogic(Ticket);
            var results = claimSvc.ListStatusHistory(id);

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

            return View();
        }
        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();
        }
        public ActionResult Edit(int id)
        {
            var claimSvc = new ClaimLogic(Ticket);

            var claimObj = claimSvc.GetById(id);

            ViewData.Model = claimObj;
            ViewData["programId"] = BuildProgramList(claimObj.Program.Id);
            ViewData["claimTypeId"] = BuildClaimTypeList(claimObj.ClaimType.Id);

            return View();
        }
        public ActionResult Edit(int id, FormCollection form)
        {
            var claimSvc = new ClaimLogic(Ticket);
            var concernSvc = new CustomerConcernLogic(Ticket);
            var conditionSvc = new ConditionLogic(Ticket);

            int concernId = StringUtility.ToInt(form["customerConcernId"]);
            var concernObj = concernSvc.GetById(concernId);
            int conditionId = StringUtility.ToInt(form["conditionId"]);
            var conditionObj = conditionSvc.GetById(conditionId);

            var claimObj = claimSvc.GetById(id);

            claimObj.JobCardNumber = form["jobCardNumber"];
            claimObj.InvoiceNumber = form["invoiceNumber"];
            claimObj.ExternalNumber = form["externalNumber"];
            claimObj.DiagnosticNumber = form["diagnosticNumber"];
            claimObj.RepairDate = StringUtility.ToDateTime(form["repairDate"]);
            claimObj.ClaimDistance = StringUtility.ToInt(form["claimDistance"]);
            claimObj.Program.Id = StringUtility.ToInt(form["programId"]);
            claimObj.ClaimType.Id = StringUtility.ToInt(form["claimTypeId"]);
            if (concernObj != null)
            {
                claimObj.CustomerConcern.Id = concernObj.Id;
                claimObj.CustomerConcern.Code = concernObj.Code;
                claimObj.CustomerConcern.Name = concernObj.Name;
            }
            if (conditionObj != null)
            {
                claimObj.Condition.Id = conditionObj.Id;
                claimObj.Condition.Code = conditionObj.Code;
                claimObj.Condition.Name = conditionObj.Name;
            }
            claimObj.FaultNote = form["faultNote"];
            claimObj.CauseNote = form["causeNote"];
            claimObj.RemedyNote = form["remedyNote"];

            ViewData.Model = claimObj;
            ViewData["programId"] = BuildProgramList(claimObj.Program.Id);
            ViewData["claimTypeId"] = BuildClaimTypeList(claimObj.ClaimType.Id);

            claimSvc.Save(claimObj);

            return RedirectToAction("Display", "WarrantyClaim", new { id = claimObj.Id });
        }