public void LoadDuLieu() { frmProgress.Instance.Caption = Text; frmProgress.Instance.Description = "Đang nạp dữ liệu"; frmProgress.Instance.Value = 0; frmProgress.Instance.MaxValue = 6; liChiTiet.Clear(); dgvChiTiet.RefreshDataSource(); frmProgress.Instance.Value += 1; MaTrungTam = GetMaTrungTam(); frmProgress.Instance.Value += 1; MaKho = GetMaKho(); frmProgress.Instance.Value += 1; if (!dteLastSync.InvokeRequired) { dteLastSync.DateTime = SanXuatLenhProvier.GetMaxDateSanXuatLenh(MaTrungTam); } else { Invoke( (MethodInvoker) delegate { dteLastSync.DateTime = SanXuatLenhProvier.GetMaxDateSanXuatLenh(MaTrungTam); }); } frmProgress.Instance.Value += 1; liChiTiet.AddRange(SanXuatLenhProvier.GetRecentSanXuatLenh(txtMaLenhSX.Text, MaKho, MaTrungTam, "NXDM")); frmProgress.Instance.Value += 1; CheckTrangthai(); frmProgress.Instance.Value += 1; dgvChiTiet.RefreshDataSource(); frmProgress.Instance.Description = "Đã xong"; frmProgress.Instance.Value = frmProgress.Instance.MaxValue; frmProgress.Instance.IsCompleted = true; }
public void Reload() { liChiTiet.Clear(); liChiTiet.AddRange(SanXuatLenhProvier.GetRecentSanXuatLenh(txtMaLenhSX.Text, MaKho, MaTrungTam, "LSX")); CheckTrangthai(); dgvChiTiet.RefreshDataSource(); }