private void PrepareDTable(string KeyCode) { DataTable _DT = ComExportToExcel.GetXYDetailDataTable(KeyCode); IQueryable <V_Ware_Report_Stocks_Lens_Detail> _Rs = this.ObjectContext.V_Ware_Report_Stocks_Lens_Detail; _Rs = _Rs.Where(item => item.WhCode + item.LensCode + item.F_LR == KeyCode); bool _F_Read = false; _Rs.ToList().ForEach(item => { if (!@_F_Read) { _WhCode = item.WhCode; _LensCode = item.LensCode; _F_LR = item.F_LR; var _RsLes = this.ObjectContext.V_B_Material_Lens.Where(it => it.LensCode == _LensCode).FirstOrDefault(); _F_CA = _RsLes == null ? false : _RsLes.F_CA == true; _F_Read = true; } _DT.Rows.Add(item.SPH, item.CYL, item.X_ADD, item.Stocks); }); var _DT2 = this.InitDataTable(_DT); _DS.Tables.Add(_DT2); }
private void PrepareBSDT(string KeyCode) { DataTable _DT = ComExportToExcel.GetXYDetailDataTable(_WhCode + _LensCode + _F_LR); IQueryable <V_Ware_Stocks_Base_Lens_Detail> _Rs = this.ObjectContext.V_Ware_Stocks_Base_Lens_Detail; _Rs = _Rs.Where(item => item.ID == KeyCode); _Rs.ToList().ForEach(item => { _DT.Rows.Add(item.SPH, item.CYL, item.X_ADD, item.Qty); }); var _DT2 = this.InitBSDT(_DT); _DS.Tables.Add(_DT2); }
// private void PrepareXSPDDT(V_Sale_Order_PD model) { DataTable _DT = ComExportToExcel.GetXYDetailDataTable(model.BCode); IQueryable <V_Sale_Order_PD_Detail> _Rs = this.ObjectContext.V_Sale_Order_PD_Detail; _Rs = _Rs.Where(item => item.ID == model.ID); _Rs.ToList().ForEach(item => { _DT.Rows.Add(item.SPH, item.CYL, item.X_ADD, item.Qty); }); var _DT2 = this.InitXSPDDT(_DT, model); _DS.Tables.Add(_DT2); }