Exemple #1
0
        public void ApplicantFileDetail_Can_Read_Text_To_Object()
        {
            ApplicantFileHeader applicantHeader = CreateHeader();

            String[] data = _lines.FirstOrDefault().Split(',');

            ApplicantFileDetail detial = new ApplicantFileDetail(ctx)
            {
                LOAD_STATUS     = "",
                APPLICANT_CODE  = PhaseAppliantCodeHelper.Phase(data.GetIndexOf(0)),
                ID_CARD_NO      = data.GetIndexOf(1),
                PRE_NAME_CODE   = PreNameHelper.ConvertToCode(ctx, data.GetIndexOf(2)),
                NAMES           = data.GetIndexOf(3),
                LASTNAME        = data.GetIndexOf(4),
                BIRTH_DATE      = PhaseDateHelper.PhaseToDateNull(data.GetIndexOf(5)),
                SEX             = data.GetIndexOf(6),
                EDUCATION_CODE  = data.GetIndexOf(7),
                ADDRESS1        = data.GetIndexOf(9),
                AREA_CODE       = data.GetIndexOf(10),
                INSUR_COMP_CODE = data.GetIndexOf(8),
                TITLE           = data.GetIndexOf(2)
            };
        }
        private static ApplicantFileDetail CreateApplicantFileDetail(IAS.DAL.Interfaces.IIASPersonEntities ctx, String rawData, Int32 rownum)
        {
            String[] data = rawData.Split(',');

            ApplicantFileDetail detail = new ApplicantFileDetail(ctx)
            {
                SEQ_NO          = rownum.ToString("0000"),
                LOAD_STATUS     = "",
                APPLICANT_CODE  = PhaseAppliantCodeHelper.Phase(data.GetIndexOf(0)),
                ID_CARD_NO      = data.GetIndexOf(1),
                PRE_NAME_CODE   = PreNameHelper.ConvertToCode(ctx, data.GetIndexOf(2)),
                NAMES           = data.GetIndexOf(3),
                LASTNAME        = data.GetIndexOf(4),
                BIRTH_DATE      = PhaseDateHelper.PhaseToDateNull(data.GetIndexOf(5)),
                SEX             = PhaseSex(data.GetIndexOf(6)),
                EDUCATION_CODE  = EducationCodeHelper.Phase(data.GetIndexOf(7)),
                ADDRESS1        = data.GetIndexOf(9),
                AREA_CODE       = data.GetIndexOf(10),
                INSUR_COMP_CODE = data.GetIndexOf(8),
                TITLE           = data.GetIndexOf(2),
            };

            return(detail);
        }