📄 partsmst.cpp
字号:
{
MessageBox::Show (abc[9],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
if (txtunit->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[10],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
break;
case 1:
if (txtproductcode->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[7],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
if (txtproname->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[8],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
if (txtmoney->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[9],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
if (txtunit->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[10],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
break;
case 2:
if (txtproductcode->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[7],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
if (txtproname->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[8],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
if (txtmoney->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[9],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
if (txtunit->Text->Trim()->CompareTo(S"") == 0 )
{
MessageBox::Show (abc[10],S"Parts_mst",MessageBoxButtons::OK,MessageBoxIcon::Information);
return false;
}
break;
}
return true;
}
bool PartsMst::fblninsertparts_mst(void)
{
String *strSQL;
String * saparts_name;
String * saparts_money;
switch(iLanguage) {
case 0:
saparts_name = S"parts_name_c";
saparts_money = S"RMB";
break;
case 1:
saparts_name = S"parts_name_j";
saparts_money = S"YEN";
break;
case 2:
saparts_name = S"parts_name_e";
saparts_money = S"DOLLAR";
break;
default:
saparts_name = S"parts_name_c";
saparts_money = S"RMB";
}
strSQL=S"";
strSQL=String::Concat(strSQL,S" insert into parts_mst(product_code,",saparts_name,S",unit,",S"RMB,YEN,DOLLAR",S",parts_div,sequence_no)");
strSQL=String::Concat(strSQL,S" Values(\n");
strSQL=String::Concat(strSQL,S"'",txtproductcode->Text,S"','",txtproname->Text,S"','",txtunit->Text,S"',");
switch(iLanguage) {
case 0:
strSQL=String::Concat(strSQL,txtmoney->Text,S",0,0,1,");
break;
case 1:
strSQL=String::Concat(strSQL,S",0,",txtmoney->Text,S"0,1,");
break;
case 2:
strSQL=String::Concat(strSQL,S",0,0,",txtmoney->Text,S"1,");
break;
default:
strSQL=String::Concat(strSQL,txtmoney->Text,S"0,0,1,");
}
if ((comproducttype->SelectedIndex==0)==true)
{
strSQL=String::Concat(strSQL,S"'3000')");
}
else if ((comproducttype->SelectedIndex==1)==true)
{
strSQL=String::Concat(strSQL,S"'7900')");
}
else if ((comproducttype->SelectedIndex==2)==true)
{
strSQL=String::Concat(strSQL,S"'7920')");
}
oDB->blnSQL_Execute(strSQL);
try
{
oDB->blnCommit();
return true;
}
catch (...)
{
oDB->blnRollBack();
return false;
}
return true;
}
bool PartsMst::fblnupdateparts_mst(void)
{
String *strSQL;
String * saparts_name;
String * saparts_money;
switch(iLanguage) {
case 0:
saparts_name = S"parts_name_c";
saparts_money = S"RMB";
break;
case 1:
saparts_name = S"parts_name_j";
saparts_money = S"YEN";
break;
case 2:
saparts_name = S"parts_name_e";
saparts_money = S"DOLLAR";
break;
default:
saparts_name = S"parts_name_c";
saparts_money = S"RMB";
}
strSQL=S"";
strSQL=String::Concat(strSQL,S" update parts_mst set ",saparts_name,S" = '",txtproname->Text,S"',");
strSQL=String::Concat(strSQL,S" unit = '",txtunit->Text,S"',");
strSQL=String::Concat(strSQL,saparts_money,S" = ",txtmoney->Text,S",");
if ((comproducttype->SelectedIndex==0)==true)
{
strSQL=String::Concat(strSQL,S" sequence_no='3000'");
}
else if ((comproducttype->SelectedIndex==1)==true)
{
strSQL=String::Concat(strSQL,S" sequence_no='7900'");
}
else if ((comproducttype->SelectedIndex==2)==true)
{
strSQL=String::Concat(strSQL,S" sequence_no='7920'");
}
strSQL = String::Concat(strSQL,S" where product_code='",txtproductcode->Text,S"'");
oDB->blnSQL_Execute(strSQL);
try
{
oDB->blnCommit();
return true;
}
catch (...)
{
oDB->blnRollBack();
return false;
}
return true;
}
bool PartsMst::fblndeleteparts_mst(void)
{
String *strSQL;
String * stxtname;
strSQL = "";
strSQL = String::Concat(S"delete from parts_mst where product_code ='",txtproductcode->Text,S"'");
oDB->blnSQL_Execute(strSQL);
try
{
System::Windows::Forms::DialogResult strdialog;
strdialog=MessageBox::Show(abc[4],abc[5],MessageBoxButtons::OKCancel,MessageBoxIcon::Question);
if (strdialog==DialogResult::OK)
{
oDB->blnCommit();
return true;
stxtname=String::Concat(txtproductcode->Text,abc[6]);
MessageBox::Show(stxtname);
}
else
{
oDB->blnRollBack();
return false;
}
}
catch (...)
{
oDB->blnRollBack();
return false;
}
return true;
}
bool PartsMst::fblncheck(DBBase *DBTmp)
{
String *strSQL;
int dRowTmp;
strSQL=S"";
strSQL=String::Concat(strSQL,S" select product_code from parts_mst where product_code='",txtproductcode->Text->Trim(),S"'");
if (!DBTmp->blnCnnOpen()) {
MessageBox::Show(S"Open Oracle Error!! ",S"lot");
return false;
}
dRowTmp = DBTmp->intSQL_Select(strSQL);
try
{
if ((dRowTmp==0)==true)
{
return true;
}
else
{
return false;
}
}
catch (...) {
return false;
}
return true;
}
bool PartsMst::EditCalender()
{
DataGridCell oCell;
int asint;
//DataGridCell oCell1;
//DataGridCell oCell2;
//DataGridCell oCell3;
//dataGridCell oCell4;
oCell = GPartsMst->CurrentCell;
oCell.ColumnNumber=0;
txtproductcode->Text = GPartsMst->Item[oCell]->ToString();
oCell.ColumnNumber=1;
txtproname->Text = GPartsMst->Item[oCell]->ToString();
oCell.ColumnNumber=2;
txtunit->Text = GPartsMst->Item[oCell]->ToString();
oCell.ColumnNumber=3;
txtmoney->Text = GPartsMst->Item[oCell]->ToString();
oCell.ColumnNumber=4;
for (asint=0;asint<3;asint++)
{
comproducttype->SelectedIndex=asint;
if (String::Equals(comproducttype->Text,GPartsMst->Item[oCell]->ToString())==true)
{
return true;
}
}
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -