private void registerButton_Click(object sender, EventArgs e)
        {
            RegisterForm r = new RegisterForm();

            r.ShowDialog();

            string userJson = JsonConvert.SerializeObject(r.user);

            client.request("User#Register#" + userJson);
        }
Ejemplo n.º 2
0
        private void init()
        {
            string result = client.request("User#CheckProfile#" + national_id);

            user = JsonConvert.DeserializeObject <ExpandoObject>(result);

            firstNameTextBox.Text  = user.First_name;
            lastNameTextBox.Text   = user.Last_name;
            nationalIdTextBox.Text = user.National_id;
            addressTextBox.Text    = user.Address;
            phoneTextBox.Text      = user.Phone;
            postalCodeTextBox.Text = user.Postal_code;
            emailTextBox.Text      = user.Email;

            if (user.Avatar != null)
            {
                var pic = Convert.FromBase64String(user.Avatar);

                using (MemoryStream ms = new MemoryStream(pic))
                {
                    avatarPictureBox.Image = Image.FromStream(ms);
                }
            }
            getAccounts();
        }
        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Option o = new Option();

            o.ShowDialog();

            client = new ClientHandler(o.get_IPAddress, o.get_port_destination);

            if (client.request("Test#test#test") != "connection_refused")
            {
                nationalIDtextBox.Enabled      = true;
                registerButton.Enabled         = true;
                checkUserProfileButton.Enabled = true;
            }
        }