private void LoadCboTaiKhoan() { DataTable dt = new DataTable(); dt = bd.LayTaiKhoanChoCbo(ref err, ref rows); if (dt.Rows.Count > 0) { cboTaiKhoan.DataSource = dt; cboTaiKhoan.ValueMember = "MaTaiKhoan"; cboTaiKhoan.DisplayMember = "TenTaiKhoan"; cboTaiKhoan.SelectedIndex = 0; statusLoadcbo = true; } else { DialogResult result = MessageBox.Show("Chưa có tài khoản\nXin vui lòng tạo loại tài khoản", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (result == DialogResult.OK) { Frm_TaiKhoan_Main frmTaiKhoan = new Frm_TaiKhoan_Main(); frmTaiKhoan.ShowDialog(); LoadCboTaiKhoan(); } else { this.Close(); } } }
private void button1_Click(object sender, EventArgs e) { Frm_TaiKhoan_Main frmTaiKhoan = new Frm_TaiKhoan_Main(); frmTaiKhoan.ShowDialog(); LoadCboTaiKhoan(); }
private void mnuQuanLyTaiKhoan_Click(object sender, EventArgs e) { Frm_TaiKhoan_Main frmTaiKhoan = new Frm_TaiKhoan_Main(); frmTaiKhoan.ShowDialog(); }