ID := PNodeData(tv.Selected.Data)^.id;
ExecSQL(Format('update spbxx set [商品部名称]=''%s'' where [商品部编码]=%d',[Text, ID]));
end;
商品出库的代码:
procedure TfrmOutDepot.qryCHUKUNewRecord(DataSet: TDataSet);
function GetSmartCode: String;
begin
ApplySQL(Data1.qryTemp, 'select max(出库单据号) from chuku');
if Data1.qryTemp.Fields[0].AsString <> '' then
Result := GetNextStr(Trim(Data1.qryTemp.Fields[0].AsString))
else
Result := 'C00000001';
end;
begin
DataSet.FieldByName('经手人').AsString := Data1.FCurUserName;
DataSet.FieldByName('出库单据号').AsString := GetSmartCode;
DataSet.FieldByName('出库时间').AsDateTime := Date();
DataSet.FieldByName('是否已审核').AsBoolean := False;
end;
procedure TfrmOutDepot.FormDestroy(Sender: TObject);
begin
ClearDepot;
ClearPickList(GridMX.Columns[1]);
end;
procedure TfrmOutDepot.FormShow(Sender: TObject);
var
PCKH: PChar;
begin
with data1.qryTemp do
begin
ApplySQL(data1.qryTemp, 'select 仓库号,仓库名称 from ckb');
ClearDepot;
cmbDFDepot.Clear;
while not Eof do
begin
GetMem(PCKH, 13);
FillChar(PCKH^, 13, 0);
Move(PChar(Fields[1].AsString)^, PCKH^, 13);
cmbDepot.Items.AddObject(Fields[0].AsString, TObject(PCKH));
cmbDFDepot.Items.Add(Fields[0].AsString);
Next;
end;
end;
qryCHUKU.Close;
<< 上一页 [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] ... 下一页 >>