public MDRDocumentComment BizAction(MDRDocumentCommentDto inputData)
        {
            var mdr = _mdrDbAccess.GetMDRDocument(inputData.MDRDocumentId);

            if (mdr == null)
            {
                AddError("MDR Document Not valid.");
            }

            if (_mdrDbAccess.HasDefaultStatus(inputData.MDRDocumentId))
            {
                AddError("Add Comment on default status not allowed.Please create next issuance status for mdrDocument and then try to add Comment.");
            }

            if (string.IsNullOrWhiteSpace(inputData.Title))
            {
                AddError("title is Required.");
            }

            var desStatus = MDRDocumentComment.CreateMDRDocument(inputData.Title, inputData.Description, inputData.MDRDocumentId, inputData.FilePath);

            CombineErrors(desStatus);

            if (!HasErrors)
            {
                _dbAccess.Add(desStatus.Result);
            }

            return(HasErrors ? null : desStatus.Result);
        }
Esempio n. 2
0
        public void BizAction(MDRDocumentDto inputData)
        {
            var MDRDOC = _dbAccess.GetMDRDocument(inputData.Id);

            if (MDRDOC == null)
            {
                AddError("Could not find the MDR. Someone entering illegal ids?");
                return;
            }

            var status = MDRDOC.UpdateMDRDocument(inputData.Title,
                                                  inputData.Description, inputData.WorkPackageId, inputData.Code, inputData.Type);

            CombineErrors(status);

            Message = $"MDR is update: {MDRDOC.ToString()}.";
        }