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

📄 stocklist.h

📁 这是一个工厂的生产线的仓库管理.有计划,实绩,库存等
💻 H
📖 第 1 页 / 共 5 页
字号:
			String *strProCode;
			String *strStoreCode;
			String *strScheNum;

			if (iflag==0){
				return;
			}


			
			//按搜索按钮时没有选中则搜索框里选

			if (iflag==1){
				strProCode = txtProCode->Text->Trim();
			}
			else{
				intPos = (trvBOM->SelectedNode->Text)->IndexOf(S" ");
				strProCode = (trvBOM->SelectedNode->Text)->Substring(intPos + 2)->Trim();
			}
			
			if(!dbStockList->blnCnnOpen())
			{
				MessageBox::Show(S"Connect Oracle Failed!!");
				return;
			}
			
			if (strProCode->CompareTo(S"")==0) 
			{String *msg[]={S"请输入正确的产品代码!!",S"製品コードを入力してください!!",S"Please Input Product Code!!"};
				MessageBox::Show(msg[infStockList->intLang]);
				return;
			}

			int k;
			//k=dGridStockList->CurrentRowIndex;
			k= __try_cast<DataView*>(dGridStockList->DataSource)->Count;

			if (k==0){
				String *msg[]={S"没有数据,不能更新",S"データがありません、更新ができません!!",S"Data is Null,Cant't Update!!"};
              MessageBox::Show(msg[infStockList->intLang]);
				
				return;
			}
			
			dbStockList->blnBeginTrans();

			for (int i = 0; i< __try_cast<DataView*>(dGridStockList->DataSource)->Count;i++)  
			{							
				//Check Input
				strModify =Convert::ToString( dGridStockList->get_Item(i,3));

				if (strModify->Trim()->CompareTo(S"")==0) {
					continue;
				}

				try{
					double sngtmp = Convert::ToDouble(strModify);

				}
				catch(Exception *){
					String *msg[]={S"请输入数字",S"数字を入力してください!!",S"Please Input Number!!"};
					 MessageBox::Show(msg[infStockList->intLang]);
					dGridStockList->CurrentCell = DataGridCell(i,3);
					dbStockList->blnRollBack();
					dbStockList->blnCnnClose();
					//MessageBox::Show(S"更新失败!!");
					return;					
				}

				
				strLot = Convert::ToString( dGridStockList->get_Item(i,1));
				strStoreCode = Convert::ToString( dGridStockList->get_Item(i,4));
				strScheNum = Convert::ToString(dGridStockList->get_Item(i,2));

				//SQL sentence
				strSQL = S"update stock_data set stock_qty = " ;
				strSQL = String::Concat(strSQL,strModify->Trim()->ToString());
				strSQL = String::Concat(strSQL,S" where product_code = '",strProCode,S"'");
				strSQL = String::Concat(strSQL,S" and lot = '", strLot->Trim(),S"'");
				strSQL = String::Concat(strSQL,S" and stock_pos = '" ,strStoreCode, S"'");
				strSQL = String::Concat(strSQL,S" and factory_code = '", infStockList->strFactoryCode, S"'");
				//Execute// Update Stock_data
				if (!dbStockList->blnSQL_Execute(strSQL)){
					dbStockList->blnRollBack();
					dbStockList->blnCnnClose();
					String *msg[]={S"更新失败!",S"更新に失敗しました",S"Fail To Update!!"};
					MessageBox::Show(msg[infStockList->intLang]);
					return;	
				}
				//////Sql sentence & insert into stock_modify
				////
				////strSQL = S"insert into stock_modify(FACTORY_CODE,PRODUCT_CODE,QUANTITY,";
				////strSQL = String::Concat(strSQL,S"UNIT,MATERIAL_DIVISION,STOCK_POS,MODIFY_YMD,SHIFT)");
				////strSQL = String::Concat(strSQL,S" values('", infStockList->strFactoryCode,S"','");
				////strSQL = String::Concat(strSQL,strStoreCode,S"',");
				////strSQL = String::Concat(strSQL,(Single::Parse(strModify) - Single::Parse(strScheNum)).ToString(),S",");
				////strSQL = String::Concat(strSQL,S"(select distinct unit from parts_mst where product_code = '",strProCode,S"'),");
				////strSQL = String::Concat(strSQL,S"(select distinct parts_div  from parts_mst where product_code = '",strProCode,S"'),'");
				////strSQL = String::Concat(strSQL,strStoreCode,S"',");
				//////strSQL = String::Concat(strSQL,S"to_date('",__box(DateTime::Now), S"','yyyy-MM-dd hh24-mi-ss'),'");
				////strSQL = String::Concat(strSQL,S"to_date('",(__box(DateTime::Now)), S"','yyyy-MM-dd hh24-mi-ss'),'");
				////strSQL = String::Concat(strSQL,infStockList->strShift->Trim(),S"')");
	
				//////execute 
				////if (!dbStockList->blnSQL_Execute(strSQL)){
				////	dbStockList->blnRollBack();
				////	dbStockList->blnCnnClose();
				////	MessageBox::Show(S"更新失败!");
				////	return;	
				////}
			}
			dbStockList->blnCommit();
			dbStockList->blnCnnClose();
			String *msg[]={S"更新成功!!",S"更新に成功しました!!",S"Success To Update!!"};
			MessageBox::Show(msg[infStockList->intLang]);
			this->FillDBGrid(strChoosen);
			FillDBGrid1();
			 selectProcess();
}

private: System::Void trvBOM_AfterSelect(System::Object *  sender, System::Windows::Forms::TreeViewEventArgs *  e)
		 {
			 selectFlag=0;
			 iflag=2;

			 int intPos ;

			 String *strTmp;

			intPos =  (trvBOM->SelectedNode->Text)->IndexOf(S"  ");

			strTmp = (trvBOM->SelectedNode->Text)->Substring(intPos + 2);

			txtProCode->Text=strTmp;

			

			 //MessageBox::Show(strTmp);
			strChoosen=strTmp;
			setUnit(strTmp);
			FillDBGrid(strTmp);

			FillDBGrid1();
			selectProcess();

			
			 
			 
		 }

private: System::Void trvBOM_Click(System::Object *  sender, System::EventArgs *  e)
		 {
			 selectFlag=0;
			 iflag=2;
			 int intPos;

			 String *strTmp;

			 try{
			 
					intPos =  (trvBOM->SelectedNode->Text)->IndexOf(S"  ");

					strTmp = (trvBOM->SelectedNode->Text)->Substring(intPos + 2);

					//MessageBox::Show(strTmp);
				}
			 catch(...){
				 return;
			 }
			 txtProCode->Text=strTmp;
			 strChoosen=strTmp;

			 setUnit(strTmp);

			 FillDBGrid(strTmp);
			 FillDBGrid1();
			 selectProcess();


			
			 
			 
		 }

private: System::Void comboBox1_SelectedIndexChanged(System::Object *  sender, System::EventArgs *  e)
		 {
			 doSelectProcess();

		 }

private: System::Void txtProCode_TextChanged(System::Object *  sender, System::EventArgs *  e)
		 {
		 }

private: System::Void txtProCode_KeyPress(System::Object *  sender, System::Windows::Forms::KeyPressEventArgs *  e)
		 {
			 comboBox1->Enabled=false;
			 c

⌨️ 快捷键说明

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