private string GetPath(string[] splitObjectIds, int i, AttachmentEntityType attachmentEntityType) { if (i < 0) { throw new UserFriendlyException(L("InvalidObjectIdCode"), L("InvalidObjectIdCode_Detail")); } if (attachmentEntityType == null) { throw new UserFriendlyException(L("NotHaveAttachmentEntityTypeCode"), L("NotHaveAttachmentEntityTypeCode_Detail")); } var ObjectId = splitObjectIds[i]; if (i == 0 && attachmentEntityType != null) { return(attachmentEntityType.Folder + "/" + ObjectId); } else { return(GetPath(splitObjectIds, --i, attachmentEntityType.ParentTypeFk) + attachmentEntityType.Folder + "/" + ObjectId); } }
private string GetAttachmentPath(string ObjectIds, AttachmentEntityType attachmentEntityType) { var splitObjectIds = ObjectIds.Split('.'); return(GetPath(splitObjectIds, splitObjectIds.Length - 1, attachmentEntityType)); }