private void button4_Click(object sender, EventArgs e) { try { if (numericUpDown2.Value <= 0) { return; } int howmany = (int)numericUpDown2.Value; int result = _market.BuyDiginotes(howmany, _user); if (result < numericUpDown2.Value) { using (NewPrice np = new NewPrice(howmany, howmany - result, (decimal)_market.SharePrice, false)) { np.ShowDialog(); if (np.newValue > 0) { _market.SuggestNewSharePrice((float)np.newValue, _user, false, howmany - result); } } } else { MessageBox.Show(@"Your have new diginotes!", @"Success", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } UpdateView(); } catch (SocketException exception) { ServerDown(exception); } }