procedure TYuYue_RDM_Server.Stock_I_Table_DAfterUpdateRecord( Sender: TObject; SourceDS: TDataSet; DeltaDS: TCustomClientDataSet; UpdateKind: TUpdateKind); begin {更新"Data_3"的库存} self.Update_Data_3.Close; Case UpdateKind Of ukModify:{编辑} begin self.Update_Data_3.SQL.Clear; self.Update_Data_3.SQL.Add('Update "data_3.db" Set kc=kc+:Editkc where id=:D3ID'); self.Update_Data_3.Prepare; self.Update_Data_3.ParamByName('Editkc').AsSmallInt:=(DeltaDS.Fields[4].NewValue-DeltaDS.Fields[4].OldValue); self.Update_Data_3.ParamByName('D3ID').AsSmallInt:=DeltaDS.Fields[2].Value; end; ukInsert: {删除} begin self.Update_Data_3.SQL.Clear; self.Update_Data_3.SQL.Add('Update "data_3.db" Set kc=kc-:Delkc where id=:D3ID'); self.Update_Data_3.Prepare; self.Update_Data_3.ParamByName('Delkc').AsSmallInt:=DeltaDS.Fields[4].Value; self.Update_Data_3.ParamByName('D3ID').AsSmallInt:=DeltaDS.Fields[2].Value; end; ukDelete: {新添} begin self.Update_Data_3.SQL.Clear; self.Update_Data_3.SQL.Add('Update "data_3.db" Set kc=kc+:Addkc where id=:D3ID'); self.Update_Data_3.Prepare; self.Update_Data_3.ParamByName('Addkc').AsSmallInt:=DeltaDS.Fields[4].Value; self.Update_Data_3.ParamByName('D3ID').AsSmallInt:=DeltaDS.Fields[2].Value; end; end; self.Update_Data_3.ExecSQL;