Exemplo n.º 1
0
        public ActionResult GetCondition(string code)
        {
            var conditionSvc = new ConditionLogic(Ticket);
            var ajaxObj = conditionSvc.GetAjax(code);

            return Json(ajaxObj, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 2
0
        public ActionResult Condition(SearchRequest request)
        {
            ViewData["code"] = request.Code;
            ViewData["name"] = request.Name;
            ViewData["limit"] = request.Limit;

            var conditionSvc = new ConditionLogic(Ticket);
            var model = conditionSvc.Search(request);

            return View(model);
        }
        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 });
        }