Beispiel #1
0
        private void ValidateDetail(LicenseFileDetail detail)
        {
            //if (detail.GetBrokenRules().Count() > 0)
            //{
            StringBuilder messageError = new StringBuilder("");

            foreach (BusinessRule item in detail.GetBrokenRules())
            {
                messageError.Append(item.Rule + "<br />");
            }
            detail.ERR_MSG = messageError.ToString();
            if (string.IsNullOrEmpty(detail.ERR_MSG))
            {
                detail.LOAD_STATUS = "T";
            }
            else
            {
                detail.LOAD_STATUS = "F";
            }



            //}
            //else
            //{

            //}
        }
Beispiel #2
0
        public static DTO.ResponseService <LicenseFileHeader> ConcreateLicenseRequest(IAS.DAL.Interfaces.IIASPersonEntities ctx, DTO.DataLicenseRequest request)
        {
            DTO.ResponseService <LicenseFileHeader> response = new DTO.ResponseService <LicenseFileHeader>();

            DTO.ResponseService <DTO.CompressFileDetail> resCompress = ExtractFileLicenseRequestHelper.ExtractFile(request.FileName);
            if (resCompress.IsError)
            {
                response.ErrorMsg = resCompress.ErrorMsg;
                return(response);
            }

            DTO.ResponseService <DTO.UploadData> resData = DataLicenseRequestReaderHelper.ReadDataFromFile(resCompress.DataResponse.TextFilePath);
            if (resData.IsError)
            {
                response.ErrorMsg = resData.ErrorMsg;
                return(response);
            }

            LicenseFileHeader header = new LicenseFileHeader(ctx, request.UserProfile, resCompress.DataResponse.TextFilePath, request.PettitionTypeCode, request.LicenseTypeCode);
            Int32             row    = 0;

            header.replaceType = request.ReplaceType;
            CreateLicenseFileHeader(ctx, header, resData.DataResponse.Header, resCompress.DataResponse, request.ApproveCom);

            foreach (String record in resData.DataResponse.Body)
            {
                row++;
                LicenseFileDetail detail = CreateLicenseFileDetail(ctx, record, row);

                header.AddDetail(detail, request.ReplaceType);
            }
            response.DataResponse = header;

            return(response);
        }
Beispiel #3
0
        public void AddDetail(AG_IAS_IMPORT_DETAIL_TEMP detial)
        {
            LicenseFileDetail detail_A = detial as LicenseFileDetail;

            detail_A.SetHeader(this);
            detail_A.IMPORT_ID     = this.IMPORT_ID;
            detail_A.PETITION_TYPE = this.PETTITION_TYPE;
            detail_A.PetitionTypeR = this.PetitionTypeR;
            detail_A.COMP_CODE     = this.COMP_CODE;

            ValidateDetail(detail_A);
            _licenseFileDetails.Add(detail_A);
        }
Beispiel #4
0
        public void AddDetail(LicenseFileDetail detail, string replateType)
        {
            detail.SetHeader(this);
            detail.IMPORT_ID     = this.IMPORT_ID;
            detail.PETITION_TYPE = this.PETTITION_TYPE;
            detail.PetitionTypeR = this.PetitionTypeR;
            detail.COMP_CODE     = this.COMP_CODE;
            detail.replaceType   = replaceType;
            IEnumerable <AttachFileDetail> attachFiles = CompressFileDetail.AttatchFiles
                                                         .Where(a => a.FileName.Contains(detail.CITIZEN_ID));

            detail.AddAttachFileDetail(attachFiles);

            _licenseFileDetails.Add(detail);
            ValidateDetail(detail);
        }
Beispiel #5
0
        private static LicenseFileDetail CreateLicenseFileDetail(IAS.DAL.Interfaces.IIASPersonEntities ctx, String rawData, Int32 rownum)
        {
            //IMPORT_ID = recHead.IMPORT_ID,
            //COMP_CODE = recHead.COMP_CODE,
            //ERR_MSG = errMsg,
            //PETITION_TYPE = petitionTypeCode,
            string[]          rowDatas = rawData.Split(',');
            Int32             seq      = Convert.ToInt32(rowDatas[0]);
            LicenseFileDetail detail   = new LicenseFileDetail(ctx)
            {
                Sequence            = seq.ToString("0000"),
                SEQ                 = rownum.ToString("0000"),                        // seq.ToString("0000"),
                LICENSE_NO          = rowDatas[1],
                LICENSE_ACTIVE_DATE = LicenseFileHelper.PhaseToDateNull(rowDatas[2]), // issueDate,
                LICENSE_EXPIRE_DATE = LicenseFileHelper.PhaseToDateNull(rowDatas[3]), // expireDate,
                LICENSE_FEE         = LicenseFileHelper.PhaseToMoney(rowDatas[4]),
                CITIZEN_ID          = GetDataField(rowDatas, 5),
                TITLE_NAME          = GetDataField(rowDatas, 6),
                NAME                = GetDataField(rowDatas, 7),
                SURNAME             = GetDataField(rowDatas, 8),
                ADDR1               = GetDataField(rowDatas, 9),
                ADDR2               = GetDataField(rowDatas, 10),
                AREA_CODE           = GetDataField(rowDatas, 11),
                EMAIL               = GetDataField(rowDatas, 12),
                CUR_ADDR            = GetDataField(rowDatas, 13),
                TEL_NO              = GetDataField(rowDatas, 14),
                CUR_AREA_CODE       = GetDataField(rowDatas, 15),
                AR_ANSWER           = LicenseFileHelper.PhaseARDate(GetDataField(rowDatas, 16)),
                OLD_COMP_CODE       = GetDataField(rowDatas, 17),
                SPECIAL_TYPE_CODE   = GetDataField(rowDatas, 18),
                START_DATE          = LicenseFileHelper.PhaseStartDate(GetDataField(rowDatas, 19))
            };


            return(detail);
        }