private void frmDanhSachTachThanhPhamSX_Load(object sender, EventArgs e) { clsUtils.NullColumnDateTimeGrid(repdtngaylap); btnChiTiet.Text = Resources.btnInfor; MaTrungTam = GetMaTrungTam(); MaKho = GetMaKho(); dteLastSync.DateTime = SanXuatLenhProvier.GetMaxDateSanXuatLenh(MaTrungTam); liChiTiet = SanXuatNhapTachDataProvider.Instance.GetListAllSanXuatNhapTach(Convert.ToInt32(LoaiGiaoDichSanXuat.TACH_THANH_PHAM_SAN_XUAT), Convert.ToInt32(TransactionType.XUAT_LINK_KIEN_SX), MaTrungTam, 2); for (int i = 0; i < liChiTiet.Count; i++) { liChiTiet[i].SoLuongHT = SanXuatLenhProvier.GetSoLuongChungTu( Convert.ToInt32(TransactionType.XUAT_THANH_PHAM), liChiTiet[i].MaLenh, 1, liChiTiet[i].TransactionID.ToString()); } for (int i = 0; i < liChiTiet.Count; i++) { if (liChiTiet[i].SoLuongHT == 0) { liChiTiet[i].TenTrangThai = "Chờ tách"; } if (liChiTiet[i].SoLuongHT > 0 && liChiTiet[i].SoLuongHT < liChiTiet[i].SoLuongYC) { liChiTiet[i].TenTrangThai = "Đang tách"; } if (liChiTiet[i].SoLuongHT == liChiTiet[i].SoLuongYC) { liChiTiet[i].TenTrangThai = "Đã tách xong"; } } dgvChiTiet.DataSource = liChiTiet; }
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; }
private void frmDanhSachNhapComBo_Load(object sender, EventArgs e) { btnTim.Visible = false; clsUtils.NullColumnDateTimeGrid(repdtngaylap); LoadTrangthai(); btnTim.Text = Resources.btnSearch; btnChiTiet.Text = Resources.btnInfor; MaTrungTam = GetMaTrungTam(); MaKho = GetMaKho(); dteLastSync.DateTime = SanXuatLenhProvier.GetMaxDateSanXuatLenh(MaTrungTam); //LoadDateTime(); liChiTiet = SanXuatLenhProvier.GetAllSanXuatLenh(MaKho, MaTrungTam, "GHEPMA"); CheckTrangthai(); dgvChiTiet.DataSource = liChiTiet; }