예제 #1
0
        public GetCollateralForObligorResponse GetCollateralForObligor(GetCollateralForObligorRequest request)
        {
            ClientContext ctx = GetClientContext(request.User, request.Password);

            string errors = null;
            string outputBlock = string.Empty;
            var getCollateralForDocIn = new LEADServicesContext.GetCollateralForObligorInDocument
            {
                LUW_BANK = request.BankId,
                LUW_BATCH_ID = request.BatchID,
                LUW_ERROR_MESSAGES = request.Errors,
                LUW_HEADER_RESTRICTIONS = request.Restrictions,
                LUW_ID = request.Luw,
                LUW_ITEM_NBR = request.ItemNumber,
                LUW_LENGTH = request.DataLength,
                LUW_OBLIGATION = request.ObligationNumber,
                LUW_OBLIGOR = request.ObligorNumber,
                LUW_REQUEST_CODE = request.RestartRequestCode,
                SEG_COUNTER = request.Segment
            };


            try
            {
                lead.GetCollateralForObligor(ref getCollateralForDocIn.LUW_ID,
                    ref getCollateralForDocIn.LUW_REQUEST_CODE,
                    ref getCollateralForDocIn.LUW_BATCH_ID,
                    ref getCollateralForDocIn.LUW_BANK,
                    ref getCollateralForDocIn.LUW_OBLIGOR,
                    ref getCollateralForDocIn.LUW_OBLIGATION,
                    ref getCollateralForDocIn.LUW_ITEM_NBR,
                    ref getCollateralForDocIn.SEG_COUNTER,
                    ref getCollateralForDocIn.LUW_HEADER_RESTRICTIONS,
                    ref getCollateralForDocIn.LUW_LENGTH,
                    ref errors,
                    out outputBlock,
                    ref ctx);
                //lead.GetCollateralForObligor(ref luw, ref restartRequestCode, ref batchID, ref bankId, ref ObligorNumber, ref ObligationNumber, ref itemNumber, ref segment, ref restrictions, ref dataLength, ref errors, out outputBlock, ref ctx);
                return new GetCollateralForObligorResponse() { OutputField = outputBlock, Errors = errors };

            }

            catch (Microsoft.HostIntegration.TI.CustomTIException Ex)
            {
                if (Ex.TIExceptionMsgId == Constants.HIS_META_DATA_ERROR)
                    Trace.WriteLine(String.Format("CICS program returned an error. \nTI Runtime Error MsgID={0} \nError description=\"{1}\"", Ex.TIExceptionMsgId, Ex.Message));
                else
                    Trace.WriteLine(String.Format("COMPASS Connection failed with TI Runtime Error MsgID {0}, description: \n{1}", Ex.TIExceptionMsgId, Ex.Message));

                return null;
            }
            catch (Exception ee)
            {
                string msg = ee.Message;
                throw;
            }


        }
예제 #2
0
        /// <summary>
        /// Gets the collateral for obligor.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns></returns>
        public GetCollateralForObligorResponse GetCollateralForObligor(GetCollateralForObligorRequest request)
        {
            ClientContext ctx = GetClientContext(request.User, request.Password);
            string errors = null;
            string outputBlock = string.Empty;
            int noOfRequery = 0;
            REQUEST_0189_FIELD outputField = new REQUEST_0189_FIELD { x189A_DESC = string.Empty, x189A_MODEL_DESC = string.Empty, x189A_OBLN_ITEM = string.Empty, x189A_TYPE = string.Empty };
            REQUEST_0189_FIELD[] outputs = new REQUEST_0189_FIELD[120];
            for (int i = 0; i < 120; i++)
            {
                outputs[i] = outputField;
            }
            var getCollateralForDocIn = new InquiryServicesContext.GetCollateralForObligorInDocument
            {
                LUW_BANK = request.BankId,
                LUW_BATCH_ID = request.BatchID,
                LUW_ERROR_MESSAGES = request.Errors,
                LUW_HEADER_RESTRICTIONS = Constants.LUW_HEADER_REST_CALL_APPL,
                LUW_ID = request.Luw,
                LUW_ITEM_NBR = request.ItemNumber,
                LUW_LENGTH = request.DataLength,
                LUW_OBLIGATION = request.ObligationNumber,
                LUW_OBLIGOR = request.ObligorNumber,
                LUW_REQUEST_CODE = request.RestartRequestCode,
                SEG_COUNTER = request.Segment
            };


            try
            {
                var collateralList = GetCollateralArrayForObligor(ref ctx, ref errors, ref outputs, getCollateralForDocIn);

                //Need to requery for more data if segcounter is populated
                bool isRequery = int.TryParse(getCollateralForDocIn.SEG_COUNTER, out noOfRequery);
                if (isRequery && noOfRequery > 0)
                {
                    //Concat the results
                    FastConcat<CollateralDetail> collateralObligorArray = new FastConcat<CollateralDetail>();
                    collateralObligorArray.Add(collateralList);

                    while (noOfRequery > 0)
                    {
                        //Set a new requery LUW ID
                        getCollateralForDocIn.LUW_ID = Constants.GET_COLL_OBLGR_REQUERY_LUW_ID;
                        var reQueryCollarteralList = GetCollateralArrayForObligor(ref ctx, ref errors, ref outputs, getCollateralForDocIn);

                        //Append requery collateral list to the concat list
                        collateralObligorArray.Add(reQueryCollarteralList);
                        isRequery = int.TryParse(getCollateralForDocIn.SEG_COUNTER, out noOfRequery);
                    }

                    return new GetCollateralForObligorResponse() { CollateralList = collateralObligorArray.ToList(), Errors = errors };

                }


                return new GetCollateralForObligorResponse() { CollateralList = collateralList.ToList(), Errors = errors };

            }

            catch (Microsoft.HostIntegration.TI.CustomTIException Ex)
            {
                return HandleHISException<GetCollateralForObligorResponse>(Ex, request, "GetCollateralForObligor");
            }
            catch (Exception ee)
            {
                string msg = ee.Message;
                throw;
            }

        }