private void bunifuFlatButton1_Click(object sender, EventArgs e) { var listTables = CurrentDatabase.getInstance().getAllTables(); string connectionString = CurrentDatabase.getInstance().connectionString; if (listTables.Count > 0) { foreach (var table in listTables) { FormRoot readForm = FormFactory.getForm(FormType.READ, connectionString, table); readForm.ShowForm(); FormRoot createForm = FormFactory.getForm(FormType.CREATE, connectionString, table); createForm.ShowForm(); FormRoot updateForm = FormFactory.getForm(FormType.UPDATE, connectionString, table); updateForm.ShowForm(); FormRoot deleteForm = FormFactory.getForm(FormType.DELETE, connectionString, table); deleteForm.ShowForm(); } } else { MessageBox.Show("Cơ sở dữ liệu rỗng !!!", "Thông báo"); } }
private void bunifuFlatButton1_Click(object sender, EventArgs e) { try { this.Hide(); CurrentDatabase currentDatabase = CurrentDatabase.getInstance(); currentDatabase.connectionString = string.Format(@"Data Source=.;Initial Catalog={0};Integrated Security=True", bunifuDropdown1.selectedValue); Form login = new Login(); login.Show(); } catch (Exception ex) { MessageBox.Show("Vui lòng chọn Database !!!"); } }
public Register() { InitializeComponent(); membership = new Memberships(CurrentDatabase.getInstance().connectionString); }