private static string GetLoanFeedback(ITLoanFeedbackRepository tLoanFeedbackRepository, string loanId, EnumLoanFeedbackType feedbackType) { TLoanFeedback lastFeedback = tLoanFeedbackRepository.GetLastFeedback(loanId, feedbackType); if (lastFeedback != null) { return(lastFeedback.LoanFeedbackDesc); } return(string.Empty); }
public static FeedbackViewModel Create(ITLoanRepository tLoanRepository, ITLoanFeedbackRepository tLoanFeedbackRepository, string loanId) { var viewModel = new FeedbackViewModel(); if (!string.IsNullOrEmpty(loanId)) { viewModel.LoanFeedbackCommon = GetLoanFeedback(tLoanFeedbackRepository, loanId, EnumLoanFeedbackType.Common); viewModel.LoanFeedbackPaymentCharacter = GetLoanFeedback(tLoanFeedbackRepository, loanId, EnumLoanFeedbackType.PaymentCharacter); viewModel.LoanFeedbackProblem = GetLoanFeedback(tLoanFeedbackRepository, loanId, EnumLoanFeedbackType.Problem); viewModel.LoanFeedbackSolution = GetLoanFeedback(tLoanFeedbackRepository, loanId, EnumLoanFeedbackType.Solution); } return(viewModel); }