private void btnLuu_Click(object sender, EventArgs e) { try { string path = Application.StartupPath + "\\database.txt"; if (FileInOut.LuuFile(sanPhams, path)) { MessageBox.Show("Lưu thành công!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnDoc_Click(object sender, EventArgs e) { try { string path = Application.StartupPath + "\\database.txt"; if (System.IO.File.Exists(path)) { sanPhams = FileInOut.DocFile(path); hienThiSanPham(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }