GitHub PullRequestReviewCommentEvent at 2014-10-27 00:11:21
Repository: a14-in-time
Actor: olafleur
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/comments/19385253","id":19385253,"diff_hunk":"@@ -0,0 +1,119 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Web;\n+using System.Web.Mvc;\n+using InTime.Models;\n+using System.Data.SqlClient;\n+using System.Configuration;\n+using System.Data;\n+\n+namespace InTime.Models\n+{\n+    public static class RequeteSql\n+    {\n+        //public const string connectionString = @\"Data Source=EQUIPE-02\\SQLEXPRESS;Initial Catalog=InTime;Integrated Security=True\";\n+        //public const string connectionString = @\"Data Source=.\\SQLEXPRESS;Initial Catalog=EQUIPE-2;Integrated Security=True\";\n+        public const string connectionString = @\"Data Source=.\\SQLEXPRESS;Initial Catalog=EQUIPE-02;Integrated Security=True\";\n+\n+        public static SqlConnection ConnexionBD(SqlConnection con)\n+        {\n+            con = new SqlConnection(connectionString);\n+            con.Open();\n+\n+            return con;\n+        }\n+\n+        public static int RechercheID(SqlConnection con,string NomUtilisateur)\n+        {\n+            string SqlrId = string.Format(\"SELECT * FROM UserProfile where UserName='{0}'\", NomUtilisateur);\n+            SqlCommand cmdId = new SqlCommand(SqlrId, con);\n+            int id = (Int32)cmdId.ExecuteScalar();\n+            return id;\n+        }\n+\n+        public static SqlDataReader Select (string Query)\n+        {\n+            SqlConnection con = null;\n+            try\n+            {\n+                con = RequeteSql.ConnexionBD(con);\n+                SqlCommand cmdQuery = new SqlCommand(Query, con);\n+                SqlDataReader reader = cmdQuery.ExecuteReader();\n+                return reader;\n+            }\n+            catch (Exception ex)\n+            {\n+                throw new Exception(ex.ToString());\n+            }\n+            finally\n+            {\n+                if (con!= null)\n+                    con.Close();\n+            }\n+        }\n+\n+        public static bool ExecuteQuery(string Query)\n+        {\n+            SqlConnection con = null;\n+            try\n+            {\n+                con = RequeteSql.ConnexionBD(con);\n+                SqlCommand cmd = new SqlCommand(Query, con);\n+                cmd.ExecuteNonQuery();\n+\n+                return true;\n+            }\n+            catch (Exception ex)\n+            {\n+                return false;\n+            }\n+            finally\n+            {\n+                if (con != null)\n+                    con.Close();\n+            }\n+        }\n+\n+        public static string EnleverApostrophe(string texte)\n+        {\n+            string Text = \"\";\n+            foreach (char ch in texte)\n+            {\n+                //Regarde pour les apostrophe\n+                if (ch == 39)\n+                {\n+\n+                    Text += Convert.ToChar(34);","path":"InTime/Models/RequeteSql.cs","position":87,"original_position":87,"commit_id":"b72a15cf7fab795155dfbe5237310e9734530014","original_commit_id":"b72a15cf7fab795155dfbe5237310e9734530014","user":{"login":"olafleur","id":1068290,"avatar_url":"https://avatars.githubusercontent.com/u/1068290?v=2","gravatar_id":"","url":"https://api.github.com/users/olafleur","html_url":"https://github.com/olafleur","followers_url":"https://api.github.com/users/olafleur/followers","following_url":"https://api.github.com/users/olafleur/following{/other_user}","gists_url":"https://api.github.com/users/olafleur/gists{/gist_id}","starred_url":"https://api.github.com/users/olafleur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olafleur/subscriptions","organizations_url":"https://api.github.com/users/olafleur/orgs","repos_url":"https://api.github.com/users/olafleur/repos","events_url":"https://api.github.com/users/olafleur/events{/privacy}","received_events_url":"https://api.github.com/users/olafleur/received_events","type":"User","site_admin":false},"body":"idem pour 34","created_at":"2014-10-27T00:11:21Z","updated_at":"2014-10-27T00:11:21Z","html_url":"https://github.com/dinfcll/a14-in-time/pull/10#discussion_r19385253","pull_request_url":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/comments/19385253"},"html":{"href":"https://github.com/dinfcll/a14-in-time/pull/10#discussion_r19385253"},"pull_request":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/10","id":23353582,"html_url":"https://github.com/dinfcll/a14-in-time/pull/10","diff_url":"https://github.com/dinfcll/a14-in-time/pull/10.diff","patch_url":"https://github.com/dinfcll/a14-in-time/pull/10.patch","issue_url":"https://api.github.com/repos/dinfcll/a14-in-time/issues/10","number":10,"state":"open","locked":false,"title":"Mg_modification_profile","user":{"login":"xxxnemesis4xxx","id":8545751,"avatar_url":"https://avatars.githubusercontent.com/u/8545751?v=2","gravatar_id":"","url":"https://api.github.com/users/xxxnemesis4xxx","html_url":"https://github.com/xxxnemesis4xxx","followers_url":"https://api.github.com/users/xxxnemesis4xxx/followers","following_url":"https://api.github.com/users/xxxnemesis4xxx/following{/other_user}","gists_url":"https://api.github.com/users/xxxnemesis4xxx/gists{/gist_id}","starred_url":"https://api.github.com/users/xxxnemesis4xxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxxnemesis4xxx/subscriptions","organizations_url":"https://api.github.com/users/xxxnemesis4xxx/orgs","repos_url":"https://api.github.com/users/xxxnemesis4xxx/repos","events_url":"https://api.github.com/users/xxxnemesis4xxx/events{/privacy}","received_events_url":"https://api.github.com/users/xxxnemesis4xxx/received_events","type":"User","site_admin":false},"body":"J'ai fait plusieurs petites modifications au projet qui ne sont pas en relation directe avec Modification profile. Vous allez constater l'apparition de class avec des méthodes statiques dans laquelle j'ai placé des fonctions qui sont utilisées dans plusieurs contrôleurs. J'ai décidé de rassembler les méthodes dans des classes qui représentent leurs fonctionnalités. De plus, j'ai rajouté une classe cookie qui s'occupe de mettre en mémoire l'id de l'utilisateur. Donc, on n'est plus obligé de faire à chaque fois une requête sur la base de données pour obtenir l'id de l'utilisateur.\r\n\r\n*** J'ai commencé a changer les private void en private bool pour les validations. Pour l'instant, s'il y a une erreur lors des interactions avec la base de données, il y aura un arrêt du serveur. Cependant, il restera simplement a implémenter des mesures de sécurité pour que le serveur ne plante pas si une erreur se produit au lieu de simplement throw une exception qu'on ne traite pas ***\r\n","created_at":"2014-10-26T17:30:52Z","updated_at":"2014-10-27T00:11:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"faaa7354b03214d2e70cd7c82ef08f1d02a4347b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/10/commits","review_comments_url":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/10/comments","review_comment_url":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dinfcll/a14-in-time/issues/10/comments","statuses_url":"https://api.github.com/repos/dinfcll/a14-in-time/statuses/b72a15cf7fab795155dfbe5237310e9734530014","head":{"label":"dinfcll:mg_ModificationProfile","ref":"mg_ModificationProfile","sha":"b72a15cf7fab795155dfbe5237310e9734530014","user":{"login":"dinfcll","id":7976447,"avatar_url":"https://avatars.githubusercontent.com/u/7976447?v=2","gravatar_id":"","url":"https://api.github.com/users/dinfcll","html_url":"https://github.com/dinfcll","followers_url":"https://api.github.com/users/dinfcll/followers","following_url":"https://api.github.com/users/dinfcll/following{/other_user}","gists_url":"https://api.github.com/users/dinfcll/gists{/gist_id}","starred_url":"https://api.github.com/users/dinfcll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinfcll/subscriptions","organizations_url":"https://api.github.com/users/dinfcll/orgs","repos_url":"https://api.github.com/users/dinfcll/repos","events_url":"https://api.github.com/users/dinfcll/events{/privacy}","received_events_url":"https://api.github.com/users/dinfcll/received_events","type":"Organization","site_admin":false},"repo":{"id":23471303,"name":"a14-in-time","full_name":"dinfcll/a14-in-time","owner":{"login":"dinfcll","id":7976447,"avatar_url":"https://avatars.githubusercontent.com/u/7976447?v=2","gravatar_id":"","url":"https://api.github.com/users/dinfcll","html_url":"https://github.com/dinfcll","followers_url":"https://api.github.com/users/dinfcll/followers","following_url":"https://api.github.com/users/dinfcll/following{/other_user}","gists_url":"https://api.github.com/users/dinfcll/gists{/gist_id}","starred_url":"https://api.github.com/users/dinfcll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinfcll/subscriptions","organizations_url":"https://api.github.com/users/dinfcll/orgs","repos_url":"https://api.github.com/users/dinfcll/repos","events_url":"https://api.github.com/users/dinfcll/events{/privacy}","received_events_url":"https://api.github.com/users/dinfcll/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dinfcll/a14-in-time","description":"","fork":false,"url":"https://api.github.com/repos/dinfcll/a14-in-time","forks_url":"https://api.github.com/repos/dinfcll/a14-in-time/forks","keys_url":"https://api.github.com/repos/dinfcll/a14-in-time/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dinfcll/a14-in-time/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dinfcll/a14-in-time/teams","hooks_url":"https://api.github.com/repos/dinfcll/a14-in-time/hooks","issue_events_url":"https://api.github.com/repos/dinfcll/a14-in-time/issues/events{/number}","events_url":"https://api.github.com/repos/dinfcll/a14-in-time/events","assignees_url":"https://api.github.com/repos/dinfcll/a14-in-time/assignees{/user}","branches_url":"https://api.github.com/repos/dinfcll/a14-in-time/branches{/branch}","tags_url":"https://api.github.com/repos/dinfcll/a14-in-time/tags","blobs_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/refs{/sha}","trees_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dinfcll/a14-in-time/statuses/{sha}","languages_url":"https://api.github.com/repos/dinfcll/a14-in-time/languages","stargazers_url":"https://api.github.com/repos/dinfcll/a14-in-time/stargazers","contributors_url":"https://api.github.com/repos/dinfcll/a14-in-time/contributors","subscribers_url":"https://api.github.com/repos/dinfcll/a14-in-time/subscribers","subscription_url":"https://api.github.com/repos/dinfcll/a14-in-time/subscription","commits_url":"https://api.github.com/repos/dinfcll/a14-in-time/commits{/sha}","git_commits_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/commits{/sha}","comments_url":"https://api.github.com/repos/dinfcll/a14-in-time/comments{/number}","issue_comment_url":"https://api.github.com/repos/dinfcll/a14-in-time/issues/comments/{number}","contents_url":"https://api.github.com/repos/dinfcll/a14-in-time/contents/{+path}","compare_url":"https://api.github.com/repos/dinfcll/a14-in-time/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dinfcll/a14-in-time/merges","archive_url":"https://api.github.com/repos/dinfcll/a14-in-time/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dinfcll/a14-in-time/downloads","issues_url":"https://api.github.com/repos/dinfcll/a14-in-time/issues{/number}","pulls_url":"https://api.github.com/repos/dinfcll/a14-in-time/pulls{/number}","milestones_url":"https://api.github.com/repos/dinfcll/a14-in-time/milestones{/number}","notifications_url":"https://api.github.com/repos/dinfcll/a14-in-time/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dinfcll/a14-in-time/labels{/name}","releases_url":"https://api.github.com/repos/dinfcll/a14-in-time/releases{/id}","created_at":"2014-08-29T17:06:29Z","updated_at":"2014-10-23T17:17:58Z","pushed_at":"2014-10-26T18:49:08Z","git_url":"git://github.com/dinfcll/a14-in-time.git","ssh_url":"git@github.com:dinfcll/a14-in-time.git","clone_url":"https://github.com/dinfcll/a14-in-time.git","svn_url":"https://github.com/dinfcll/a14-in-time","homepage":null,"size":1360,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"dinfcll:master","ref":"master","sha":"de837814522aab379e144bc429adcee7fa044d10","user":{"login":"dinfcll","id":7976447,"avatar_url":"https://avatars.githubusercontent.com/u/7976447?v=2","gravatar_id":"","url":"https://api.github.com/users/dinfcll","html_url":"https://github.com/dinfcll","followers_url":"https://api.github.com/users/dinfcll/followers","following_url":"https://api.github.com/users/dinfcll/following{/other_user}","gists_url":"https://api.github.com/users/dinfcll/gists{/gist_id}","starred_url":"https://api.github.com/users/dinfcll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinfcll/subscriptions","organizations_url":"https://api.github.com/users/dinfcll/orgs","repos_url":"https://api.github.com/users/dinfcll/repos","events_url":"https://api.github.com/users/dinfcll/events{/privacy}","received_events_url":"https://api.github.com/users/dinfcll/received_events","type":"Organization","site_admin":false},"repo":{"id":23471303,"name":"a14-in-time","full_name":"dinfcll/a14-in-time","owner":{"login":"dinfcll","id":7976447,"avatar_url":"https://avatars.githubusercontent.com/u/7976447?v=2","gravatar_id":"","url":"https://api.github.com/users/dinfcll","html_url":"https://github.com/dinfcll","followers_url":"https://api.github.com/users/dinfcll/followers","following_url":"https://api.github.com/users/dinfcll/following{/other_user}","gists_url":"https://api.github.com/users/dinfcll/gists{/gist_id}","starred_url":"https://api.github.com/users/dinfcll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinfcll/subscriptions","organizations_url":"https://api.github.com/users/dinfcll/orgs","repos_url":"https://api.github.com/users/dinfcll/repos","events_url":"https://api.github.com/users/dinfcll/events{/privacy}","received_events_url":"https://api.github.com/users/dinfcll/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dinfcll/a14-in-time","description":"","fork":false,"url":"https://api.github.com/repos/dinfcll/a14-in-time","forks_url":"https://api.github.com/repos/dinfcll/a14-in-time/forks","keys_url":"https://api.github.com/repos/dinfcll/a14-in-time/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dinfcll/a14-in-time/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dinfcll/a14-in-time/teams","hooks_url":"https://api.github.com/repos/dinfcll/a14-in-time/hooks","issue_events_url":"https://api.github.com/repos/dinfcll/a14-in-time/issues/events{/number}","events_url":"https://api.github.com/repos/dinfcll/a14-in-time/events","assignees_url":"https://api.github.com/repos/dinfcll/a14-in-time/assignees{/user}","branches_url":"https://api.github.com/repos/dinfcll/a14-in-time/branches{/branch}","tags_url":"https://api.github.com/repos/dinfcll/a14-in-time/tags","blobs_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/refs{/sha}","trees_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dinfcll/a14-in-time/statuses/{sha}","languages_url":"https://api.github.com/repos/dinfcll/a14-in-time/languages","stargazers_url":"https://api.github.com/repos/dinfcll/a14-in-time/stargazers","contributors_url":"https://api.github.com/repos/dinfcll/a14-in-time/contributors","subscribers_url":"https://api.github.com/repos/dinfcll/a14-in-time/subscribers","subscription_url":"https://api.github.com/repos/dinfcll/a14-in-time/subscription","commits_url":"https://api.github.com/repos/dinfcll/a14-in-time/commits{/sha}","git_commits_url":"https://api.github.com/repos/dinfcll/a14-in-time/git/commits{/sha}","comments_url":"https://api.github.com/repos/dinfcll/a14-in-time/comments{/number}","issue_comment_url":"https://api.github.com/repos/dinfcll/a14-in-time/issues/comments/{number}","contents_url":"https://api.github.com/repos/dinfcll/a14-in-time/contents/{+path}","compare_url":"https://api.github.com/repos/dinfcll/a14-in-time/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dinfcll/a14-in-time/merges","archive_url":"https://api.github.com/repos/dinfcll/a14-in-time/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dinfcll/a14-in-time/downloads","issues_url":"https://api.github.com/repos/dinfcll/a14-in-time/issues{/number}","pulls_url":"https://api.github.com/repos/dinfcll/a14-in-time/pulls{/number}","milestones_url":"https://api.github.com/repos/dinfcll/a14-in-time/milestones{/number}","notifications_url":"https://api.github.com/repos/dinfcll/a14-in-time/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dinfcll/a14-in-time/labels{/name}","releases_url":"https://api.github.com/repos/dinfcll/a14-in-time/releases{/id}","created_at":"2014-08-29T17:06:29Z","updated_at":"2014-10-23T17:17:58Z","pushed_at":"2014-10-26T18:49:08Z","git_url":"git://github.com/dinfcll/a14-in-time.git","ssh_url":"git@github.com:dinfcll/a14-in-time.git","clone_url":"https://github.com/dinfcll/a14-in-time.git","svn_url":"https://github.com/dinfcll/a14-in-time","homepage":null,"size":1360,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/10"},"html":{"href":"https://github.com/dinfcll/a14-in-time/pull/10"},"issue":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/issues/10"},"comments":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/dinfcll/a14-in-time/statuses/b72a15cf7fab795155dfbe5237310e9734530014"}}}}