private void btnEnter_Click(object sender, EventArgs e) { if (txtUserName.Text.Any() == false || txtPassword.Text.Any() == false) { MessageBox.Show("Please enter a valid Name and ID!"); return; } string username, password; username = txtUserName.Text; password = txtPassword.Text; Registration RClient = new Registration(); Client user = RClient.Log_in(username, password); if (user.IsActive() == true && user.Name != null) { this.Visible = false; Form_8 f8 = new Form_8(user.UserName, user.Password); f8.Visible = true; } else if (user.IsActive() == false) { MessageBox.Show("Your account is closed"); return; } else { MessageBox.Show("No data found!"); return; } }
private void button2_Click(object sender, EventArgs e) { this.Visible = false; Form_8 F8 = new Form_8(newClient.UserName, newClient.Password); F8.Visible = true; }
private void btnEnter_Click(object sender, EventArgs e) { if (txtAmount.Text.Any() == false) { MessageBox.Show("Please enter a valid Amount!"); return; } double amount; amount = double.Parse(txtAmount.Text); if (newClient.WithDraw(amount) == true) { MessageBox.Show("Done"); this.Close(); } else { MessageBox.Show("Your Balance is not enough."); return; } newClient.update(); File.Delete("Client.txt"); File.Copy("NewClient.txt", "Client.txt"); File.Delete("NewClient.txt"); this.Visible = false; Form_8 F8 = new Form_8(newClient.UserName, newClient.Password); F8.Visible = true; }
private void btnPay_Click(object sender, EventArgs e) { if (newClient.PayLoan(double.Parse(txtAmount.Text)) == true) { MessageBox.Show("Done"); } else { MessageBox.Show("The amount is too large for your loan " + newClient.OldLoan); return; } newClient.update(); File.Delete("Client.txt"); File.Copy("NewClient.txt", "Client.txt"); File.Delete("NewClient.txt"); this.Visible = false; Form_8 F8 = new Form_8(newClient.UserName, newClient.Password); F8.Visible = true; }
private void btnEnter_Click(object sender, EventArgs e) { double amount; amount = double.Parse(txtAmount.Text); // newClient.OldLoan++; newClient.Loan(amount); newClient.update(); MessageBox.Show("Done"); this.Close(); File.Delete("Client.txt"); File.Copy("NewClient.txt", "Client.txt"); File.Delete("NewClient.txt"); this.Visible = false; Form_8 F8 = new Form_8(newClient.UserName, newClient.Password); F8.Visible = true; }
private void btnEnter_Click(object sender, EventArgs e) { double amount; amount = double.Parse(txtEnter.Text); if (newClient.Deposit(amount) == true) { MessageBox.Show("Done"); this.Close(); } else { MessageBox.Show("Your Amount is not valid."); return; } newClient.update(); File.Delete("Client.txt"); File.Copy("NewClient.txt", "Client.txt"); File.Delete("NewClient.txt"); this.Visible = false; Form_8 F8 = new Form_8(newClient.UserName, newClient.Password); F8.Visible = true; }