private void backBtn_Click(object sender, EventArgs e) { panelAddNewDebtor.Show(); panelAddLoanDetails.Hide(); AddDebtorLbl.Show(); AddloanLbl.Hide(); }
private void nextBtn_Click(object sender, EventArgs e) { panelAddNewDebtor.Hide(); panelAddLoanDetails.Show(); AddDebtorLbl.Hide(); AddloanLbl.Show(); firstName = txtBoxFName.Text; lastName = txtBoxLname.Text; nic = txtBoxNIC.Text; String[] phone = txtBoxPhone.Text.Split('-'); phoneNum = Regex.Replace((phone[0] + phone[1] + phone[2]), @"\s", ""); address = txtBoxAddress.Text; cmbBoxMethod.SelectedIndex = 0; cmbBoxCalculatingfreq.SelectedIndex = 0; try { ConnectDB connection = new ConnectDB(); MySqlConnection con = connection.setUpConnection(); con.Open(); String MysqlStatement_3 = "SELECT MAX(loan.RefNo) FROM loan"; MySqlCommand cmd3 = new MySqlCommand(MysqlStatement_3, con); MySqlDataReader rdr = cmd3.ExecuteReader(); while (rdr.Read()) { refNo = (int)rdr.GetValue(0) + 1; } refNoLbl.Text = refNo.ToString(); rdr.Close(); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void hideAllPanels() { AddDebtorLbl.Hide(); AddloanLbl.Hide(); DebtorListLbl.Hide(); ReportLbl.Hide(); btnReports.BackColor = DefaultBackColor; btnReports.ForeColor = DefaultForeColor; btnDebtorList.BackColor = DefaultBackColor; btnDebtorList.ForeColor = DefaultForeColor; btnAddNewDebtor.BackColor = DefaultBackColor; btnAddNewDebtor.ForeColor = DefaultForeColor; panelDebtorsList.Visible = false; panelAddNewDebtor.Visible = false; panelHome.Visible = false; panelReport.Visible = false; panelAddLoanDetails.Visible = false; }