private void btnNumberEnter_Click(object sender, EventArgs e) { if (accountBUL.ChuyenKhoan(stk_chuyen_tien, stk_nhan_tien, int.Parse(txtMoney.Text)) == true) { this.Hide(); loadingForm = new Loading(this.rm, this.card, this.stk_chuyen_tien); loadingForm.Show(); myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = 2000; myTimer.Start(); } else { MessageBox.Show("Số tiền trong tài khoản không đủ"); } }
private void processWithDraw(int status) { switch (status) { case 0: this.Hide(); errorMessage = "Số tiền phải chia hết cho 50000"; loadingForm = new Loading(this.rm, this.card, this.accountNo); loadingForm.Show(); myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = 2000; myTimer.Start(); break; case 1: this.Hide(); errorMessage = "Số tiền trong tài khoản của quý khách không đủ"; loadingForm = new Loading(this.rm, this.card, this.accountNo); loadingForm.Show(); myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = 2000; myTimer.Start(); break; case 2: this.Hide(); int minMoney = stockBUL.GetMinWithDraw(this.accountNo); errorMessage = "Quý khách chỉ được rút tối đa " + CurrencyFormat(minMoney.ToString()) + "/1 ngày"; loadingForm = new Loading(this.rm, this.card, this.accountNo); loadingForm.Show(); myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = 2000; myTimer.Start(); break; case 3: this.Hide(); errorMessage = "Số tiền trong máy không đủ để thực hiện giao dịch này"; loadingForm = new Loading(this.rm, this.card, this.accountNo); loadingForm.Show(); myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = 2000; myTimer.Start(); break; case 4: this.Hide(); errorMessage = null; loadingForm = new Loading(this.rm, this.card, this.accountNo); loadingForm.Show(); myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = 2000; myTimer.Start(); break; } }