public void SaveComment(CommentViewModel commentViewModel)
 {
     var creditComment = Map(commentViewModel);
     if (commentViewModel.Id.Equals(0))
     {
         AddCreditProcessFlowComment(creditComment);
     }
     else
     {
         UpdateCreditProcessFlowComment(creditComment);
     }
 }
        private static CreditComment Map(CommentViewModel viewModel)
        {
            var creditComment = new CreditComment
                                {
                                    CreditCommentId = viewModel.Id,
                                    CreditProcessId = viewModel.CreditProcessId,
                                    creditProcessXCompanyId = viewModel.CreditProcessXCompanyId,
                                    Comment = viewModel.Comment,
                                    CommentDate = viewModel.CommentDate,
                                };

            return creditComment;
        }
        private CommentViewModel Map(CreditComment creditComment)
        {
            var viewModel = new CommentViewModel
                            {
                                Id = creditComment.CreditCommentId,
                                Comment = creditComment.Comment,
                                CommentDate = creditComment.CommentDate,
                                CreditProcessId = creditComment.CreditProcessId,
                                IsNew = false,
                            };

            return viewModel;
        }