Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    selectedIndex = comboBox1.SelectedIndex;
            Object selectedItem  = comboBox1.SelectedItem;
            string identity      = selectedItem.ToString();
            string pass          = Password.Text;

            if (identity == "Manufacturer" && pass == "Manufacturer")
            {
                this.Hide();
                Form2 s = new Form2();
                s.ShowDialog();
                this.Close();
            }
            else if (identity == "Patient" && pass == "Patient")
            {
                this.Hide();
                PatientMenu s = new PatientMenu();
                s.Show();
            }
            else if (identity == "Clinic" && pass == "Clinic")
            {
                this.Hide();
                ClinicMenu s = new ClinicMenu();
                s.Show();
            }
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string combobox     = comboBox1.Text;
            string eth_address1 = "0x9Aa8694635b49D405D1E1bf8A9C9a26fDc1a987d";

            var privatekey1 = "87eeb49d97be2d1d338b46f27be26252802cade88ebdba741bde895332766d36";
            var url         = "http://127.0.0.1:7545";
            var account     = new Nethereum.Web3.Accounts.Account(privatekey1);
            var web31       = new Web3(account, url);
            var iot         = new Decommision();

            var balanceHandler2 = web31.Eth.GetContractQueryHandler <Decommision>();
            var balance2        = await balanceHandler2.QueryAsync <int>(contractaddress, iot);

            File.AppendAllText(@"C:\Users\C.z\source\repos\BlockChain Project\BlockChain Project\DeployedContract.txt", combobox);
            this.Hide();
            PatientMenu s = new PatientMenu();

            s.Show();
            MessageBox.Show("Device Decommision Successfuly");
        }