Beispiel #1
0
 public WFFileStateNotePOCO(WFFileStateNote entity)
 {
     this.Id      = entity.Id;
     this.Comment = entity.Comment;
     this.TS      = entity.TS;
     this.User    = new UserPOCO(entity.User);
 }
Beispiel #2
0
        public IResultServiceModel <FileStateCommentResponse> AddCommentToFileState(FileStateCommentRequest request, User user)
        {
            IResultServiceModel <FileStateCommentResponse> rsm = new ResultServiceModel <FileStateCommentResponse>();

            try
            {
                var stateNote = new WFFileStateNote()
                {
                    TS              = request.ts,
                    Comment         = request.comment,
                    UserId          = user.Id,
                    WFEntityStateId = request.stateId
                };

                this.wfFileStateNoteRepository.Add(stateNote);
                var rm = this.wfFileStateNoteRepository.Save();
                if (rm.Success)
                {
                    rsm.OnSuccess(new FileStateCommentResponse()
                    {
                        fileId     = request.fileId,
                        stateId    = request.stateId,
                        newId      = stateNote.Id,
                        temporalId = request.id
                    });
                }
                else
                {
                    rsm.OnError(rm);
                }
            }
            catch (Exception ex)
            {
                rsm.OnException(ex);
            }

            return(rsm);
        }