Example #1
0
        private void btnPing_Click(object sender, EventArgs e)
        {
            Double Init;
            Double Finale;

            customer = new VO.CustomersVO();
            DialogResult dlg = MessageBox.Show("Do you wish to Ping this Account?\nThis will be Undone!", "Ping Interest", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            try
            {
                if (dlg == System.Windows.Forms.DialogResult.Yes)
                {
                    customer.Custcode = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
                    Init             = Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[5].Value) * customer.getIR();
                    Finale           = Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[5].Value) + Init;
                    customer.Balance = Finale;
                    customer.PingInterest();
                    dataGridView1.SelectedRows[0].Cells[5].Value = Finale.ToString("#,###,##0.00");
                    btnPing.Enabled = false;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Ping Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }