public static SearchResultsBaseDto GetInstance(IDictionary<string, object> item)
        {
            // make sure this is a policy one
            if ((item["ContentType"] != null) && (item["ContentType"].ToString().ToLower().Equals("insured")))
            {
                var newItem = new SearchResultInsuredDto();

                newItem.InsuredName = (GetItemObject(item, "VALInsdNm") == null) ? null : item["VALInsdNm"].ToString();
                newItem.LastYear = (GetItemObject(item, "VALLastYear") == null) ? null : item["VALLastYear"].ToString();
                newItem.FirstYear = (GetItemObject(item, "VALFirstYear") == null) ? null : item["VALFirstYear"].ToString();
                newItem.LastYear = (GetItemObject(item, "VALLastLiveYear") == null) ? null : item["VALLastLiveYear"].ToString();
                newItem.FirstYear = (GetItemObject(item, "VALFirstLiveYear") == null) ? null : item["VALFirstLiveYear"].ToString();
                newItem.NoOfRisks = (GetItemObject(item, "VALNoOfRisks") == null)
                                  ? 0
                                  : Int32.Parse(item["VALNoOfRisks"].ToString());
                newItem.NoOfLiveRisks = (GetItemObject(item, "VALNoOfLiveRisks") == null)
                                  ? 0
                                  : Int32.Parse(item["VALNoOfLiveRisks"].ToString());
                newItem.NoOfOtherRisks = (GetItemObject(item, "VALNoOfOtherRisks") == null)
                                  ? 0
                                  : Int32.Parse(item["VALNoOfOtherRisks"].ToString());
                newItem.InsuredId = (GetItemObject(item, "VALInsdId") == null)
                                  ? 0
                                  : Int32.Parse(item["VALInsdId"].ToString());
                newItem.HitHightlightSummary = (GetItemObject(item, "HITHIGHLIGHTEDSUMMARY") == null)
                                           ? null
                                           : item["HITHIGHLIGHTEDSUMMARY"].ToString();
                newItem.View = _View;

                //Clickthrough
                newItem.pisearchresultid = (GetItemObject(item, "piSearchResultId") == null) ? null : item["piSearchResultId"].ToString();
                return string.IsNullOrEmpty(newItem.InsuredName) ? null : newItem;
            }
            return null;
        }
Пример #2
0
        public static SearchResultsBaseDto GetInstance(IDictionary <string, object> item)
        {
            // make sure this is a policy one
            if ((item["ContentType"] != null) && (item["ContentType"].ToString().ToLower().Equals("insured")))
            {
                var newItem = new SearchResultInsuredDto();

                newItem.InsuredName = (GetItemObject(item, "VALInsdNm") == null) ? null : item["VALInsdNm"].ToString();
                newItem.LastYear    = (GetItemObject(item, "VALLastYear") == null) ? null : item["VALLastYear"].ToString();
                newItem.FirstYear   = (GetItemObject(item, "VALFirstYear") == null) ? null : item["VALFirstYear"].ToString();
                newItem.LastYear    = (GetItemObject(item, "VALLastLiveYear") == null) ? null : item["VALLastLiveYear"].ToString();
                newItem.FirstYear   = (GetItemObject(item, "VALFirstLiveYear") == null) ? null : item["VALFirstLiveYear"].ToString();
                newItem.NoOfRisks   = (GetItemObject(item, "VALNoOfRisks") == null)
                                  ? 0
                                  : Int32.Parse(item["VALNoOfRisks"].ToString());
                newItem.NoOfLiveRisks = (GetItemObject(item, "VALNoOfLiveRisks") == null)
                                  ? 0
                                  : Int32.Parse(item["VALNoOfLiveRisks"].ToString());
                newItem.NoOfOtherRisks = (GetItemObject(item, "VALNoOfOtherRisks") == null)
                                  ? 0
                                  : Int32.Parse(item["VALNoOfOtherRisks"].ToString());
                newItem.InsuredId = (GetItemObject(item, "VALInsdId") == null)
                                  ? 0
                                  : Int32.Parse(item["VALInsdId"].ToString());
                newItem.HitHightlightSummary = (GetItemObject(item, "HITHIGHLIGHTEDSUMMARY") == null)
                                           ? null
                                           : item["HITHIGHLIGHTEDSUMMARY"].ToString();
                newItem.View = _View;

                //Clickthrough
                newItem.pisearchresultid = (GetItemObject(item, "piSearchResultId") == null) ? null : item["piSearchResultId"].ToString();
                return(string.IsNullOrEmpty(newItem.InsuredName) ? null : newItem);
            }
            return(null);
        }