{"action":"created","comment":{"url":"https://api.github.com/repos/ucdavis/GiftModels/pulls/comments/37658333","id":37658333,"diff_hunk":"@@ -52,22 +49,66 @@ public string PremiumChart\n         ///This is the KFS Account number used to credit the back the premium amount. \r\n         /// </summary>\r\n         private string _premiumAccount;\r\n+\r\n         public string PremiumAccount\r\n         {\r\n             get\r\n             {\r\n                 if (string.IsNullOrWhiteSpace(_premiumAccount) && string.IsNullOrWhiteSpace(Xcomment))\r\n                     return null;\r\n-                if (string.IsNullOrWhiteSpace(_premiumAccount) && Xcomment.Contains(\"-\"))\r\n-                    return Xcomment.Substring(Xcomment.IndexOf('-') + 1);\r\n+                if (string.IsNullOrWhiteSpace(_premiumAccount))\r\n+                    InitAccounDetails();\r\n+\r\n                 return _premiumAccount;\r\n             }\r\n             set { _premiumAccount = value; }\r\n         }\r\n \r\n         /// <summary>\r\n+        ///This is the KFS Sub-account number used to credit the back the premium amount. \r\n+        /// </summary>\r\n+        private string _premiumSubAccount;\r\n+\r\n+        public string PremiumSubAccount\r\n+        {\r\n+            get\r\n+            {\r\n+                if (string.IsNullOrWhiteSpace(_premiumSubAccount) && string.IsNullOrWhiteSpace(Xcomment))\r\n+                    return null;\r\n+                if (string.IsNullOrWhiteSpace(_premiumAccount))\r\n+                    InitAccounDetails();\r\n+\r\n+                return _premiumSubAccount;\r\n+            }\r\n+            set { _premiumSubAccount = value; }\r\n+        }\r\n+\r\n+        /// <summary>\r\n         /// This field is defaulted from the tms_premium table (W3). It is the monetary value associated with this premium. This value is normally the same amount as the value in the tms_premium table. \r\n         /// </summary>\r\n         public decimal PremiumAmount { get; set; }\r\n+\r\n+        /// <summary>\r\n+        /// Parse out the KFS chart, Account, and Sub-account (if present) from the XComment field. \r\n+        /// </summary>\r\n+        private void InitAccounDetails()\r\n+        {\r\n+            const string sPattern = @\"\\[\\[(\\w)-(\\w{5,7})-?(\\w{5})?\\]\\]\";\r\n+            var result = System.Text.RegularExpressions.Regex.Match(Xcomment, sPattern);\r\n+\r\n+            if (result.Groups[1].Length > 0 && result.Groups[1].ToString().Length > 0)\r","path":"GiftModels/PremiumDetails.cs","position":75,"original_position":75,"commit_id":"9c49786633bf7549c0727edb1bd1e1ab1275d3ee","original_commit_id":"9c49786633bf7549c0727edb1bd1e1ab1275d3ee","user":{"login":"jpknoll","id":214330,"avatar_url":"https://avatars.githubusercontent.com/u/214330?v=3","gravatar_id":"","url":"https://api.github.com/users/jpknoll","html_url":"https://github.com/jpknoll","followers_url":"https://api.github.com/users/jpknoll/followers","following_url":"https://api.github.com/users/jpknoll/following{/other_user}","gists_url":"https://api.github.com/users/jpknoll/gists{/gist_id}","starred_url":"https://api.github.com/users/jpknoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpknoll/subscriptions","organizations_url":"https://api.github.com/users/jpknoll/orgs","repos_url":"https://api.github.com/users/jpknoll/repos","events_url":"https://api.github.com/users/jpknoll/events{/privacy}","received_events_url":"https://api.github.com/users/jpknoll/received_events","type":"User","site_admin":false},"body":"@taylorkj Not exactly sure what this if statement is checking for. You might check that Group[0].ToString() isn't empty. ","created_at":"2015-08-21T17:42:33Z","updated_at":"2015-08-21T17:42:33Z","html_url":"https://github.com/ucdavis/GiftModels/pull/39#discussion_r37658333","pull_request_url":"https://api.github.com/repos/ucdavis/GiftModels/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/ucdavis/GiftModels/pulls/comments/37658333"},"html":{"href":"https://github.com/ucdavis/GiftModels/pull/39#discussion_r37658333"},"pull_request":{"href":"https://api.github.com/repos/ucdavis/GiftModels/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/ucdavis/GiftModels/pulls/39","id":43062141,"html_url":"https://github.com/ucdavis/GiftModels/pull/39","diff_url":"https://github.com/ucdavis/GiftModels/pull/39.diff","patch_url":"https://github.com/ucdavis/GiftModels/pull/39.patch","issue_url":"https://api.github.com/repos/ucdavis/GiftModels/issues/39","number":39,"state":"open","locked":false,"title":"Changes to facilitate pulling the KFS Account information out of the Xcomment field.","user":{"login":"taylorkj","id":583137,"avatar_url":"https://avatars.githubusercontent.com/u/583137?v=3","gravatar_id":"","url":"https://api.github.com/users/taylorkj","html_url":"https://github.com/taylorkj","followers_url":"https://api.github.com/users/taylorkj/followers","following_url":"https://api.github.com/users/taylorkj/following{/other_user}","gists_url":"https://api.github.com/users/taylorkj/gists{/gist_id}","starred_url":"https://api.github.com/users/taylorkj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taylorkj/subscriptions","organizations_url":"https://api.github.com/users/taylorkj/orgs","repos_url":"https://api.github.com/users/taylorkj/repos","events_url":"https://api.github.com/users/taylorkj/events{/privacy}","received_events_url":"https://api.github.com/users/taylorkj/received_events","type":"User","site_admin":false},"body":"@srkirkland ; @jpknoll ; @jSylvestre:\r\nThis will work.  Note that there will ALWAYS be a result.Groups array consisting of 4 elements because of the way the regex was defined; therefore, it is not necessary to do an Any() check; however, the length of the elements at pos'n 1 and 2 need to be checked to verify they are not blank.","created_at":"2015-08-21T17:39:19Z","updated_at":"2015-08-21T17:42:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fa4fba9bd1e209e7139905b3f5b81a1789a66a1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ucdavis/GiftModels/pulls/39/commits","review_comments_url":"https://api.github.com/repos/ucdavis/GiftModels/pulls/39/comments","review_comment_url":"https://api.github.com/repos/ucdavis/GiftModels/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ucdavis/GiftModels/issues/39/comments","statuses_url":"https://api.github.com/repos/ucdavis/GiftModels/statuses/9c49786633bf7549c0727edb1bd1e1ab1275d3ee","head":{"label":"ucdavis:kjt/PremiumAccountPremiumChartGetters","ref":"kjt/PremiumAccountPremiumChartGetters","sha":"9c49786633bf7549c0727edb1bd1e1ab1275d3ee","user":{"login":"ucdavis","id":573450,"avatar_url":"https://avatars.githubusercontent.com/u/573450?v=3","gravatar_id":"","url":"https://api.github.com/users/ucdavis","html_url":"https://github.com/ucdavis","followers_url":"https://api.github.com/users/ucdavis/followers","following_url":"https://api.github.com/users/ucdavis/following{/other_user}","gists_url":"https://api.github.com/users/ucdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/ucdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ucdavis/subscriptions","organizations_url":"https://api.github.com/users/ucdavis/orgs","repos_url":"https://api.github.com/users/ucdavis/repos","events_url":"https://api.github.com/users/ucdavis/events{/privacy}","received_events_url":"https://api.github.com/users/ucdavis/received_events","type":"Organization","site_admin":false},"repo":{"id":24423170,"name":"GiftModels","full_name":"ucdavis/GiftModels","owner":{"login":"ucdavis","id":573450,"avatar_url":"https://avatars.githubusercontent.com/u/573450?v=3","gravatar_id":"","url":"https://api.github.com/users/ucdavis","html_url":"https://github.com/ucdavis","followers_url":"https://api.github.com/users/ucdavis/followers","following_url":"https://api.github.com/users/ucdavis/following{/other_user}","gists_url":"https://api.github.com/users/ucdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/ucdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ucdavis/subscriptions","organizations_url":"https://api.github.com/users/ucdavis/orgs","repos_url":"https://api.github.com/users/ucdavis/repos","events_url":"https://api.github.com/users/ucdavis/events{/privacy}","received_events_url":"https://api.github.com/users/ucdavis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ucdavis/GiftModels","description":"Shared Models for projects related to gifts & giving","fork":false,"url":"https://api.github.com/repos/ucdavis/GiftModels","forks_url":"https://api.github.com/repos/ucdavis/GiftModels/forks","keys_url":"https://api.github.com/repos/ucdavis/GiftModels/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ucdavis/GiftModels/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ucdavis/GiftModels/teams","hooks_url":"https://api.github.com/repos/ucdavis/GiftModels/hooks","issue_events_url":"https://api.github.com/repos/ucdavis/GiftModels/issues/events{/number}","events_url":"https://api.github.com/repos/ucdavis/GiftModels/events","assignees_url":"https://api.github.com/repos/ucdavis/GiftModels/assignees{/user}","branches_url":"https://api.github.com/repos/ucdavis/GiftModels/branches{/branch}","tags_url":"https://api.github.com/repos/ucdavis/GiftModels/tags","blobs_url":"https://api.github.com/repos/ucdavis/GiftModels/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ucdavis/GiftModels/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ucdavis/GiftModels/git/refs{/sha}","trees_url":"https://api.github.com/repos/ucdavis/GiftModels/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ucdavis/GiftModels/statuses/{sha}","languages_url":"https://api.github.com/repos/ucdavis/GiftModels/languages","stargazers_url":"https://api.github.com/repos/ucdavis/GiftModels/stargazers","contributors_url":"https://api.github.com/repos/ucdavis/GiftModels/contributors","subscribers_url":"https://api.github.com/repos/ucdavis/GiftModels/subscribers","subscription_url":"https://api.github.com/repos/ucdavis/GiftModels/subscription","commits_url":"https://api.github.com/repos/ucdavis/GiftModels/commits{/sha}","git_commits_url":"https://api.github.com/repos/ucdavis/GiftModels/git/commits{/sha}","comments_url":"https://api.github.com/repos/ucdavis/GiftModels/comments{/number}","issue_comment_url":"https://api.github.com/repos/ucdavis/GiftModels/issues/comments{/number}","contents_url":"https://api.github.com/repos/ucdavis/GiftModels/contents/{+path}","compare_url":"https://api.github.com/repos/ucdavis/GiftModels/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ucdavis/GiftModels/merges","archive_url":"https://api.github.com/repos/ucdavis/GiftModels/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ucdavis/GiftModels/downloads","issues_url":"https://api.github.com/repos/ucdavis/GiftModels/issues{/number}","pulls_url":"https://api.github.com/repos/ucdavis/GiftModels/pulls{/number}","milestones_url":"https://api.github.com/repos/ucdavis/GiftModels/milestones{/number}","notifications_url":"https://api.github.com/repos/ucdavis/GiftModels/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ucdavis/GiftModels/labels{/name}","releases_url":"https://api.github.com/repos/ucdavis/GiftModels/releases{/id}","created_at":"2014-09-24T16:35:28Z","updated_at":"2015-05-06T18:17:56Z","pushed_at":"2015-08-21T17:39:19Z","git_url":"git://github.com/ucdavis/GiftModels.git","ssh_url":"git@github.com:ucdavis/GiftModels.git","clone_url":"https://github.com/ucdavis/GiftModels.git","svn_url":"https://github.com/ucdavis/GiftModels","homepage":null,"size":652,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ucdavis:master","ref":"master","sha":"8c70152ca98c779690becc714400fa1f78b1f610","user":{"login":"ucdavis","id":573450,"avatar_url":"https://avatars.githubusercontent.com/u/573450?v=3","gravatar_id":"","url":"https://api.github.com/users/ucdavis","html_url":"https://github.com/ucdavis","followers_url":"https://api.github.com/users/ucdavis/followers","following_url":"https://api.github.com/users/ucdavis/following{/other_user}","gists_url":"https://api.github.com/users/ucdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/ucdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ucdavis/subscriptions","organizations_url":"https://api.github.com/users/ucdavis/orgs","repos_url":"https://api.github.com/users/ucdavis/repos","events_url":"https://api.github.com/users/ucdavis/events{/privacy}","received_events_url":"https://api.github.com/users/ucdavis/received_events","type":"Organization","site_admin":false},"repo":{"id":24423170,"name":"GiftModels","full_name":"ucdavis/GiftModels","owner":{"login":"ucdavis","id":573450,"avatar_url":"https://avatars.githubusercontent.com/u/573450?v=3","gravatar_id":"","url":"https://api.github.com/users/ucdavis","html_url":"https://github.com/ucdavis","followers_url":"https://api.github.com/users/ucdavis/followers","following_url":"https://api.github.com/users/ucdavis/following{/other_user}","gists_url":"https://api.github.com/users/ucdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/ucdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ucdavis/subscriptions","organizations_url":"https://api.github.com/users/ucdavis/orgs","repos_url":"https://api.github.com/users/ucdavis/repos","events_url":"https://api.github.com/users/ucdavis/events{/privacy}","received_events_url":"https://api.github.com/users/ucdavis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ucdavis/GiftModels","description":"Shared Models for projects related to gifts & giving","fork":false,"url":"https://api.github.com/repos/ucdavis/GiftModels","forks_url":"https://api.github.com/repos/ucdavis/GiftModels/forks","keys_url":"https://api.github.com/repos/ucdavis/GiftModels/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ucdavis/GiftModels/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ucdavis/GiftModels/teams","hooks_url":"https://api.github.com/repos/ucdavis/GiftModels/hooks","issue_events_url":"https://api.github.com/repos/ucdavis/GiftModels/issues/events{/number}","events_url":"https://api.github.com/repos/ucdavis/GiftModels/events","assignees_url":"https://api.github.com/repos/ucdavis/GiftModels/assignees{/user}","branches_url":"https://api.github.com/repos/ucdavis/GiftModels/branches{/branch}","tags_url":"https://api.github.com/repos/ucdavis/GiftModels/tags","blobs_url":"https://api.github.com/repos/ucdavis/GiftModels/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ucdavis/GiftModels/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ucdavis/GiftModels/git/refs{/sha}","trees_url":"https://api.github.com/repos/ucdavis/GiftModels/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ucdavis/GiftModels/statuses/{sha}","languages_url":"https://api.github.com/repos/ucdavis/GiftModels/languages","stargazers_url":"https://api.github.com/repos/ucdavis/GiftModels/stargazers","contributors_url":"https://api.github.com/repos/ucdavis/GiftModels/contributors","subscribers_url":"https://api.github.com/repos/ucdavis/GiftModels/subscribers","subscription_url":"https://api.github.com/repos/ucdavis/GiftModels/subscription","commits_url":"https://api.github.com/repos/ucdavis/GiftModels/commits{/sha}","git_commits_url":"https://api.github.com/repos/ucdavis/GiftModels/git/commits{/sha}","comments_url":"https://api.github.com/repos/ucdavis/GiftModels/comments{/number}","issue_comment_url":"https://api.github.com/repos/ucdavis/GiftModels/issues/comments{/number}","contents_url":"https://api.github.com/repos/ucdavis/GiftModels/contents/{+path}","compare_url":"https://api.github.com/repos/ucdavis/GiftModels/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ucdavis/GiftModels/merges","archive_url":"https://api.github.com/repos/ucdavis/GiftModels/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ucdavis/GiftModels/downloads","issues_url":"https://api.github.com/repos/ucdavis/GiftModels/issues{/number}","pulls_url":"https://api.github.com/repos/ucdavis/GiftModels/pulls{/number}","milestones_url":"https://api.github.com/repos/ucdavis/GiftModels/milestones{/number}","notifications_url":"https://api.github.com/repos/ucdavis/GiftModels/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ucdavis/GiftModels/labels{/name}","releases_url":"https://api.github.com/repos/ucdavis/GiftModels/releases{/id}","created_at":"2014-09-24T16:35:28Z","updated_at":"2015-05-06T18:17:56Z","pushed_at":"2015-08-21T17:39:19Z","git_url":"git://github.com/ucdavis/GiftModels.git","ssh_url":"git@github.com:ucdavis/GiftModels.git","clone_url":"https://github.com/ucdavis/GiftModels.git","svn_url":"https://github.com/ucdavis/GiftModels","homepage":null,"size":652,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ucdavis/GiftModels/pulls/39"},"html":{"href":"https://github.com/ucdavis/GiftModels/pull/39"},"issue":{"href":"https://api.github.com/repos/ucdavis/GiftModels/issues/39"},"comments":{"href":"https://api.github.com/repos/ucdavis/GiftModels/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/ucdavis/GiftModels/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/ucdavis/GiftModels/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ucdavis/GiftModels/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/ucdavis/GiftModels/statuses/9c49786633bf7549c0727edb1bd1e1ab1275d3ee"}}}}