GitHub PullRequestReviewCommentEvent at 2014-10-31 18:25:43
Repository: a14-trouve-un-band
Actor: fredbegin11
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/comments/19684474","id":19684474,"diff_hunk":"@@ -28,84 +38,239 @@ public ActionResult Details(int id = 0)\n             return View(band);\n         }\n \n+        //\n+        // GET: /Group/Create\n+        [HttpGet]\n         public ActionResult Create()\n         {\n+            string RC = \"\";\n+            if (Request.IsAuthenticated)\n+            {\n+                var CurrentUser = Validation.GetCurrentUser(User.Identity.Name);\n+                var CurrentMusician = Validation.GetCurrentMusician(User.Identity.Name);\n+                bool b = Validation.CurrentUserIsMusician(CurrentUser);\n+                    if (b)\n+                    {\n+                        if (Session[\"myBand\"] == null || Session[\"myMusicians\"] == null)\n+                        {\n+                            Band myBand = new Band();\n+                            myBand.Name = \"\";\n+                            myBand.Location = \"\";\n+                            myBand.Description = \"\";\n+                            List<Musician> myMusicians = new List<Musician>();\n+                            myMusicians.Add(CurrentMusician);\n+                            /* \n+                                Il faut utilisé une list de musiciens à part du band car l'exécution différée de LINQ entre en conflit. \n+                                Lors d'une boucle foreach, l'objet est disposé apres la première lecture, donc n'a plus d'instance a la \n+                                deuxième itération de la boucle\n+                            */\n+                            Session[\"myMusicians\"] = myMusicians;\n+                            Session[\"myBand\"] = myBand;\n+                            // À la création de la vue le premier musicien est toujours le musicien associé au compte authentifié.\n+                            ViewBag.CurrentMusician = CurrentMusician;\n+                        }\n+                        ViewBag.GenrelistDD = new List<Genre>(db.Genres);\n+                        return View(\"Create\");\n+                    }\n+                    else\n+                    {\n+                        RC = \"Aucun profile musicien n'est associé à ce compte. Veuillez vous créer un profile musicien\";\n+                        RedirectToAction(\"Index\", \"Home\");\n+                    }\n+            }\n+            else\n+            {\n+                RC = \"Vous devez être connecté pour créer un band\";\n+                RedirectToAction(\"Index\", \"Home\");\n+            }\n+            TempData[\"TempDataError\"] = RC;\n             return View();\n         }\n \n-        public ActionResult ConfirmCreate()\n-        {\n-            return View();\n-        }\n+        //\n+        // POST: /Group/Create\n \n-        [HttpPost]\n-        public ActionResult Create(Band band)\n+        [HttpGet]\n+        public PartialViewResult SubmitInfo(Band band)\n         {\n-            return RedirectToAction(\"ConfirmCreate\", band);\n-        }\n+            string WC = \"\";\n+            var ExistingBand = db.Bands.FirstOrDefault(x => x.Name == band.Name);\n+            if (ExistingBand != null)\n+            {\n+                if (!ExistingBand.Musicians.Any(x => x.MusicianId == ((Validation.GetCurrentUser(User.Identity.Name)).Musicians.ToList()[0]).MusicianId))\n+                {\n+                    WC = \"Le Band existe déja. Votre band sera renommé par: \" + band.Name;","path":"TrouveUnBand/Controllers/GroupController.cs","position":105,"original_position":105,"commit_id":"c12298db35e845aa8375ba5ce6b6976e3e4ca1d5","original_commit_id":"c12298db35e845aa8375ba5ce6b6976e3e4ca1d5","user":{"login":"fredbegin11","id":8545738,"avatar_url":"https://avatars.githubusercontent.com/u/8545738?v=2","gravatar_id":"","url":"https://api.github.com/users/fredbegin11","html_url":"https://github.com/fredbegin11","followers_url":"https://api.github.com/users/fredbegin11/followers","following_url":"https://api.github.com/users/fredbegin11/following{/other_user}","gists_url":"https://api.github.com/users/fredbegin11/gists{/gist_id}","starred_url":"https://api.github.com/users/fredbegin11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredbegin11/subscriptions","organizations_url":"https://api.github.com/users/fredbegin11/orgs","repos_url":"https://api.github.com/users/fredbegin11/repos","events_url":"https://api.github.com/users/fredbegin11/events{/privacy}","received_events_url":"https://api.github.com/users/fredbegin11/received_events","type":"User","site_admin":false},"body":"déjà","created_at":"2014-10-31T18:25:43Z","updated_at":"2014-10-31T18:25:43Z","html_url":"https://github.com/dinfcll/a14-trouve-un-band/pull/21#discussion_r19684474","pull_request_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/comments/19684474"},"html":{"href":"https://github.com/dinfcll/a14-trouve-un-band/pull/21#discussion_r19684474"},"pull_request":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/21","id":23688271,"html_url":"https://github.com/dinfcll/a14-trouve-un-band/pull/21","diff_url":"https://github.com/dinfcll/a14-trouve-un-band/pull/21.diff","patch_url":"https://github.com/dinfcll/a14-trouve-un-band/pull/21.patch","issue_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues/21","number":21,"state":"open","locked":false,"title":"Tb 17 validation band","user":{"login":"Gogluness","id":8545744,"avatar_url":"https://avatars.githubusercontent.com/u/8545744?v=2","gravatar_id":"","url":"https://api.github.com/users/Gogluness","html_url":"https://github.com/Gogluness","followers_url":"https://api.github.com/users/Gogluness/followers","following_url":"https://api.github.com/users/Gogluness/following{/other_user}","gists_url":"https://api.github.com/users/Gogluness/gists{/gist_id}","starred_url":"https://api.github.com/users/Gogluness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gogluness/subscriptions","organizations_url":"https://api.github.com/users/Gogluness/orgs","repos_url":"https://api.github.com/users/Gogluness/repos","events_url":"https://api.github.com/users/Gogluness/events{/privacy}","received_events_url":"https://api.github.com/users/Gogluness/received_events","type":"User","site_admin":false},"body":"Création de band complète et fonctionnel","created_at":"2014-10-31T16:28:11Z","updated_at":"2014-10-31T18:25:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/21/commits","review_comments_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/21/comments","review_comment_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues/21/comments","statuses_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/statuses/c12298db35e845aa8375ba5ce6b6976e3e4ca1d5","head":{"label":"dinfcll:TB_17_Validation_Band","ref":"TB_17_Validation_Band","sha":"c12298db35e845aa8375ba5ce6b6976e3e4ca1d5","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":23590717,"name":"a14-trouve-un-band","full_name":"dinfcll/a14-trouve-un-band","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-trouve-un-band","description":"","fork":false,"url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band","forks_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/forks","keys_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/teams","hooks_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/hooks","issue_events_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues/events{/number}","events_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/events","assignees_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/assignees{/user}","branches_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/branches{/branch}","tags_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/tags","blobs_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/refs{/sha}","trees_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/statuses/{sha}","languages_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/languages","stargazers_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/stargazers","contributors_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/contributors","subscribers_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/subscribers","subscription_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/subscription","commits_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/commits{/sha}","git_commits_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/commits{/sha}","comments_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/comments{/number}","issue_comment_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues/comments/{number}","contents_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/contents/{+path}","compare_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/merges","archive_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/downloads","issues_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues{/number}","pulls_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls{/number}","milestones_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/milestones{/number}","notifications_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/labels{/name}","releases_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/releases{/id}","created_at":"2014-09-02T18:36:12Z","updated_at":"2014-09-29T14:00:32Z","pushed_at":"2014-10-31T18:17:09Z","git_url":"git://github.com/dinfcll/a14-trouve-un-band.git","ssh_url":"git@github.com:dinfcll/a14-trouve-un-band.git","clone_url":"https://github.com/dinfcll/a14-trouve-un-band.git","svn_url":"https://github.com/dinfcll/a14-trouve-un-band","homepage":null,"size":15004,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"dinfcll:master","ref":"master","sha":"3388752edadd1f0636ff082853c4a99a23505c26","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":23590717,"name":"a14-trouve-un-band","full_name":"dinfcll/a14-trouve-un-band","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-trouve-un-band","description":"","fork":false,"url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band","forks_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/forks","keys_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/teams","hooks_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/hooks","issue_events_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues/events{/number}","events_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/events","assignees_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/assignees{/user}","branches_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/branches{/branch}","tags_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/tags","blobs_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/refs{/sha}","trees_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/statuses/{sha}","languages_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/languages","stargazers_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/stargazers","contributors_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/contributors","subscribers_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/subscribers","subscription_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/subscription","commits_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/commits{/sha}","git_commits_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/git/commits{/sha}","comments_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/comments{/number}","issue_comment_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues/comments/{number}","contents_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/contents/{+path}","compare_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/merges","archive_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/downloads","issues_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues{/number}","pulls_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls{/number}","milestones_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/milestones{/number}","notifications_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/labels{/name}","releases_url":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/releases{/id}","created_at":"2014-09-02T18:36:12Z","updated_at":"2014-09-29T14:00:32Z","pushed_at":"2014-10-31T18:17:09Z","git_url":"git://github.com/dinfcll/a14-trouve-un-band.git","ssh_url":"git@github.com:dinfcll/a14-trouve-un-band.git","clone_url":"https://github.com/dinfcll/a14-trouve-un-band.git","svn_url":"https://github.com/dinfcll/a14-trouve-un-band","homepage":null,"size":15004,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/21"},"html":{"href":"https://github.com/dinfcll/a14-trouve-un-band/pull/21"},"issue":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues/21"},"comments":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/dinfcll/a14-trouve-un-band/statuses/c12298db35e845aa8375ba5ce6b6976e3e4ca1d5"}}}}