private string AllocateClaimDetailReference(ClaimDetail claimDetail, ProductXML.ProductClaimDetail productClaimDetail, ref bool isClaimDetailDefaulted) { try { if (productClaimDetail != null) { int clmDetRef = 0; var num = claimDetail.ClaimHeader.ClaimDetails.Max(c => int.TryParse(c.ClaimDetailReference, out clmDetRef) == false? 0 : clmDetRef); claimDetail.ClaimDetailReference = (num + 1).ToString(); isClaimDetailDefaulted = true; } } catch { //// do nothing no need for showing any messages. } return claimDetail.ClaimDetailReference; }
private bool ChkIfEventExists(ClaimHeader clmHeader,ProductXML.ProductEvent productEvent) { bool EventExists = false; var result = from cEvent in clmHeader.Events where cEvent.IsNew == true && productEvent.ProductEventID == cEvent.ProductEventID select cEvent; if (result.Count() > 0) { EventExists = true; } return EventExists; }