⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 productresultcheck.cpp

📁 这是一个工厂的生产线的仓库管理.有计划,实绩,库存等
💻 CPP
字号:
#include "StdAfx.h"
#include "ProductResultCheck.h"

using namespace FAP;


void ProductResultCheck::InitProductResultCheck(int intlanguage,int intlong)
{


	//String* saLang[]   = {S"c", S"j", S"e"};

	String * strFdName;

	String *vstrDate1;
	vstrDate1=String::Format("{0:yyyyMMdd}",__box(DateTime::Today));

	switch(intlanguage) {
		case 0:
			strFdName = S"name_c";			
			break;
		case 1:
			strFdName = S"name_j";
			break;
		case 2:
			strFdName = S"name_e";
			break;
		default:
			strFdName = S"name_c";

	}

	String*		sSQL = S"";
	sSQL = String::Concat(sSQL,S" select "															);
	//sSQL = String::Concat(sSQL,			S" line.line_name, "										);
	sSQL = String::Concat(sSQL,			S" case  when NVL(to_char(resu.ymd,'yyyy-mm-dd'),'  ')='  ' then CONCAT(trim(line.line_name),'  ')  else line.line_name end as line_name,  "										);
	//sSQL = String::Concat(sSQL,			S" cost.name_", saLang[iLanguage] ,S" as COST_NAME, "								);
	


	sSQL = String::Concat(sSQL,			S" case  when NVL(to_char(resu.ymd,'yyyy-mm-dd'),'  ')='  ' then CONCAT(trim(cost.",strFdName,S"),'  ')  else  cost.",strFdName,S"  end as COST_NAME, "								);
	//sSQL = String::Concat(sSQL,			S" sche.shift, "											);
	sSQL = String::Concat(sSQL,			S" case  when NVL(to_char(resu.ymd,'yyyy-mm-dd'),'  ')='  ' then  CONCAT(trim(sche.shift),'  ') else  sche.shift end as shift, "											);
	sSQL = String::Concat(sSQL,			S" NVL(to_char(resu.ymd,'yyyy-mm-dd'),'  ') as ymd "		);
	sSQL = String::Concat(sSQL,S" from "															);
	sSQL = String::Concat(sSQL,			S" product_schedule sche, "									);
	sSQL = String::Concat(sSQL,			S" product_result_data resu, "								);
	sSQL = String::Concat(sSQL,			S" line_mst line, "											);
	sSQL = String::Concat(sSQL,			S" cost_mst cost "											);
	sSQL = String::Concat(sSQL,S" where "															);
	sSQL = String::Concat(sSQL,			S" sche.ymd = resu.ymd(+) and "								);
	sSQL = String::Concat(sSQL,			S" sche.lot = resu.lot(+) and "								);
	sSQL = String::Concat(sSQL,			S" sche.process_no = resu.process_no(+) and "				);
	sSQL = String::Concat(sSQL,			S" sche.line_code = line.line_code and "					);
	sSQL = String::Concat(sSQL,			S" sche.process_no = cost.process_no(+) " 					);
	if (intlong==0)
	{
		sSQL = String::Concat(sSQL,			S" and sche.ymd=to_date('",vstrDate1,S"','YYYYMMDD')"	);
	}
	else
	{	
		sSQL = String::Concat(sSQL,			S" and sche.ymd>=to_date('",dateTimePickerFrom->Text,S"','YYYY-MM-DD')"	);
		sSQL = String::Concat(sSQL,			S" and sche.ymd<=to_date('",dateTimePickerTo->Text,S"','YYYY-MM-DD')"	);
	}

	
	oDataSet=oDB->dSetSQL_Select(sSQL, "DataTablePRC", 0);
	

	oDataView= oDataSet->Tables->Item[S"DataTablePRC"]->DefaultView;
	oDataView->AllowNew	= false; 
	oDataView->AllowEdit= false; 
	
	dataGridPrcheck->DataSource = oDataSet->Tables->Item[S"DataTablePRC"]->DefaultView;



}
 void ProductResultCheck::InitGridPrcheck(void)
 {
	RowColorDataGridTextBoxColumn *oLineName;
	RowColorDataGridTextBoxColumn *oCostName;
	RowColorDataGridTextBoxColumn *oShift;
	RowColorDataGridTextBoxColumn *oDate;


	
	oTableStyle			= new DataGridTableStyle();
	oTableStyle->MappingName	= S"DataTablePRC";
	//oLineName
	oLineName						= new RowColorDataGridTextBoxColumn();
	oLineName->MappingName			= S"line_name";
	oLineName->HeaderText			= oInf->saG_LineName[iLanguage];
	oLineName->Alignment			= HorizontalAlignment::Center;
	oLineName->Width				= 100;
	//oCostName
	oCostName						= new RowColorDataGridTextBoxColumn();
	oCostName->MappingName			= S"COST_NAME";
	oCostName->HeaderText			=  oInf->saG_StrArrayWorkingProcedure[iLanguage];
	oCostName->Alignment			= HorizontalAlignment::Center;
	oCostName->Width				= 400;
	//oShift
	String * oqqqShift[]={S"勤务",S"勤務",S"Shift"};
	oShift							= new RowColorDataGridTextBoxColumn();
	oShift->MappingName				= S"shift";
	oShift->HeaderText				= oqqqShift[iLanguage];//oInf->saG_StrArrayLaborShift[iLanguage];
	oShift->Alignment				= HorizontalAlignment::Center;
	oShift->Width					= 190;
	//oDate
	oDate							= new RowColorDataGridTextBoxColumn();
	oDate->MappingName				= S"ymd";
	oDate->HeaderText				=oInf->saG_StrArrayProductionResultDate[iLanguage];
	oDate->Alignment				= HorizontalAlignment::Center;
	oDate->Width					= 230;
	
	oTableStyle->GridColumnStyles->Add(oLineName);
	oTableStyle->GridColumnStyles->Add(oCostName);
	oTableStyle->GridColumnStyles->Add(oShift);
	oTableStyle->GridColumnStyles->Add(oDate);
	dataGridPrcheck->TableStyles->Add(oTableStyle);

 }
void RowColorDataGridTextBoxColumn::Paint(Graphics *g, Rectangle bounds, CurrencyManager *source, int rowNum, Brush *backBrush, Brush *foreBrush, bool alignToRight)
{
	String*	sBuf;
	int tempLength;
	Object* cellValue = this->GetColumnValueAtRow(source, rowNum);
	if(cellValue != NULL){
		sBuf = dynamic_cast<String*>(cellValue);
		tempLength=(sBuf->Length)-2;
		if(tempLength<0)
			tempLength=0;
		if(String::Compare(sBuf,tempLength, "  ",0,2) == 0){
		
			backBrush = new SolidBrush(System::Drawing::Color::IndianRed );
			}
		}
	
	System::Windows::Forms::DataGridTextBoxColumn::Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -