private void btnLogin_Click(object sender, EventArgs e) { RequestServer newreq = new RequestServer(); ParserJSON parser = new ParserJSON(); try { var addr = new System.Net.Mail.MailAddress(txtUsername.Text); s.tokenConnection = parser.ServerConnect(newreq.ServerConnect("", txtPassword.Text, txtUsername.Text)); } catch { s.tokenConnection = parser.ServerConnect(newreq.ServerConnect(txtUsername.Text, txtPassword.Text, "")); } if (s.tokenConnection.connectionAccepted == true) { s.tokenConnection.Nickname = txtUsername.Text; s.AffProfil(); } else { MessageBox.Show("Informations de connection incorrectes."); } }
private void InitializeClientInfos() { ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); s.client = parser.InfosPlayer(newreq.InfosPlayer(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok)); }
private void btnDeleteDeck_Click(object sender, EventArgs e) { ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); String rsp = newreq.DeleteDeck(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok, currentDeck.deck_id.ToString()); // decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok)); }
private void btnCreateDeck_Click(object sender, EventArgs e) { ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); String rsp = newreq.CreateDeck(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok, currentDeck.deck_name, ""); MessageBox.Show("CREATE DECK ? : " + rsp); //decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok)); }
private void FirstConnection() { //MessageBox.Show("Premiere co"); ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); s.client = parser.InfosPlayer(newreq.ProfilCreation(s.tokenConnection.Nickname, s.tokenConnection.Tok)); //MessageBox.Show(tmp.nickname); //pnlChooseClass.Show(); }
private void setRankingLocalProfilsInfos() { tabPageLocal.Controls.Clear(); ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); String rsp = newreq.RankOverall(p.s.client.profile_id, "nat", p.s.tokenConnection.Tok); ClientInfos_List tmp = parser.RankOverall(rsp); YPanelLocation = 1; for (int i = 0; i < tmp.data.Count(); i++) { tabPageFriends.Controls.Add(getRankingProfilInfos(tmp.data[i])); } }
private void txtLogin_Leave(object sender, EventArgs e) { pctLoginAvaible.Hide(); RequestServer newreq = new RequestServer(); if (newreq.LoginAvaible(txtLogin.Text) == false) { lblLoginWrong.Text = "Le pseudo que vous avez choisit n'est pas disponible."; lblLoginWrong.Show(); btnCreateAccount.Hide(); } else { lblLoginWrong.Hide(); btnCreateAccount.Show(); pctLoginAvaible.Show(); } }
private void button1_Click(object sender, EventArgs e) { ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok)); currentDeckIt = 0; InitializeNewDeck(); if (decksList.data.Count() > 0) { currentDeck = decksList.data[currentDeckIt]; } else { currentDeck = newDeck; } UpdateDeckInfos(); }
private void InitializeDeckEditor() { ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); String rsp = newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok); decksList = parser.DeckAll(rsp); if (decksList.data.Count > 0) { currentDeck = decksList.data[0]; } else { currentDeck = newDeck; } UpdateDeckInfos(); }
private void btnRenameDeck_Click(object sender, EventArgs e) { RequestServer newreq = new RequestServer(); ParserJSON parser = new ParserJSON(); if (txtDeckName.Text != "") { /* if (currentDeck != newDeck) * { * String rsp = newreq.ModifyDeck(currentDeck.profile_id.ToString(), * s.tokenConnection.Tok, * currentDeck.deck_name, * "", * "action=modify", * currentDeck.deck_id.ToString()); * MessageBox.Show("MODIFY DECK? : " + rsp); * //decksList = parser.DeckAll(newreq.DeckAll(currentDeck.profile_id.ToString(), s.tokenConnection.Tok)); * } */ currentDeck.deck_name = txtDeckName.Text; } txtDeckName.Hide(); btnRenameDeck.Hide(); UpdateDeckInfos(); }
private void btnCreateAccount_Click(object sender, EventArgs e) { hideError(); bool allGood = true; //Check if all label is fill if (txtPassword.Text != "" && txtEmailcomfirm.Text != "" && txtPasswordcomfirm.Text != "" && txtEmail.Text != "" && txtLogin.Text != "" && txtFirstName.Text != "" && txtLastName.Text != "") { if (txtLogin.Text.Length < 5) { lblLoginWrong.Show(); allGood = false; } if (IsValidEmail(txtEmail.Text) != false) { if (txtEmail.Text != txtEmailcomfirm.Text) { lblMailWrong.Show(); allGood = false; } } else { lblMailWrong.Text = "Votre e-mail n'est pas valide."; lblMailWrong.Show(); allGood = false; } if (txtPassword.Text.Length > 7) { if (txtPassword.Text != txtLogin.Text) { if (txtPassword.Text != txtPasswordcomfirm.Text) { lblPasswordWrong.Show(); allGood = false; } } else { lblPasswordWrong.Text = "Vous devez choisir un mot de passe différent de votre pseudo."; lblPasswordWrong.Show(); allGood = false; } } else { lblPasswordWrong.Text = "Votre mot de passe doit avoir plus de 7 charactères."; lblPasswordWrong.Show(); allGood = false; } //If every fields are correct send Request to register. if (allGood == true) { RequestServer newreq = new RequestServer(); if (newreq.Register(txtLogin.Text, txtPassword.Text, txtEmail.Text, txtFirstName.Text, txtLastName.Text, "KR", dteBirthdate.Value.Date.ToString("dd/MM/yyyy")) == true) { s.AffLogin(); } else { MessageBox.Show("L'inscription à echoué :'("); } } } else { lblFillAllField.Show(); } }
private void btnCreateAccount_Click(object sender, EventArgs e) { hideError(); bool allGood = true; //Check if all label is fill if (txtPassword.Text != "" && txtEmailcomfirm.Text != "" && txtPasswordcomfirm.Text != "" && txtEmail.Text != "" && txtLogin.Text != "" && txtFirstName.Text != "" && txtLastName.Text != "") { if (txtLogin.Text.Length < 5) { lblLoginWrong.Show(); allGood = false; } if (IsValidEmail(txtEmail.Text) != false) { if (txtEmail.Text != txtEmailcomfirm.Text) { lblMailWrong.Show(); allGood = false; } } else { lblMailWrong.Text = "Votre e-mail n'est pas valide."; lblMailWrong.Show(); allGood = false; } if (txtPassword.Text.Length > 7) { if (txtPassword.Text != txtLogin.Text) { if (txtPassword.Text != txtPasswordcomfirm.Text) { lblPasswordWrong.Show(); allGood = false; } } else { lblPasswordWrong.Text = "Vous devez choisir un mot de passe différent de votre pseudo."; lblPasswordWrong.Show(); allGood = false; } } else { lblPasswordWrong.Text = "Votre mot de passe doit avoir plus de 7 charactères."; lblPasswordWrong.Show(); allGood = false; } //If every fields are correct send Request to register. if (allGood == true) { RequestServer newreq = new RequestServer(); if (newreq.Register(txtLogin.Text, txtPassword.Text, txtEmail.Text, txtFirstName.Text, txtLastName.Text, "KR", dteBirthdate.Value.Date.ToString("dd/MM/yyyy")) == true) { s.AffLogin(); } else { MessageBox.Show("L'inscription à echoué :'("); } } } else lblFillAllField.Show(); }
private void btnRenameDeck_Click(object sender, EventArgs e) { RequestServer newreq = new RequestServer(); ParserJSON parser = new ParserJSON(); if (txtDeckName.Text != "") { /* if (currentDeck != newDeck) { String rsp = newreq.ModifyDeck(currentDeck.profile_id.ToString(), s.tokenConnection.Tok, currentDeck.deck_name, "", "action=modify", currentDeck.deck_id.ToString()); MessageBox.Show("MODIFY DECK? : " + rsp); //decksList = parser.DeckAll(newreq.DeckAll(currentDeck.profile_id.ToString(), s.tokenConnection.Tok)); } */ currentDeck.deck_name = txtDeckName.Text; } txtDeckName.Hide(); btnRenameDeck.Hide(); UpdateDeckInfos(); }
private void InitializeDeckEditor() { ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); String rsp = newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok); decksList = parser.DeckAll(rsp); if (decksList.data.Count > 0) currentDeck = decksList.data[0]; else currentDeck = newDeck; UpdateDeckInfos(); }
private void button1_Click(object sender, EventArgs e) { ParserJSON parser = new ParserJSON(); RequestServer newreq = new RequestServer(); decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok)); currentDeckIt = 0; InitializeNewDeck(); if (decksList.data.Count() > 0) currentDeck = decksList.data[currentDeckIt]; else currentDeck = newDeck; UpdateDeckInfos(); }