Ejemplo n.º 1
0
        private void SendSignUpRequest()
        {
            RpcClient rpcClient   = new RpcClient();
            string    queryString = "";

            rpcClient.SetServerInfo(CeremonyClientFinal.Core.Settings.Default.server_url);

            JObject requestParam = new JObject();

            requestParam["username"] = txbUserName.Text;
            requestParam["password"] = GetMD5(txbPassword.Password);
            requestParam["email"]    = txbEmailAddr.Text;
            requestParam["country"]  = cbCountry.Text;
            requestParam["pubkey"]   = newWallet.GetPublicKey().ToString();
            requestParam["address"]  = newWallet.GetAddress();

            JObject requestBody = new JObject();

            requestBody["method"] = "SignUp";
            requestBody["params"] = requestParam;

            queryString = requestBody.ToString();
            try
            {
                string  response     = rpcClient.SendRequest(queryString);
                JObject responseBody = JObject.Parse(response);
                JObject result       = responseBody["result"];
                if (result["result"].AsString() != "true")
                {
                    lbNotice.Content    = result["msg"].AsString();
                    lbNotice.Visibility = Visibility.Visible;
                }
                else
                {
                    signInWindow = new SignInWindow();
                    signInWindow.txbEmailAddr.Text    = txbEmailAddr.Text;
                    signInWindow.txbPassword.Password = txbPassword.Password;
                    signInWindow.Show();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                lbNotice.Content    = "SignUp Error! Cannot connect to the server.";
                lbNotice.Visibility = Visibility.Visible;
            }
        }
Ejemplo n.º 2
0
 private void BtnBack_Click(object sender, RoutedEventArgs e)
 {
     signInWindow = new SignInWindow();
     signInWindow.Show();
     this.Close();
 }