private void btnAddCrypto_Click(object sender, EventArgs e) { bool go = false; foreach (Crypto item in BenCryptoList) { if (txtWalletCode.Text.Trim() == item.Waletaddress) { go = true; break; } } if (go == false) { Crypto crypto = new Crypto(txtWaletName.Text.Trim(), txtWalletCode.Text.Trim(), 0, ben.BeneficairyID, ""); BenCryptoList.Add(crypto); CryptoController.AddCrypto(crypto); FillCryptoDatagrid(BenCryptoList); txtWaletName.Text = ""; txtWalletCode.Text = ""; } else { MetroMessageBox.Show(this, "Account Already Exists!", "Account Exists"); } }
private void btnAddWallet_Click(object sender, EventArgs e) { string Waletname = txtWalletName.Text.Trim(); Crypto newcryp = new Crypto(txtWalletName.Text, txtWalletCode.Text, float.Parse(txtWalletAmount.Text), "", user.RsaID); CryptoController.AddCrypto(newcryp); }