public FormMain() { _donViService = new DonViService(); _danhMucSanPhamService = new DanhMucSanPhamService(); _soLieuNhapLieuService = new SoLieuNhapLieuService(); _phienNhapLieuService = new PhienNhapLieuService(); _phienNhapLieu = new PhienNhapLieu() { Id = Guid.NewGuid().ToString(), NgayNhapLieu = DateTime.Now, TenGoiNho = $"PhienNhapLieu_{DateTime.Now.ToString("yyyy MMMM dd HH:mm")}" }; _phienNhapLieuService.Insert(_phienNhapLieu); _soHoaDon = _soLieuNhapLieuService.GetCurrentMaHD(); InitializeComponent(); comboBoxLoaiPhi.SelectedIndex = 0; if (_soHoaDon > 0) { textBoxSHD.Text = (_soHoaDon + 1).ToString(); } labelQuanLyMaDonVi.Text = string.Empty; LoadDonVis(); labelQuanLyMaSPEdit.Text = string.Empty; LoadSanPhams(); comboBoxLoaiPhi.SelectedIndex = 0; LoadAllMainData(); LoadSanPhams(); }