public int getKindImagesFileCount(ClaimImageTypeModel type) { string prefix = ClaimImage.getImageKindPrefix(type); if (prefix.Length > 0) { var fileModel = Images.Where(i => i.File.Name.StartsWith(prefix)); if (fileModel != null) { return(fileModel.Count()); } } return(0); }
public string[] getPartyImageTitleAndFilenameInfo(ClaimImageTypeModel type) { string title = ClaimImage.getPartyImageKindTitle(type); string placeHolder = ClaimImage.getPartyImageKindPlaceHolder(type); string prefix = ClaimImage.getImageKindPrefix(type); var files = new List <FileViewModel>(); if (Images != null && Images.Count > 0 && prefix.Length > 0) { files = Images.Where(i => i.File.Name.StartsWith(prefix)).ToList(); } if (files.Count > 0) { placeHolder = files[0].File.Name; } return(new string[] { title, placeHolder }); }