Exemplo n.º 1
0
        private void withdrawButton_Click(object sender, EventArgs e)
        {
            TransactionInfo withdrawObj = new TransactionInfo();

            if (transactionAccnNoTextBox.Text == "" || transactionAmountTextBox.Text == "")
            {
                MessageBox.Show("No empty value accepted");
                return;
            }


            withdrawObj.TranAccNo = transactionAccnNoTextBox.Text;
            try
            {
                withdrawObj.TransAmmount = Convert.ToDouble(transactionAmountTextBox.Text);
            }
            catch
            {
                MessageBox.Show("Amount must be in number !");
                return;
            }


            if (withdrawObj.TransAmmount <= 0)
            {
                MessageBox.Show("Ammount should be positive and greater than 0");
                return;
            }


            try
            {
                WithdrawManager withMangObj  = new WithdrawManager();
                string          withdrawInfo = withMangObj.WithdrawInfo(withdrawObj);

                MessageBox.Show(withdrawInfo);
                return;
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }


            //try
            //{
            //    DipositManager dipoMangObj = new DipositManager();
            //    bool dipositInfo = dipoMangObj.DipositInfo(dipositObj);
            //    if (dipositInfo == true)
            //    {
            //        MessageBox.Show("Taka " + dipositObj.TransAmmount + " Diposited Successfully !");

            //    }
            //    else
            //    {
            //        MessageBox.Show("Diposit Failed!");
            //    }
            //}
            //catch (Exception exception)
            //{
            //    MessageBox.Show(exception.Message);
            //}
        }