示例#1
0
        public ActionResult GetLabour(string code)
        {
            var labourSvc = new LabourLogic(Ticket);
            var ajaxObj = labourSvc.GetAjax(code);

            return Json(ajaxObj, JsonRequestBehavior.AllowGet);
        }
        public ActionResult Edit(int id, FormCollection form)
        {
            var labourSvc = new LabourLogic(Ticket);
            var claimLabourSvc = new ClaimLabourLogic(Ticket);

            var labourId = StringUtility.ToInt(form["labourId"]);
            var labourObj = labourSvc.GetById(labourId);

            var obj = claimLabourSvc.GetById(id);
            if (labourObj != null)
            {
                obj.Labour.Id = labourObj.Id;
                obj.Labour.Code = labourObj.Code;
                obj.Labour.Name = labourObj.Name;
            }
            obj.Hours = StringUtility.ToDecimal(form["hours"]);

            claimLabourSvc.Save(obj);

            return RedirectToAction("Display", "WarrantyClaim", new { id = obj.ClaimId });
        }
        public ActionResult Create(int id, FormCollection form)
        {
            var labourSvc = new LabourLogic(Ticket);

            var labourId = StringUtility.ToInt(form["labourId"]);
            var labourObj = labourSvc.GetById(labourId);

            var obj = new ClaimLabourEntity();
            obj.ClaimId = id;
            if (labourObj != null)
            {
                obj.Labour.Id = labourObj.Id;
                obj.Labour.Code = labourObj.Code;
                obj.Labour.Name = labourObj.Name;
            }
            obj.Hours = decimal.Parse(form["hours"]);

            ViewData.Model = obj;

            return View();
        }
示例#4
0
        public ActionResult Labour(SearchRequest request)
        {
            ViewData["code"] = request.Code;
            ViewData["name"] = request.Name;
            ViewData["limit"] = request.Limit;

            var labourSvc = new LabourLogic(Ticket);
            var results = labourSvc.Search(request);

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

            return View();
        }