sogh_n_o.cpp

来自「一个以前收集的基于C/S架构的ERP客户端源代码」· C++ 代码 · 共 986 行 · 第 1/3 页

CPP
986
字号
    SqlStr+=" MaccFmonth='"+g_sdSMonth+"' and MaccLoc='"+seSogdLoc->ItemData[cbItem2]+"' and MaccGoods='"+seSogdGoods->Text+"'";
    TfrmWnQuery *p;
    try
    {
       StartWaitForm("正在查询,请稍候...");
       p=new TfrmWnQuery(this,"库存查询",SqlStr);
    }
    __finally
    {
       EndWaitForm();
    }
    p->ShowModal();
    delete p;
}
//---------------------------------------------------------------------------
void __fastcall TfrmSogh_N_O::seSogdPriceButtonClick(TObject *Sender)
{
    AnsiString SqlStr;
    TfrmWnQuery *p;
    SqlStr="004[启始数量段][终止数量段][价格][折扣]";
    SqlStr+="select f0=0,f1=squoteqty1,f2=squoteprice1,f3=squoterebate1 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty1,f1=squoteqty2,f2=squoteprice2,f3=squoterebate2 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty2,f1=squoteqty3,f2=squoteprice3,f3=squoterebate3 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty3,f1=squoteqty4,f2=squoteprice4,f3=squoterebate4 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty4,f1=squoteqty5,f2=squoteprice5,f3=squoterebate5 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
	SqlStr+="select f0=squoteqty5,f1=squoteqty6,f2=squoteprice6,f3=squoterebate6 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
	SqlStr+="select f0=squoteqty6,f1=squoteqty7,f2=squoteprice7,f3=squoterebate7 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
	SqlStr+="select f0=squoteqty7,f1=squoteqty8,f2=squoteprice8,f3=squoterebate8 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
	SqlStr+="select f0=squoteqty8,f1=squoteqty9,f2=squoteprice9,f3=squoterebate9 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
	SqlStr+="select f0=squoteqty9,f1=squoteqty10,f2=squoteprice10,f3=squoterebate10 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"'";
	try
	{
	  StartWaitForm("正在查询,请稍候...");
	  p=new TfrmWnQuery(this,"产品报价单查询",SqlStr);
	}
	__finally
	{
	  EndWaitForm();
	}
    if(p->ShowModal()==mrOk)
    {
      seSogdPrice->Text=p->ColData[3];
      seSogdDisc->Text=p->ColData[4];
    }
    delete p;
}
//---------------------------------------------------------------------------
void __fastcall TfrmSogh_N_O::seSogdDiscButtonClick(TObject *Sender)
{
    AnsiString SqlStr;
    TfrmWnQuery *p;
    SqlStr="004[启始数量段][终止数量段][价格][折扣]";
    SqlStr+="select f0=0,f1=squoteqty1,f2=squoteprice1,f3=squoterebate1 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty1,f1=squoteqty2,f2=squoteprice2,f3=squoterebate2 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty2,f1=squoteqty3,f2=squoteprice3,f3=squoterebate3 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty3,f1=squoteqty4,f2=squoteprice4,f3=squoterebate4 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty4,f1=squoteqty5,f2=squoteprice5,f3=squoterebate5 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty5,f1=squoteqty6,f2=squoteprice6,f3=squoterebate6 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty6,f1=squoteqty7,f2=squoteprice7,f3=squoterebate7 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty7,f1=squoteqty8,f2=squoteprice8,f3=squoterebate8 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty8,f1=squoteqty9,f2=squoteprice9,f3=squoterebate9 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"' union all ";
    SqlStr+="select f0=squoteqty9,f1=squoteqty10,f2=squoteprice10,f3=squoterebate10 from sdsquote where squoteclient='"+seSoghClient->ItemData[cbItem2]+"' and squotecurrency='"+seSoghCurrency->ItemData[cbItem2]+"' and squotegoods='"+seSogdGoods->Text+"'";
    try
	{
	  StartWaitForm("正在查询,请稍候...");
	  p=new TfrmWnQuery(this,"产品折扣查询",SqlStr);
	}
	__finally
	{
	  EndWaitForm();
	}
	p->ShowModal();
	delete p;
}
//---------------------------------------------------------------------------
void __fastcall TfrmSogh_N_O::seSogdGoodsButtonClick(TObject *Sender)
{

	if(OpenGoodsForm("")) //过滤条件
	  if (!SetGoods(gtOpenForm, l_RsGoods->FieldValues["GoodsCode"]))
 			ClearControl(2,0);

}
//---------------------------------------------------------------------------
void __fastcall TfrmSogh_N_O::seSogdUnitButtonClick(TObject *Sender)
{
	AnsiString SqlStr;
	SqlStr ="003[计量单位][单位名称][换算系数]";
	SqlStr+="SELECT GmuUnit,UnitName,GmuConv from sdGmu,sdUnit where GmuUnit=UnitCode and ";
	SqlStr+="GmuGoods='"+seSogdGoods->Text+"' order by GmuUnit ";
	TfrmWnQuery *p;
	try
	{
	   StartWaitForm("正在查询,请稍候...");
	   p=new TfrmWnQuery(this,"计量单位查询",SqlStr);
	}
	__finally
	{
	   EndWaitForm();
	}
	if(p->ShowModal()==mrOk)
	{
	  seSogdUnit->LocateKey(p->ColData[1]);
	  seSogdConv->Text=p->ColData[3];
	}
	delete p;
}
//---------------------------------------------------------------------------
void __fastcall TfrmSogh_N_O::seSogdGoodsExit(TObject *Sender)
{
	if(seSogdGoods->Text != "")
	{
	  if (!SetGoods(gtInitRs, seSogdGoods->Text))
		ClearControl(2,0);	  	
	}
}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::seSogdBatchButtonClick(TObject *Sender)
{
  AnsiString SqlStr;
  SqlStr="002[批号编码][说明]select Batchcode,BatchDesc from sdBatch order by BatchCode";
  TfrmWnQuery *p;
  try
  {
    StartWaitForm("正在查询,请稍候...");
    p=new TfrmWnQuery(this,"批号查询",SqlStr);
  }
  __finally
  {
    EndWaitForm();
  }
  if(p->ShowModal()==mrOk)
  {
    seSogdBatch->LocateKey(p->ColData[1]);
  }
  delete p;
}
//---------------------------------------------------------------------------
bool __fastcall TfrmSogh_N_O::BeforeCheck()
{
   SetHeadValue("SoghCheck",1);
   SetHeadValue("SoghChecker",g_sdUserCode);
   return true;
}
//---------------------------------------------------------------------------
bool __fastcall TfrmSogh_N_O::BeforeUnCheck()
{
   SetHeadValue("SoghCheck",0);
   SetHeadValue("SoghChecker",g_sdUserCode);
   return true;
}

//---------------------------------------------------------------------------
bool __fastcall TfrmSogh_N_O::BeforeCloseBill()
{
   SetHeadValue("SoghClose",1);
	return true;
}

//---------------------------------------------------------------------------
bool __fastcall TfrmSogh_N_O::BeforeUnCloseBill()
{
   SetHeadValue("SoghClose",0);
   return true;
}

//---------------------------------------------------------------------------
void __fastcall TfrmSogh_N_O::FormClose(TObject *Sender,
	  TCloseAction &Action)

{
	TBillBaseForm::FormClose(Sender, Action);

   // ... 
}
//---------------------------------------------------------------------------


void __fastcall TfrmSogh_N_O::sgSogdClick(TObject *Sender)
{
if(sgSogd->Row == 0)
	  return;
	  // sogdLine + SogdCode (SoghCode)
	comServer->LocateItemByKey(sgSogd->TextMatrix[sgSogd->Row][1]+"\t"+GetHeadValue("SoghCode")+"\t");
	
}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::seSoghClientButtonClick(TObject *Sender)
{
	if(OpenClientForm(IsLegitCU("", Query))) //过滤条件
	{
	  SetClients(gtOpenForm, GetClientValue(gtOpenForm,"ClientCode"));
	  seSoghClient->LocateKey(GetClientValue(gtOpenForm,"ClientCode"));
	}
	
}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::seSoghClientExit(TObject *Sender)
{
	if ( seSoghClient->Text!="" )
	{
	  if(!InitRsClient(IsLegitCU(seSoghClient->Text, Query)))
		  return;
	  SetClients(gtInitRs, seSoghClient->Text);
	}

}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------


void __fastcall TfrmSogh_N_O::seSoghCurrencyKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
   if (Key==13)
	if (   seSoghCurrency->Text!="" )
		  seSoghCurrency->LocateKey(   seSoghCurrency->Text);

}
//---------------------------------------------------------------------------


void __fastcall TfrmSogh_N_O::scSoghPosTypeKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
  if (Key==13)
	if ( scSoghPosType->Text!="" )
		  scSoghPosType->LocateKey(  scSoghPosType->Text);

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::scSoghTaxCodeKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
  if (Key==13)
	if ( scSoghTaxCode->Text!="" )
		  scSoghTaxCode->LocateKey( scSoghTaxCode->Text);

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::scSoghDeliverKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
  if (Key==13)
	if ( scSoghDeliver->Text!="" )
		  scSoghDeliver->LocateKey(  scSoghDeliver->Text);

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::seSoghSsiteKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
  if (Key==13)
	if ( seSoghSsite->Text!="" )
		  seSoghSsite->LocateKey(seSoghSsite->Text);

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::scSoghTransModeKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
  if (Key==13)
	if ( scSoghTransMode->Text!="" )
		  scSoghTransMode->LocateKey(scSoghTransMode->Text);

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::scSoghSettleModeKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
  if (Key==13)
	if ( scSoghSettleMode->Text!="" )
		  scSoghSettleMode->LocateKey( scSoghSettleMode->Text);

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::scSoghSalerKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
  if (Key==13)
	if ( scSoghSaler->Text!="" )
		  scSoghSaler->LocateKey( scSoghSaler->Text );

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::seSogdUnitKeyDown(TObject *Sender, WORD &Key,
      TShiftState Shift)
{
  if (Key==13)
	if ( seSogdUnit->Text!="" )
		  seSogdUnit->LocateKey(seSogdUnit->Text);

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::seSogdLocKeyDown(TObject *Sender, WORD &Key,
      TShiftState Shift)
{
  if (Key==13)
	if ( seSogdLoc->Text!="" )
		  seSogdLoc->LocateKey(seSogdLoc->Text);

}
//---------------------------------------------------------------------------

void __fastcall TfrmSogh_N_O::seSogdBatchKeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
  if (Key==13)
	if ( seSogdBatch->Text!="" )
		  seSogdBatch->LocateKey(seSogdBatch->Text);
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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