📄 temporarystocklist.cpp
字号:
#include "StdAfx.h"
#include "TemporaryStockList.h"
using namespace FAP;
void TemporaryStockList::GetGrid(String* strPOS){
String * strSQL ;
DataSet *dSetPro;
DataTable *tblTmp;
String * strLang[]={S"C",S"J",S"E"};
//DateTime dteTmp1;
strSQL = S"";
strSQL =String::Concat(strSQL, S"select b.name_",strLang[infTempStockList->intLang],S" as STOCK_POS1,a.PRODUCT_CODE,a.STOCK_TYPE,(a.STOCK_QTY - nvl(c.return_qty,0)) as STOCK_QTY,a.LOT from stock_data a left outer join cost_mst b on a.stock_pos = b.process_no ");
strSQL =String::Concat(strSQL, S" left outer join (select sum(return_qty) as return_qty,stock_ymd,product_code,lot,origin_code from return_data c ");
strSQL =String::Concat(strSQL, S" where stock_ymd is null ");
strSQL =String::Concat(strSQL, S" group by product_code,lot,origin_code,stock_ymd) c on ");
strSQL =String::Concat(strSQL, S" a.product_code=c.product_code ");
strSQL =String::Concat(strSQL, S" and a.lot=c.lot ");
strSQL =String::Concat(strSQL, S" and a.stock_pos=c.origin_code ");
strSQL =String::Concat(strSQL, S" and (a.lot is not null) ");
strSQL =String::Concat(strSQL, S" where ");
strSQL =String::Concat(strSQL, S" a.stock_type = 2 and a.STOCK_QTY >0 and (a.lot is not null) ");
strSQL = String::Concat(strSQL," and a.stock_pos = '",strPOS,"'");
dbTempStockList->blnCnnOpen();
dSetPro=dbTempStockList->dSetSQL_Select(strSQL,S"TempStock",0);
//DBGridPrd->SetDataBinding(dSetPro, S"ProductSchedule");
tblTmp = dSetPro->Tables->Item[S"TempStock"];
dGridStock->DataSource = tblTmp;
dbTempStockList->blnCnnClose();
}
void TemporaryStockList::InitGrid(int intLang){
//DataGridTextBoxColumn *oYMD;
DataGridTextBoxColumn *oProCode;
DataGridTextBoxColumn *oProcess;
DataGridTextBoxColumn *oQTY;
DataGridTextBoxColumn *oLot;
DataGridTableStyle *oTableStyle = new DataGridTableStyle();
oTableStyle->MappingName = S"TempStock";
//oYMD
//oYMD = new DataGridTextBoxColumn();
//oYMD->MappingName = S"YMD";
//oYMD->HeaderText = infTempStockList->saPROYMD [intLang];
//oYMD->Alignment = HorizontalAlignment::Center;
//oYMD->Width = 150;
//oYMD->ReadOnly = true;
//oYMD->NullText = S"";
//oProCode
oProCode = new DataGridTextBoxColumn();
oProCode->MappingName = S"PRODUCT_CODE";
oProCode->HeaderText = infTempStockList->saSAPPRODUCT_CODE[intLang];
oProCode->Alignment = HorizontalAlignment::Center;
oProCode->Width =260;
oProCode->ReadOnly = true;
oProCode->NullText =S"";
//oProcess
oProcess = new DataGridTextBoxColumn();
oProcess->MappingName = S"STOCK_POS1";
oProcess->HeaderText = infTempStockList->saG_StrArrayWorkingProcedure[intLang];
oProcess->Alignment = HorizontalAlignment::Center;
oProcess->Width = 320;
oProcess->ReadOnly = true;
oProcess->NullText =S"";
//oQTY
oQTY = new DataGridTextBoxColumn();
oQTY->MappingName = S"STOCK_QTY";
oQTY->HeaderText = infTempStockList->saG_QTY[intLang];
oQTY->Alignment = HorizontalAlignment::Center;
oQTY->Width = 180;
oQTY->ReadOnly = false;
oQTY->NullText = S"";
//oLot
oLot = new DataGridTextBoxColumn();
oLot->MappingName = S"Lot";
oLot->HeaderText = infTempStockList->saLot[intLang];
oLot->Alignment = HorizontalAlignment::Center;
oLot->Width = 200;
oLot->ReadOnly = false;
oLot->NullText = S"";
//oTableStyle->GridColumnStyles->Add(oYMD);
oTableStyle->GridColumnStyles->Add(oProCode);
oTableStyle->GridColumnStyles->Add(oProcess);
oTableStyle->GridColumnStyles->Add(oQTY);
oTableStyle->GridColumnStyles->Add(oLot);
dGridStock->TableStyles->Add(oTableStyle);
dGridStock->AlternatingBackColor = System::Drawing::Color::IndianRed;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -