Пример #1
0
        void addApplicant()
        {
            PhoneCodeModel hm = new PhoneCodeModel { phoneCodeDescription = "Home Phone", phoneCode = "AA", lastModifiedDate = DateTime.Now };
            PhoneCodeModel cm = new PhoneCodeModel { phoneCodeDescription = "Cell Phone", phoneCode = "BB", lastModifiedDate = DateTime.Now };

            List<PhoneModel> phones = new List<PhoneModel>();
            PhoneModel p1 = new PhoneModel();
            p1.createDate = DateTime.Now;
            p1.lastModifiedDate = DateTime.Now;
            p1.phoneNumber = 1231231233;
            p1.phoneCd = hm.phoneCode;
            phones.Add(p1);

            PhoneModel p2 = new PhoneModel();
            p2.createDate = DateTime.Now;
            p2.lastModifiedDate = DateTime.Now;
            p2.phoneNumber = 9999999999;
            p2.phoneCd = cm.phoneCode;
            phones.Add(p2);

            ApplicantModel a1 = new ApplicantModel();
            a1.applicantId = 1;
            a1.firstName = "Wes";
            a1.lastName = "Reisz";
            a1.middleInitial = "T";
            a1.ssn = "111111111";
            a1.suffix = ""; //this should default if nothing
            a1.phones = phones.ToArray<PhoneModel>();

            //IService service = new PhoneService();
            //service.addOrUpdatePhone(a1);
        }
Пример #2
0
        public void setupData()
        {
            //add and test phonecodes
            phoneService = new PhoneService();
            applicantService = new ApplicantService();

            ApplicantModel applicant = new ApplicantModel { applicantId = 1, firstName = "Wes", lastName = "Reisz", lastUpdated = DateTime.Now, middleInitial = "T", ssn = "123456789", suffix = "JR" };
            applicantService.addOrUpdateApplicant(applicant);

            PhoneCodeModel hm = new PhoneCodeModel { phoneCodeDescription = "Home Phone", phoneCode = "AA", lastModifiedDate = DateTime.Now };
            phoneService.addPhoneCd(hm);
            phoneService.addOrUpdatePhone(new PhoneModel {applicantId=applicant.applicantId,createDate=DateTime.Now, lastModifiedDate=DateTime.Now, phoneCd=hm.phoneCode,phoneNumber=1231231233});
        }
Пример #3
0
        public ICollection<PhoneCodeModel> getPhoneCds()
        {
            ICollection<PhoneCodeModel> codeModels = new List<PhoneCodeModel>();

            PhoneCodeRepo repo = new PhoneCodeRepo();
            PhoneCD[] codes = repo.getAll();
            foreach (PhoneCD codeData in codes) {
                PhoneCodeModel codeModel = new PhoneCodeModel();
                codeModel.lastModifiedDate = codeData.MOD_DT;
                codeModel.phoneCode = codeData.PHONE_CD;
                codeModel.phoneCodeDescription = codeData.PHONE_TX;
                codeModels.Add(codeModel);
            }
            return codeModels;
        }
Пример #4
0
 public void addPhoneCd(PhoneCodeModel phoneCd)
 {
     PhoneCodeRepo repo = new PhoneCodeRepo();
     PhoneCD code = new PhoneCD();
     code.MOD_DT = DateTime.Now;
     code.PHONE_CD = phoneCd.phoneCode;
     code.PHONE_TX = phoneCd.phoneCodeDescription;
     try
     {
         repo.add(code);
     }
     catch (Exception e) {
         repo.update(code);
     }
     repo = null;
 }
Пример #5
0
 public void removePhoneCD(PhoneCodeModel phoneCd)
 {
     PhoneCodeRepo repo = new PhoneCodeRepo();
     repo.remove(repo.getById(new PhoneCD{PHONE_CD=phoneCd.phoneCode}));
     repo = null;
 }