public PartialViewResult ViewAll(int id)
        {
            var ms = MechanismRep.GetAll();
            var device = DeviceRep.GetFailureMechanism(id);

            FindingViewModel finding = new FindingViewModel
            {
                Mechanism = ms,
                FailureDetail = (device != null) ? device.FailureDetail : "",
                DeviceId = id,
                MechanismId = (device != null) ? device.MechanismId.Value : 0
            };
            return PartialView("_PartialPageViewAll", finding);
        }
        /// <summary>
        /// Finds the save.
        /// </summary>
        /// <param name="DeviceId">The device identifier.</param>
        /// <param name="find">The find.</param>
        /// <returns>JsonResult.</returns>
        public JsonResult FindSave(int DeviceId, FindingViewModel find)
        {
            FARDeviceDetailsDto update = new FARDeviceDetailsDto
            {
                Id = DeviceId,
                MechanismId = find.MechanismId,
                FailureDetail = find.FailureDetail
            };

            var saveResult = DeviceRep.UpdateFailureMechanism(update, this.CurrentName);

            if (saveResult == Model.SaveResult.SUCCESS)
            {
                Response.StatusCode = (int)HttpStatusCode.OK;
                return new JsonResult
                {
                    Data = new { code = "SB01" },
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet
                };
            }
            else
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return new JsonResult
                {
                    Data = new { code = "SB02" },
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet
                };
            }
        }
        public PartialViewResult GetAll(int id)
        {
            var ms = MechanismRep.GetAll();
            var failureMachanism = DeviceRep.GetFailureMechanism(id);
            
            //Enhancement 19-04-2016
            var device = DeviceRep.Single(id);

            bool isSameOverall = false;

            if (device != null)
            {
                isSameOverall = (device.Master.Analyst == this.CurrentName);
            }
            //End Enhacement 19-04-2016

            FindingViewModel finding = new FindingViewModel
            {
                Mechanism = ms,
                FailureDetail = (failureMachanism != null) ? failureMachanism.FailureDetail : "",
                DeviceId = id,
                MechanismId = (failureMachanism != null) ? failureMachanism.MechanismId.Value : 0,
                IsSameOverall = isSameOverall
            };
            return PartialView("_PartialPageGetAll", finding);
        }