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

📄 loadcontainerlocation.cpp

📁 码头手持机项目,用于统计集装箱,轮船的情况,手持机采用S3C2440处理器,数据传输采用2.4G无线,上位机用VC编写
💻 CPP
📖 第 1 页 / 共 5 页
字号:
    UpdateData(true);
    m_containerPosition = m_1006.position;
	m_containerNo = m_1006.containerNo;
	GobjectId = m_1006.objectId;
	m_1006.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1007() 
{
    // TODO: Add your control notification handler code here
    UpdateData(true);
    m_containerPosition = m_1007.position;
	m_containerNo = m_1007.containerNo;
	GobjectId = m_1007.objectId;
	m_1007.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1008() 
{
    // TODO: Add your control notification handler code here
    UpdateData(true);
    m_containerPosition = m_1008.position;
	m_containerNo = m_1008.containerNo;
	GobjectId = m_1008.objectId;
	m_1008.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1009() 
{
    // TODO: Add your control notification handler code here
    UpdateData(true);
    m_containerPosition = m_1009.position;
	m_containerNo = m_1009.containerNo;
	GobjectId = m_1009.objectId;
	m_1009.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1010() 
{
    // TODO: Add your control notification handler code here
    UpdateData(true);
    m_containerPosition = m_1010.position;
	m_containerNo = m_1010.containerNo;
	GobjectId = m_1010.objectId;
	m_1010.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1011() 
{
    // TODO: Add your control notification handler code here
    UpdateData(true);
    m_containerPosition = m_1011.position;
	m_containerNo = m_1011.containerNo;
	GobjectId = m_1011.objectId;
	m_1011.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1012() 
{
    // TODO: Add your control notification handler code here
    UpdateData(true);
    m_containerPosition = m_1012.position;
	m_containerNo = m_1012.containerNo;
	GobjectId = m_1012.objectId;
	m_1012.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::OnButton1() 
{
	// TODO: Add your control notification handler code here
	/////////////////////////////////////////////////////////////////////////////////////
    if (!socketconnect)
    {
		MessageBox(_T("与服务器连接中断,请检查网络后重新登录该系统!"),_T("出错提示"));
		return;
    }
	/////////////////////////////////////////////////////////////////////////////////////
	
	UpdateData(true);
	
    CString LLCSSQL = _T("");
	int iSize = 0;
	char* pszMultiByte;
	int retint=0;
	
	if(m_containerPosition == VT_EMPTY){
		MessageBox(_T("请先选择箱体位置!!!"),_T("出错提示"));
		return;
	}
	
	if(GobjectId != " "){
		MessageBox(_T("该箱体位置已经理货!!!"),_T("出错提示"));
        GobjectId = _T("");
		UpdateData(false);
		return;
	}

	//判断40尺跨Bay的情况;
	///////////////////////////////////////////////////////////////////////////////
    //
	///////////////////////////////////////////////////////////////////////////////
	
	LLCSSQL = _T("");
    LLCSSQL = "select objectId from bayItemPlan where tallyListItemObjId = '"+tallyListItemObjectId+"'"; 
	LLCSSQL="   "+LLCSSQL+'\0';
	
	iSize = WideCharToMultiByte(CP_ACP, 0, LLCSSQL, -1, NULL, 0, NULL, NULL);
	pszMultiByte = (char*)malloc((iSize+1)*sizeof(char));
	WideCharToMultiByte(CP_ACP, 0, LLCSSQL, -1, pszMultiByte, iSize, NULL, NULL);
	*pszMultiByte=3;
	pszMultiByte++;
	*pszMultiByte=iSize/256;
	pszMultiByte++;
	*pszMultiByte=iSize%256;
	pszMultiByte=pszMultiByte-2;
	
	int mint=send(clientSocket,pszMultiByte,iSize,0);
	free(pszMultiByte);
	delete pszMultiByte;
	
    retint=recv(clientSocket,recvbuf2,sizeof(recvbuf2),0);
	if (recvbuf2[0]==8 && retint==1)
	{
        MessageBox(_T("网络传输出错,请重新点击按钮再试一次!!!"),_T("提示"));
		return;
	}
	if (recvbuf2[0]!=27){
		MessageBox(_T("该箱号已经理货!!!"),_T("出错提示"));
		UpdateData(false);
		return;
	}
	
	//update bayItemPlan begin
	LLCSSQL = _T("");
	//LLCSSQL = " where a.bayFrameObjId = b.masterObjId and c.isoCodeObjId = d.objectId  and a.objectId = '"+objectId+"' and b.position = '"+m_containerPosition+"' and c.objectId = '"+tallyListItemObjectId+"'";	
	//LLCSSQL = " insert into bayitemplan select b.objectId,a.objectId,b.objectId,c.containerNo,c.sealNo,c.placeOfReceiptObjId,c.portOfDischargeObjId,c.placeOfDeliveryObjId,d.containerSize+d.containerType,c.containerStatus,c.cargoWeight,c.tareWeight,c.remark,c.objectId from bayplan a,bayGridFrame b,tallyListItem c,isoCode d  where a.bayFrameObjId = b.masterObjId and c.isoCodeObjId = d.objectId  and a.objectId = '"+objectId+"' and b.position = '"+m_containerPosition+"' and c.objectId = '"+tallyListItemObjectId+"'" ;
	LLCSSQL = " insert into bayitemplan select c.objectId,a.objectId,b.objectId,c.containerNo,c.sealNo,c.placeOfReceiptObjId,c.portOfDischargeObjId,c.placeOfDeliveryObjId,d.containerSize+d.containerType,c.containerStatus,c.cargoWeight,c.tareWeight,c.remark,c.objectId from bayplan a,bayGridFrame b,tallyListItem c,isoCode d  where a.bayFrameObjId = b.masterObjId and c.isoCodeObjId = d.objectId  and a.objectId = '"+objectId+"' and b.position = '"+m_containerPosition+"' and c.objectId = '"+tallyListItemObjectId+"'" ;
	LLCSSQL="   "+LLCSSQL+'\0';
	
	iSize = WideCharToMultiByte(CP_ACP, 0, LLCSSQL, -1, NULL, 0, NULL, NULL);
	pszMultiByte = (char*)malloc((iSize+1)*sizeof(char));
	WideCharToMultiByte(CP_ACP, 0, LLCSSQL, -1, pszMultiByte, iSize, NULL, NULL);
	*pszMultiByte=1;
	pszMultiByte++;
	*pszMultiByte=iSize/256;
	pszMultiByte++;
	*pszMultiByte=iSize%256;
	pszMultiByte=pszMultiByte-2;
	
	send(clientSocket,pszMultiByte,iSize,0);
	free(pszMultiByte);
	delete pszMultiByte;
	
	retint=recv(clientSocket,recvbuf2,sizeof(recvbuf2), 0);
	if (recvbuf2[0]==8 && retint==1)
	{
        MessageBox(_T("网络传输出错,请重新点击按钮再试一次!!!"),_T("提示"));
		return;
	}
	//update bayItemPlan end
	
	//update tallyListItem begin
	LLCSSQL = _T("");
	LLCSSQL = "update tallylistitem set checkedFlag = '1',workDate = '"+workDate+"',workOrders = '"+workOrders+"'  where objectId='"+tallyListItemObjectId+"'";	
	LLCSSQL="   "+LLCSSQL+'\0';
	
	iSize = WideCharToMultiByte(CP_ACP, 0, LLCSSQL, -1, NULL, 0, NULL, NULL);
	pszMultiByte = (char*)malloc((iSize+1)*sizeof(char));
	WideCharToMultiByte(CP_ACP, 0, LLCSSQL, -1, pszMultiByte, iSize, NULL, NULL);
	*pszMultiByte=1;
	pszMultiByte++;
	*pszMultiByte=iSize/256;
	pszMultiByte++;
	*pszMultiByte=iSize%256;
	pszMultiByte=pszMultiByte-2;
	
	send(clientSocket,pszMultiByte,iSize,0);
	free(pszMultiByte);
	delete pszMultiByte;
	
	retint=recv(clientSocket,recvbuf2,sizeof(recvbuf2), 0);
	if (recvbuf2[0]==8 && retint==1)
	{
        MessageBox(_T("网络传输出错,请重新点击按钮再试一次!!!"),_T("提示"));
		return;
	}
	
	m_containerNo = _T("");
	m_containerPosition = _T("");
    GobjectId = _T("");
    UpdateData(false);
	
	CDialog::OnCancel();
}

void LoadContainerLocation::OnButton4() 
{
	// TODO: Add your control notification handler code here
	/////////////////////////////////////////////////////////////////////////////////////
    if (!socketconnect)
    {
		MessageBox(_T("与服务器连接中断,请检查网络后重新登录该系统!"),_T("出错提示"));
		return;
    }
	/////////////////////////////////////////////////////////////////////////////////////
	
	UpdateData(true);
	
    if(m_containerPosition == VT_EMPTY){
		MessageBox(_T("请先选择箱体位置!!!"),_T("出错提示"));
		return;
	}
	
	if(GobjectId == " "){
		MessageBox(_T("该箱体位置没有理货,不能取消!!!"),_T("出错提示"));
        GobjectId = _T("");
		UpdateData(false);
		return;
	}
	
	CString LLCLSQL;
	int iSize;
	char* pszMultiByte;
	int retint=0;
	
	LLCLSQL = _T("");
    LLCLSQL = "delete from bayItemPlan where objectId = '"+GobjectId+"'";	
	LLCLSQL="   "+LLCLSQL+'\0';
	
	iSize = WideCharToMultiByte(CP_ACP, 0, LLCLSQL, -1, NULL, 0, NULL, NULL);
	pszMultiByte = (char*)malloc((iSize+1)*sizeof(char));
	WideCharToMultiByte(CP_ACP, 0, LLCLSQL, -1, pszMultiByte, iSize, NULL, NULL);
	*pszMultiByte=1;
	pszMultiByte++;
	*pszMultiByte=iSize/256;
	pszMultiByte++;
	*pszMultiByte=iSize%256;
	pszMultiByte=pszMultiByte-2;
	
	send(clientSocket,pszMultiByte,iSize,0);
	free(pszMultiByte);
	delete pszMultiByte;
	
	retint=recv(clientSocket,recvbuf2,sizeof(recvbuf2), 0);
	if (recvbuf2[0]==8 && retint==1)
	{
        MessageBox(_T("网络传输出错,请重新点击按钮再试一次!!!"),_T("提示"));
		return;
	}
	
	LLCLSQL =  _T("");
    LLCLSQL = "update  tallyListItem set checkedFlag = '0',workDate = '',workOrders = '' where objectId='"+tallyListItemObjectId+"'";	
	LLCLSQL="   "+LLCLSQL+'\0';
	
	iSize = WideCharToMultiByte(CP_ACP, 0, LLCLSQL, -1, NULL, 0, NULL, NULL);
	pszMultiByte = (char*)malloc((iSize+1)*sizeof(char));
	WideCharToMultiByte(CP_ACP, 0, LLCLSQL, -1, pszMultiByte, iSize, NULL, NULL);
	*pszMultiByte=1;
	pszMultiByte++;
	*pszMultiByte=iSize/256;
	pszMultiByte++;
	*pszMultiByte=iSize%256;
	pszMultiByte=pszMultiByte-2;
	
	send(clientSocket,pszMultiByte,iSize,0);
	free(pszMultiByte);
	delete pszMultiByte;
	
	retint=recv(clientSocket,recvbuf2,sizeof(recvbuf2), 0);
	if (recvbuf2[0]==8 && retint==1)
	{
        MessageBox(_T("网络传输出错,请重新点击按钮再试一次!!!"),_T("提示"));
		return;
	}
	
	m_containerNo = _T("");
	m_containerPosition = _T("");
    GobjectId = _T("");
    UpdateData(false);
	
	CDialog::OnCancel();
}

void LoadContainerLocation::OnButton5() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	modify = false;
	m_containerNo = _T("");
	m_containerPosition = _T("");
    GobjectId = _T("");
    UpdateData(false);
	CDialog::OnCancel();
}

void LoadContainerLocation::On1101() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1101.position;
	m_containerNo = m_1101.containerNo;
	GobjectId = m_1101.objectId;
	m_1101.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1102() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1102.position;
	m_containerNo = m_1102.containerNo;
	GobjectId = m_1102.objectId;
	m_1102.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1103() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1103.position;
	m_containerNo = m_1103.containerNo;
	GobjectId = m_1103.objectId;
	m_1103.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1104() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1104.position;
	m_containerNo = m_1104.containerNo;
	GobjectId = m_1104.objectId;
	m_1104.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1105() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1105.position;
	m_containerNo = m_1105.containerNo;
	GobjectId = m_1105.objectId;
	m_1105.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1106() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1106.position;
	m_containerNo = m_1106.containerNo;
	GobjectId = m_1106.objectId;
	m_1106.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1107() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1107.position;
	m_containerNo = m_1107.containerNo;
	GobjectId = m_1107.objectId;
	m_1107.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1108() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1108.position;
	m_containerNo = m_1108.containerNo;
	GobjectId = m_1108.objectId;
	m_1108.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1109() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1109.position;
	m_containerNo = m_1109.containerNo;
	GobjectId = m_1109.objectId;
	m_1109.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1110() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1110.position;
	m_containerNo = m_1110.containerNo;
	GobjectId = m_1110.objectId;
	m_1110.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1111() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1111.position;
	m_containerNo = m_1111.containerNo;
	GobjectId = m_1111.objectId;
	m_1111.stateflag = true;
    UpdateData(false);
}

void LoadContainerLocation::On1112() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
    m_containerPosition = m_1112.position;
	m_containerNo = m_1112.containerNo;
	GobjectId = m_1112.objectId;
	m_1112.stateflag = true;
    UpdateData(false);
}

⌨️ 快捷键说明

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