diff --git a/A02基础产品管理/U_ClothInfoInput.dfm b/A02基础产品管理/U_ClothInfoInput.dfm index 0d394cf..726a3ff 100644 --- a/A02基础产品管理/U_ClothInfoInput.dfm +++ b/A02基础产品管理/U_ClothInfoInput.dfm @@ -526,7 +526,7 @@ object frmClothInfoInput: TfrmClothInfoInput object CostPrice: TcxCurrencyEdit Tag = 2 Left = 119 - Top = 210 + Top = 207 EditValue = 0.000000000000000000 Properties.AssignedValues.DisplayFormat = True Properties.OnEditValueChanged = CostPricePropertiesEditValueChanged diff --git a/A02基础产品管理/U_ClothInfoInput.pas b/A02基础产品管理/U_ClothInfoInput.pas index 47a3543..d165268 100644 --- a/A02基础产品管理/U_ClothInfoInput.pas +++ b/A02基础产品管理/U_ClothInfoInput.pas @@ -883,6 +883,19 @@ begin RTSetsavedata(ADOQueryCmd, 'BS_Cloth_Info', panel2, 2); Post; end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select count(*) as AA from BS_Cloth_Info where C_Code=''' + Trim(C_Code.Text) + ''''); + Open; + if FieldByName('AA').AsInteger > 1 then + raise Exception.Create('ظ!'); + + end; +//////////////// ////////////////////// +/// +//////////////// Ӳ ////////////////////// with ADOQueryCmd do begin Close; @@ -890,15 +903,15 @@ begin sql.Add('delete BS_Cloth_Info_Link where ToID=''' + Trim(MaxBCIID) + ''''); ExecSQL; end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from BS_Cloth_Info_Link where 1=2'); + Open; + end; if Trim(C_FromName.Properties.LookupItems.Text) <> '' then begin - with ADOQueryCmd do - begin - Close; - SQL.Clear; - sql.Add('select * from BS_Cloth_Info_Link where 1=2'); - Open; - end; with ADOQueryCmd do begin Append; @@ -912,13 +925,6 @@ begin if Trim(C_FromName2.Properties.LookupItems.Text) <> '' then begin - with ADOQueryCmd do - begin - Close; - SQL.Clear; - sql.Add('select * from BS_Cloth_Info_Link where 1=2'); - Open; - end; with ADOQueryCmd do begin Append; @@ -932,13 +938,6 @@ begin if Trim(C_FromName3.Properties.LookupItems.Text) <> '' then begin - with ADOQueryCmd do - begin - Close; - SQL.Clear; - sql.Add('select * from BS_Cloth_Info_Link where 1=2'); - Open; - end; with ADOQueryCmd do begin Append; @@ -952,13 +951,6 @@ begin if Trim(C_FromName4.Properties.LookupItems.Text) <> '' then begin - with ADOQueryCmd do - begin - Close; - SQL.Clear; - sql.Add('select * from BS_Cloth_Info_Link where 1=2'); - Open; - end; with ADOQueryCmd do begin Append; @@ -972,13 +964,6 @@ begin if Trim(C_FromName5.Properties.LookupItems.Text) <> '' then begin - with ADOQueryCmd do - begin - Close; - SQL.Clear; - sql.Add('select * from BS_Cloth_Info_Link where 1=2'); - Open; - end; with ADOQueryCmd do begin Append; @@ -989,18 +974,9 @@ begin Post; end; end; - - with ADOQueryTemp do - begin - Close; - sql.Clear; - sql.Add('select count(*) as AA from BS_Cloth_Info where C_Code=''' + Trim(C_Code.Text) + ''''); - Open; - if FieldByName('AA').AsInteger > 1 then - raise Exception.Create('ظ!'); - - end; - +//////////////// Ӳ ////////////////////// +/// +//////////////// 湩Ӧ ////////////////////// with CDS_2 do begin First; @@ -1048,7 +1024,21 @@ begin end; end; - ////////////////////////// 浥λϵӱ ////////////////////////// + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add(' update BS_Cloth_Info_Sub set referencePrice= ISNULL(floatPrice, 0) + ISNULL(CostPrice, 0) '); + sql.Add(' from BS_Cloth_Info X '); + sql.Add(' where X.BCIID=BS_Cloth_Info_Sub.BCIID AND BS_Cloth_Info_Sub.BCIID =' + quotedstr(MaxBCIID)); + ExecSQL; + end; + + + +//////////////// 湩Ӧ ////////////////////// +/// +////////////////////////// 浥λϵӱ ////////////////////////// with CDS_3 do begin First; @@ -1095,7 +1085,7 @@ begin Next; end; end; - +////////////////////////// 浥λϵӱ ////////////////////////// ADOQueryCmd.Connection.CommitTrans; // with ADOQueryCmd do diff --git a/A02基础产品管理/U_Edit.pas b/A02基础产品管理/U_Edit.pas index 40cabe5..4a0f61d 100644 --- a/A02基础产品管理/U_Edit.pas +++ b/A02基础产品管理/U_Edit.pas @@ -278,9 +278,6 @@ var begin try ADOQueryCmd.Connection.BeginTrans; - - - //////////////////////// ӱ ////////////////////////// with CDS_4 do begin @@ -290,11 +287,7 @@ begin if Trim(CDS_4.fieldbyname('BCISID').AsString) = '' then begin if GetLSNo(ADOQueryTemp, maxId4, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then - begin - ADOQueryCmd.Connection.RollbackTrans; - Application.MessageBox('ȡˮʧܣ', 'ʾ', 0); - Exit; - end; + raise Exception.Create('ȡˮʧ!'); end else begin @@ -333,26 +326,28 @@ begin Next; end; end; + with ADOQueryTemp do begin Close; sql.Clear; sql.Add('select count(BCISID) as AA from BS_Cloth_Info_Sub where BCIID=''' + Trim(FBCIID) + ''''); sql.Add(' group by C_Color,C_ColorNo having count(BCISID)>1'); -// ShowMessage(sql.Text); Open; - end; if StrToFloatDef(ADOQueryTemp.fieldbyname('AA').asstring, 1) > 1 then + raise Exception.Create('ɫɫظ!'); + + with ADOQueryCmd do begin - ADOQueryCmd.Connection.RollbackTrans; -// Result := False; - Application.MessageBox('ɫɫظ', 'ʾ', 0); - Exit; + Close; + SQL.Clear; + sql.Add(' exec P_BS_CloInfo_ZhuBuTongBu @BCIID=' + QuotedStr(trim(FBCIID))); + ExecSQL; end; + + //////////////////////// ӱ ////////////////////////// - - ADOQueryCmd.Connection.CommitTrans; Result := True;