public ActionResult Edit(int id) { var claimLabourSvc = new ClaimLabourLogic(Ticket); var obj = claimLabourSvc.GetById(id); ViewData.Model = obj; return View(); }
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 }); }