public List<UndecidedApplication> GetUndecidedApplications(ApplicationStatuses applicationStatus) { List<UndecidedApplication> undecidedApplications = (from application in context.Applications join applicant in context.Applicants on application.ApplicantId equals applicant.ApplicantId where application.AppStatus == applicationStatus.ToString() select new UndecidedApplication { ApplicationDate = application.ApplicationDate, ApplicationId = application.ApplicationId, FirstName = applicant.FirstName, MiddleName = applicant.MiddleNames, LastName = applicant.LastName, Email = application.Contacts.Where(a => a.ContactTypeId == (int)ContactsOfType.EmailAddress).FirstOrDefault().ContactDetail, LoanAmount = application.Amount, LoanPaybackDate = application.PaybackDate }).OrderByDescending(a => a.ApplicationDate).ToList(); return undecidedApplications; }
public void UpdateApplicationStatus(ApplicationStatuses status, int applicationId, int reasonId, Guid userId, DateTime dateAdded ) { _applicationRepository.UpdateApplicationStatus(status, applicationId); _reasonRepository.AddReasonLog(status, applicationId, reasonId, userId, dateAdded); _actionLogRepository.LogAction(status.ToString(), applicationId, userId, dateAdded); }
public void UpdateApplicationStatus(ApplicationStatuses applicationStatus, int applicationId) { Application application = GetApplication(applicationId); application.AppStatus = applicationStatus.ToString(); context.SubmitChanges(); }