private void btketnoi_Click(object sender, EventArgs e) { if (txttensv.Text == "") { MessageBox.Show("Chưa chọn tên của máy chủ SQL.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (txttencsdl.Text == "") { MessageBox.Show("Chưa chọn tên cơ sở dữ liệu.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (txttencsdl.Text == "QuanLyQuanCaPhe") { string maychu = duongdan + @"\DatabaseCafe\tenmaychu.txt"; string csdl = duongdan + @"\DatabaseCafe\tencsdl.txt"; File.WriteAllText(maychu, txttensv.Text); File.WriteAllText(csdl, txttencsdl.Text); string s = duongdan + @"\DatabaseCafe\xacnhandaketnoi.txt"; File.WriteAllText(s, "daketnoi"); Home h = new Home(); this.Hide(); h.ShowDialog(); } else { MessageBox.Show("Cơ sở dữ liệu của chương trình là : 'QuanLyQuanCaPhe'.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void MNT_DANGXUAT_Click(object sender, EventArgs e) { this.Hide(); Home h = new Home(); h.ShowDialog(); Application.Exit(); }