{"action":"created","comment":{"url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/comments/42368532","id":42368532,"diff_hunk":"@@ -0,0 +1,127 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+using System.Windows;\n+using System.Windows.Controls;\n+using System.Windows.Data;\n+using System.Windows.Documents;\n+using System.Windows.Input;\n+using System.Windows.Media;\n+using System.Windows.Media.Imaging;\n+using System.Windows.Shapes;\n+using projeto_integrado_2_sem.Repositories;\n+using projeto_integrado_2_sem.Models;\n+\n+namespace projeto_integrado_2_sem\n+{\n+    /// <summary>\n+    /// Interaction logic for FormRegister.xaml\n+    /// </summary>\n+    public partial class FormRegister : Window\n+    {\n+        public FormRegister()\n+        {\n+            InitializeComponent();\n+        }\n+\n+        private void btnBack_Click(object sender, RoutedEventArgs e)\n+        {\n+            this.Close();\n+        }\n+        RegisterUser registerUser = new RegisterUser();\n+\n+        private bool validateDates(int day, int month, int year)\n+        {\n+            try\n+            {\n+                DateTime date = new DateTime(year, month, day);\n+                return true;\n+            }\n+            catch\n+            {\n+                return false;\n+            }\n+        }\n+\n+        private void formRegister_Loaded(object sender, RoutedEventArgs e)\n+        {\n+            cmbYear.ItemsSource = Enumerable.Range(1950, ((DateTime.Today.Year) - 1949)).ToList();\n+        }\n+\n+        //private void txtName_KeyPress(object sender, KeyPressEventArgs e)\n+        //{\n+          //  if (!(char.IsLetter(e.KeyChar) || char.IsControl(e.KeyChar)))\n+            //    e.KeyChar = char.MinValue;\n+        //}\n+\n+        //private void dates_KeyPress(object sender, KeyPressEventArgs e)\n+        //{\n+         //   if (!(char.IsNumber(e.KeyChar) || char.IsControl(e.KeyChar)))\n+           //     e.KeyChar = char.MinValue;\n+        //}\n+\n+        private void atualizacao_TextChanged(object sender, TextChangedEventArgs e)\n+        {\n+            if (txtName.Text != \"\" && txtEmail.Text != \"\" && txtDay.Text != \"\" && cmbMonth.Text != \"\" && cmbYear.Text != \"\" && txtPassword.Password != \"\" && txtPassConfirm.Password != \"\")\n+                btnProcess.IsEnabled = true;\n+            else\n+                btnProcess.IsEnabled = false;\n+        }\n+        private void atualizacao_TextChanged(object sender, RoutedEventArgs e)\n+        {\n+            if (txtName.Text != \"\" && txtEmail.Text != \"\" && txtDay.Text != \"\" && cmbMonth.Text != \"\" && cmbYear.Text != \"\" && txtPassword.Password != \"\" && txtPassConfirm.Password != \"\")\n+                btnProcess.IsEnabled = true;\n+            else\n+                btnProcess.IsEnabled = false;\n+        }\n+\n+        private void btnProcess_Click(object sender, RoutedEventArgs e)\n+        {\n+            User user = new User();\n+            user.name = this.txtName.Text;\n+            user.email = this.txtEmail.Text;\n+            user.Profile = Profile.UserProfile();\n+\n+            try\n+            {\n+                if (!(validateDates(int.Parse(txtDay.Text), cmbMonth.SelectedIndex + 1, int.Parse(cmbYear.Text))))\n+                {\n+                    MessageBox.Show(\"Data de nascimento inválida\");\n+                    txtDay.Text = \"\";\n+                    cmbMonth.SelectedIndex = 0;\n+                    cmbYear.SelectedIndex = 0;\n+                }\n+                else\n+                {\n+                    user.birthDate = new DateTime(int.Parse(cmbYear.Text), cmbMonth.SelectedIndex + 1, int.Parse(txtDay.Text));\n+\n+                    if (!(String.Compare(txtPassword.Password, txtPassConfirm.Password) == 0))\n+                    {\n+                        MessageBox.Show(\"As senhas digitadas não são iguais\");\n+                        txtPassword.Password = \"\";\n+                        txtPassConfirm.Password = \"\";\n+                    }\n+                    else\n+                    {\n+                        user.password = this.txtPassword.Password;\n+\n+                        registerUser.setOneUser(user); //registra o usuário no txt\n+\n+\n+                        // Faz o login após o usuario se cadastrar\n+\n+                        FormMain formMain = new FormMain(user);\n+                        formMain.ShowDialog();\n+                        this.Close();\n+                    }\n+                }\n+            }\n+            catch\n+            {\n+                MessageBox.Show(\"Preencha os dados corretamente!\");","path":"projeto-integrado-2-sem/FormRegister.xaml.cs","position":123,"original_position":123,"commit_id":"d017c8af19ba6e7cf433554e7a373c5a06a93b85","original_commit_id":"d017c8af19ba6e7cf433554e7a373c5a06a93b85","user":{"login":"guilherme-otran","id":3027489,"avatar_url":"https://avatars.githubusercontent.com/u/3027489?v=3","gravatar_id":"","url":"https://api.github.com/users/guilherme-otran","html_url":"https://github.com/guilherme-otran","followers_url":"https://api.github.com/users/guilherme-otran/followers","following_url":"https://api.github.com/users/guilherme-otran/following{/other_user}","gists_url":"https://api.github.com/users/guilherme-otran/gists{/gist_id}","starred_url":"https://api.github.com/users/guilherme-otran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilherme-otran/subscriptions","organizations_url":"https://api.github.com/users/guilherme-otran/orgs","repos_url":"https://api.github.com/users/guilherme-otran/repos","events_url":"https://api.github.com/users/guilherme-otran/events{/privacy}","received_events_url":"https://api.github.com/users/guilherme-otran/received_events","type":"User","site_admin":false},"body":"Cara, Quando esse catch acontece? Que dado o usuário não preencheu errado e como ele vai saber?","created_at":"2015-10-19T13:13:55Z","updated_at":"2015-10-19T13:13:55Z","html_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem/pull/1#discussion_r42368532","pull_request_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/comments/42368532"},"html":{"href":"https://github.com/guilherme-otran/projeto-integrado-2-sem/pull/1#discussion_r42368532"},"pull_request":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/1","id":48065866,"html_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem/pull/1","diff_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem/pull/1.diff","patch_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem/pull/1.patch","issue_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues/1","number":1,"state":"open","locked":false,"title":"Movendo APP para WPF","user":{"login":"guilherme-otran","id":3027489,"avatar_url":"https://avatars.githubusercontent.com/u/3027489?v=3","gravatar_id":"","url":"https://api.github.com/users/guilherme-otran","html_url":"https://github.com/guilherme-otran","followers_url":"https://api.github.com/users/guilherme-otran/followers","following_url":"https://api.github.com/users/guilherme-otran/following{/other_user}","gists_url":"https://api.github.com/users/guilherme-otran/gists{/gist_id}","starred_url":"https://api.github.com/users/guilherme-otran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilherme-otran/subscriptions","organizations_url":"https://api.github.com/users/guilherme-otran/orgs","repos_url":"https://api.github.com/users/guilherme-otran/repos","events_url":"https://api.github.com/users/guilherme-otran/events{/privacy}","received_events_url":"https://api.github.com/users/guilherme-otran/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-19T12:38:39Z","updated_at":"2015-10-19T13:13:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/1/commits","review_comments_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/1/comments","review_comment_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues/1/comments","statuses_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/statuses/d017c8af19ba6e7cf433554e7a373c5a06a93b85","head":{"label":"guilherme-otran:wpf","ref":"wpf","sha":"d017c8af19ba6e7cf433554e7a373c5a06a93b85","user":{"login":"guilherme-otran","id":3027489,"avatar_url":"https://avatars.githubusercontent.com/u/3027489?v=3","gravatar_id":"","url":"https://api.github.com/users/guilherme-otran","html_url":"https://github.com/guilherme-otran","followers_url":"https://api.github.com/users/guilherme-otran/followers","following_url":"https://api.github.com/users/guilherme-otran/following{/other_user}","gists_url":"https://api.github.com/users/guilherme-otran/gists{/gist_id}","starred_url":"https://api.github.com/users/guilherme-otran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilherme-otran/subscriptions","organizations_url":"https://api.github.com/users/guilherme-otran/orgs","repos_url":"https://api.github.com/users/guilherme-otran/repos","events_url":"https://api.github.com/users/guilherme-otran/events{/privacy}","received_events_url":"https://api.github.com/users/guilherme-otran/received_events","type":"User","site_admin":false},"repo":{"id":41455413,"name":"projeto-integrado-2-sem","full_name":"guilherme-otran/projeto-integrado-2-sem","owner":{"login":"guilherme-otran","id":3027489,"avatar_url":"https://avatars.githubusercontent.com/u/3027489?v=3","gravatar_id":"","url":"https://api.github.com/users/guilherme-otran","html_url":"https://github.com/guilherme-otran","followers_url":"https://api.github.com/users/guilherme-otran/followers","following_url":"https://api.github.com/users/guilherme-otran/following{/other_user}","gists_url":"https://api.github.com/users/guilherme-otran/gists{/gist_id}","starred_url":"https://api.github.com/users/guilherme-otran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilherme-otran/subscriptions","organizations_url":"https://api.github.com/users/guilherme-otran/orgs","repos_url":"https://api.github.com/users/guilherme-otran/repos","events_url":"https://api.github.com/users/guilherme-otran/events{/privacy}","received_events_url":"https://api.github.com/users/guilherme-otran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem","description":"","fork":false,"url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem","forks_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/forks","keys_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/teams","hooks_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/hooks","issue_events_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues/events{/number}","events_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/events","assignees_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/assignees{/user}","branches_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/branches{/branch}","tags_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/tags","blobs_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/refs{/sha}","trees_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/statuses/{sha}","languages_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/languages","stargazers_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/stargazers","contributors_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/contributors","subscribers_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/subscribers","subscription_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/subscription","commits_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/commits{/sha}","git_commits_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/commits{/sha}","comments_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/comments{/number}","issue_comment_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues/comments{/number}","contents_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/contents/{+path}","compare_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/merges","archive_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/downloads","issues_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues{/number}","pulls_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls{/number}","milestones_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/milestones{/number}","notifications_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/labels{/name}","releases_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/releases{/id}","created_at":"2015-08-26T23:47:04Z","updated_at":"2015-09-02T23:13:01Z","pushed_at":"2015-10-19T12:38:39Z","git_url":"git://github.com/guilherme-otran/projeto-integrado-2-sem.git","ssh_url":"git@github.com:guilherme-otran/projeto-integrado-2-sem.git","clone_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem.git","svn_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem","homepage":null,"size":395,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"guilherme-otran:master","ref":"master","sha":"7eba990243e730c72fd0ea8fe3ce01110c27c946","user":{"login":"guilherme-otran","id":3027489,"avatar_url":"https://avatars.githubusercontent.com/u/3027489?v=3","gravatar_id":"","url":"https://api.github.com/users/guilherme-otran","html_url":"https://github.com/guilherme-otran","followers_url":"https://api.github.com/users/guilherme-otran/followers","following_url":"https://api.github.com/users/guilherme-otran/following{/other_user}","gists_url":"https://api.github.com/users/guilherme-otran/gists{/gist_id}","starred_url":"https://api.github.com/users/guilherme-otran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilherme-otran/subscriptions","organizations_url":"https://api.github.com/users/guilherme-otran/orgs","repos_url":"https://api.github.com/users/guilherme-otran/repos","events_url":"https://api.github.com/users/guilherme-otran/events{/privacy}","received_events_url":"https://api.github.com/users/guilherme-otran/received_events","type":"User","site_admin":false},"repo":{"id":41455413,"name":"projeto-integrado-2-sem","full_name":"guilherme-otran/projeto-integrado-2-sem","owner":{"login":"guilherme-otran","id":3027489,"avatar_url":"https://avatars.githubusercontent.com/u/3027489?v=3","gravatar_id":"","url":"https://api.github.com/users/guilherme-otran","html_url":"https://github.com/guilherme-otran","followers_url":"https://api.github.com/users/guilherme-otran/followers","following_url":"https://api.github.com/users/guilherme-otran/following{/other_user}","gists_url":"https://api.github.com/users/guilherme-otran/gists{/gist_id}","starred_url":"https://api.github.com/users/guilherme-otran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilherme-otran/subscriptions","organizations_url":"https://api.github.com/users/guilherme-otran/orgs","repos_url":"https://api.github.com/users/guilherme-otran/repos","events_url":"https://api.github.com/users/guilherme-otran/events{/privacy}","received_events_url":"https://api.github.com/users/guilherme-otran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem","description":"","fork":false,"url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem","forks_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/forks","keys_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/teams","hooks_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/hooks","issue_events_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues/events{/number}","events_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/events","assignees_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/assignees{/user}","branches_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/branches{/branch}","tags_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/tags","blobs_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/refs{/sha}","trees_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/statuses/{sha}","languages_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/languages","stargazers_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/stargazers","contributors_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/contributors","subscribers_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/subscribers","subscription_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/subscription","commits_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/commits{/sha}","git_commits_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/git/commits{/sha}","comments_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/comments{/number}","issue_comment_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues/comments{/number}","contents_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/contents/{+path}","compare_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/merges","archive_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/downloads","issues_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues{/number}","pulls_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls{/number}","milestones_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/milestones{/number}","notifications_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/labels{/name}","releases_url":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/releases{/id}","created_at":"2015-08-26T23:47:04Z","updated_at":"2015-09-02T23:13:01Z","pushed_at":"2015-10-19T12:38:39Z","git_url":"git://github.com/guilherme-otran/projeto-integrado-2-sem.git","ssh_url":"git@github.com:guilherme-otran/projeto-integrado-2-sem.git","clone_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem.git","svn_url":"https://github.com/guilherme-otran/projeto-integrado-2-sem","homepage":null,"size":395,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/1"},"html":{"href":"https://github.com/guilherme-otran/projeto-integrado-2-sem/pull/1"},"issue":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues/1"},"comments":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/guilherme-otran/projeto-integrado-2-sem/statuses/d017c8af19ba6e7cf433554e7a373c5a06a93b85"}}}}