Beispiel #1
0
        public HttpResponseMessage Search([FromUri] SearchCriteria criteria)
        {
            var response = default(HttpResponseMessage);

            Action <Dictionary <string, string>, string, string> addCriteria = (collection, key, value) =>
            {
                if (!string.IsNullOrEmpty(value))
                {
                    if (collection.ContainsKey(key))
                    {
                        collection[key] = value;
                    }
                    else
                    {
                        collection.Add(key, value);
                    }
                }
            };

            using (var engine = new P8CEUnderwriting())
            {
                var underwritingCriteria = new Dictionary <string, string>();

                addCriteria(underwritingCriteria, "uwPolicyID", criteria.PolicyId);
                addCriteria(underwritingCriteria, "uwDocType", criteria.DocumentType);

                var results = engine.SearchUnderwriting(underwritingCriteria);

                response = Request.CreateResponse(HttpStatusCode.OK, results);
            }

            return(response);
        }
Beispiel #2
0
        public HttpResponseMessage GetByPolicyId(string policyId)
        {
            var response = default(HttpResponseMessage);

            using (var engine = new P8CEUnderwriting())
            {
                var results = engine.SearchUnderwriting(new Dictionary <string, string>
                {
                    { "uwPolicyID", policyId }
                });

                response = Request.CreateResponse(HttpStatusCode.OK, results);
            }

            return(response);
        }