Example #1
0
        public JsonResult ValidateUpdate(Guid projectId)
        {
            var operationResult = new OperationResult();

            operationResult.Success = true;

            var projectParts = _projectPartRepository.GetProjectParts().Where(x => x.ProjectId == projectId).ToList();

            if (projectParts != null && projectParts.Count > 0)
            {
                foreach (var part in projectParts)
                {
                    var received = _foundryOrderRepository.GetFoundryOrderPartByProjectPart(part.ProjectPartId);

                    if (received != null)
                    {
                        operationResult.Success = false;
                        operationResult.Message = "Unable to put on hold or cancel, There are parts included in this project that have been received!";
                        break;
                    }
                }
            }

            return(Json(operationResult, JsonRequestBehavior.AllowGet));
        }