private void RegisterClicked() { try { lblError.Text = String.Empty; if (String.IsNullOrEmpty(txtAccountName.Text.Trim()) || String.IsNullOrEmpty(txtPlayerName.Text.Trim())) { lblError.Text = "Please enter Account and Player Names."; return; } osVodigiWS.osVodigiServiceSoapClient ws = new osVodigiWS.osVodigiServiceSoapClient(); ws.Endpoint.Address = new System.ServiceModel.EndpointAddress(new Uri(PlayerConfiguration.configVodigiWebserviceURL)); // Validate the account osVodigiWS.Account account = ws.Account_GetByName(txtAccountName.Text.Trim()); if (account == null) { lblError.Text = "Invalid Account Name. Please retry."; return; } PlayerConfiguration.configAccountID = account.AccountID; PlayerConfiguration.configAccountName = account.AccountName; // Validate the player osVodigiWS.Player player = ws.Player_GetByName(account.AccountID, txtPlayerName.Text.Trim()); if (player == null) { lblError.Text = "Invalid Player Name. Please retry."; return; } PlayerConfiguration.configPlayerID = player.PlayerID; PlayerConfiguration.configPlayerName = player.PlayerName; // Set the remaining properties on PlayerConfiguration and save the configuration PlayerConfiguration.configIsPlayerInitialized = true; PlayerConfiguration.SavePlayerConfiguration(); // Since registration can cause accountid/playerid changes, delete the local schedule file ScheduleFile.DeleteScheduleFile(); // Register the player at vodigi.com try { VodigiWS.VodigiWSSoapClient vws = new VodigiWS.VodigiWSSoapClient(); vws.PlayerRegistered("PlayerRegistration"); } catch { } FadeOut(); } catch { lblError.Text = "Cannot connect to Vodigi Server. Please retry."; } }
private void RegisterClicked() { try { lblError.Text = String.Empty; if (String.IsNullOrEmpty(txtAccountName.Text.Trim()) || String.IsNullOrEmpty(txtPlayerName.Text.Trim())) { lblError.Text = "Please enter Account and Player Names."; return; } osVodigiWS.osVodigiServiceSoapClient ws = new osVodigiWS.osVodigiServiceSoapClient(); ws.Endpoint.Address = new System.ServiceModel.EndpointAddress(new Uri(PlayerConfiguration.configVodigiWebserviceURL)); // Validate the account osVodigiWS.Account account = ws.Account_GetByName(txtAccountName.Text.Trim()); if (account == null) { lblError.Text = "Invalid Account Name. Please retry."; return; } PlayerConfiguration.configAccountID = account.AccountID; PlayerConfiguration.configAccountName = account.AccountName; // Validate the player osVodigiWS.Player player = ws.Player_GetByName(account.AccountID, txtPlayerName.Text.Trim()); if (player == null) { lblError.Text = "Invalid Player Name. Please retry."; return; } PlayerConfiguration.configPlayerID = player.PlayerID; PlayerConfiguration.configPlayerName = player.PlayerName; // Set the remaining properties on PlayerConfiguration and save the configuration PlayerConfiguration.configIsPlayerInitialized = true; PlayerConfiguration.SavePlayerConfiguration(); // Since registration can cause accountid/playerid changes, delete the local schedule file ScheduleFile.DeleteScheduleFile(); // Register the player at vodigi.com try { VodigiWS.VodigiWSSoapClient vws = new VodigiWS.VodigiWSSoapClient(); vws.PlayerRegistered("PlayerRegistration"); } catch { } FadeOut(); } catch { lblError.Text = "Cannot connect to Vodigi Server. Please retry."; } }