public Models.ApplicantModel addOrUpdateApplicant(Models.ApplicantModel applicant) { Applicant a = new Applicant { APPLICANT_ID = applicant.applicantId, FIRST_NAME_TX = applicant.firstName, LAST_NAME_TX = applicant.lastName, MIDDLE_INITIAL_TX = applicant.middleInitial, MOD_DT = DateTime.Now, SSN_TX = applicant.ssn, SUFFIX_TX = applicant.suffix }; ApplicantRepo appRepo = new ApplicantRepo(); if (appRepo.getById(a) != null) { appRepo.update(a); } else { appRepo.add(a); } return applicant; }
public void removeApplicant(Models.ApplicantModel applicant) { ApplicantRepo appRepo = new ApplicantRepo(); appRepo.remove(appRepo.getById(new Applicant { APPLICANT_ID = applicant.applicantId })); }