📄 untgoodcodeselstr.pas
字号:
begin
with stringgrid1 do
begin
cells[0,countmy+ x] := inttostr(countmy+ x);
Cells[1,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
Cells[5,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
//Cells[7,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
end;
end;
end;
end;
DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
end else
begin
DBGrid1.Datasource.Dataset.EnableControls;
Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
exit;
end;
end;
/////////////////////////
if show_mode='7' then //非营业出库
begin
countmy :=frm_Umanage_Fad.stringgrid1.RowCount;
if frm_Umanage_Fad.stringgrid1.Cells[1,countmy-1] = '' then ///最后一行为新增加的新行 2004-4-14 add
countmy := countmy -1;
with DBgrid1.SelectedRows do
if Count > 0 then
begin
frm_Umanage_Fad.stringgrid1.RowCount := countmy + count ; ///2004-4-14 new ydy
TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
for x:= 0 to Count - 1 do
begin
if IndexOf(Items[x]) > -1 then
begin
DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
//得到选定的数据
with frm_Umanage_Fad do
begin
with stringgrid1 do
begin
cells[0,countmy+ x] := inttostr(countmy+ x);
Cells[1,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
Cells[4,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('baseprice').AsString);
Cells[6,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
Cells[7,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
Cells[8,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('stock_amount').AsString);
end;
end;
end;
end;
DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
end else
begin
DBGrid1.Datasource.Dataset.EnableControls;
Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
exit;
end;
end;
////////////////////////
if show_mode='8' then //非营业出库
begin
countmy :=frmin_stock.stringgrid1.RowCount;
if frmin_stock.stringgrid1.Cells[1,countmy-1] = '' then ///最后一行为新增加的新行 2004-4-14 add
countmy := countmy -1;
with DBgrid1.SelectedRows do
if Count > 0 then
begin
frmin_stock.stringgrid1.RowCount := countmy + count ; ///2004-4-14 new ydy
TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
for x:= 0 to Count - 1 do
begin
if IndexOf(Items[x]) > -1 then
begin
DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
//得到选定的数据
with frmin_stock do
begin
with stringgrid1 do
begin
cells[0,countmy+ x] := inttostr(countmy+ x);
Cells[1,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
Cells[3,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('baseprice').AsString);
Cells[5,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
//Cells[7,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
end;
end;
end;
end;
DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
end else
begin
DBGrid1.Datasource.Dataset.EnableControls;
Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
exit;
end;
end;
///////////////////////
if show_mode='9' then //套餐定义
begin
countmy :=fmflat.stringgrid2.RowCount;
if fmflat.stringgrid2.Cells[1,countmy-1] = '' then ///最后一行为新增加的新行 2004-4-14 add
countmy := countmy -1;
with DBgrid1.SelectedRows do
if Count > 0 then
begin
fmflat.stringgrid2.RowCount := countmy + count ; ///2004-4-14 new ydy
TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
for x:= 0 to Count - 1 do
begin
if IndexOf(Items[x]) > -1 then
begin
DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
//得到选定的数据
with fmflat do
begin
with stringgrid2 do
begin
cells[0,countmy+ x] := inttostr(countmy+ x);
Cells[1,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
Cells[3,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('baseprice').AsString);
Cells[6,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
Cells[7,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
//Cells[7,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
psum.Add(DBGrid1.Datasource.Dataset.fieldbyname('stock_amount').AsString);
end;
end;
end;
end;
DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
end else
begin
DBGrid1.Datasource.Dataset.EnableControls;
Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
exit;
end;
end;
///////////////////////
if show_mode='10' then //商品需求
begin
countmy :=frm_Goods_Requirement.stringgrid1.RowCount;
if frm_Goods_Requirement.stringgrid1.Cells[1,countmy-1] = '' then ///最后一行为新增加的新行 2004-4-14 add
countmy := countmy -1;
with DBgrid1.SelectedRows do
if Count > 0 then
begin
frm_Goods_Requirement.stringgrid1.RowCount := countmy + count ; ///2004-4-14 new ydy
TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
for x:= 0 to Count - 1 do
begin
if IndexOf(Items[x]) > -1 then
begin
DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
//得到选定的数据
with frm_Goods_Requirement do
begin
with stringgrid1 do
begin
Cells[0,countmy+ x] := inttostr(countmy+ x); //编号
Cells[1,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('Goods_NO').AsString);
Cells[2,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('Goods_Name').AsString);
Cells[4,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('Base_unit').AsString);
Cells[5,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('Norms_Type').AsString);
Cells[6,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('type').AsString);
Cells[7,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('brand').AsString);
Cells[8,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('breed').AsString);
Cells[9,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('Color').AsString);
Cells[10,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('ball').AsString);
Cells[11,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('poll').AsString);
Cells[12,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('provider').AsString);
Cells[13,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('barcode').AsString);
Cells[14,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('brand').AsString);
Cells[15,countmy+ x]:=trim(DBGrid1.Datasource.Dataset.FieldByName('memo').AsString);
end;
end;
end;
end;
DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
end else
begin
DBGrid1.Datasource.Dataset.EnableControls;
Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
exit;
end;
end;
if show_mode='12' then //新店铺货
begin
countmy :=fmshopgoods.gridbase.RowCount;
if fmshopgoods.gridbase.Cells[1,countmy-1] = '' then ///最后一行为新增加的新行 2004-4-14 add
countmy := countmy -1;
with DBgrid1.SelectedRows do
if Count > 0 then
begin
fmshopgoods.gridbase.RowCount := countmy + count ; ///2004-4-14 new ydy
TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
for x:= 0 to Count - 1 do
begin
if IndexOf(Items[x]) > -1 then
begin
DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
//得到选定的数据
with fmshopgoods do
begin
with gridbase do
begin
cells[0,countmy+ x] := inttostr(countmy+ x);
Cells[1,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
Cells[3,countmy+ x] := trim('0');
Cells[4,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
Cells[5,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('memo').AsString);
Cells[6,countmy+ x] :=trim(DBGrid1.Datasource.Dataset.fieldbyname('stock_amount').AsString);
end;
end;
end;
end;
DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
end else
begin
DBGrid1.Datasource.Dataset.EnableControls;
Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
exit;
end;
end;
//////////////////////////
if show_mode='13' then //赠品定义
begin
countmy :=fmZSmanager.stringgrid1.RowCount;
if fmZSmanager.stringgrid1.Cells[1,countmy-1] = '' then ///最后一行为新增加的新行 2004-4-14 add
countmy := countmy -1;
with DBgrid1.SelectedRows do
if Count > 0 then
begin
fmZSmanager.stringgrid1.RowCount := countmy + count ; ///2004-4-14 new ydy
TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
for x:= 0 to Count - 1 do
begin
if IndexOf(Items[x]) > -1 then
begin
DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
//得到选定的数据
with fmZSmanager do
begin
with stringgrid1 do
begin
cells[0,countmy+ x] := inttostr(countmy+ x);
Cells[1,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
Cells[4,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
Cells[5,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
end;
end;
end;
end;
DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
end else
begin
DBGrid1.Datasource.Dataset.EnableControls;
Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
exit;
end;
end;
///////////////////////
if show_mode='14' then //退货
begin
countmy :=FmCancel.stringgrid1.RowCount;
if FmCancel.stringgrid1.Cells[1,countmy-1] = '' then ///最后一行为新增加的新行 2004-4-14 add
countmy := countmy -1;
with DBgrid1.SelectedRows do
if Count > 0 then
begin
FmCancel.stringgrid1.RowCount := countmy + count ; ///2004-4-14 new ydy
TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
for x:= 0 to Count - 1 do
begin
if IndexOf(Items[x]) > -1 then
begin
DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
//得到选定的数据
with FmCancel do
begin
with stringgrid1 do
begin
cells[0,countmy+ x] := inttostr(countmy+ x);
Cells[1,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
Cells[4,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
//Cells[5,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('provider').AsString);
Cells[6,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('stock_amount').AsString);
end;
end;
end;
end;
DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
end else
begin
DBGrid1.Datasource.Dataset.EnableControls;
Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
exit;
end;
end;
//////////////////////////
DBGrid1.Datasource.Dataset.EnableControls;
close;
end;
procedure TfmgoodCodeSelStr.DBGrid1KeyPress(Sender: TObject;
var Key: Char);
begin
inherited;
if key=#13 then btnquery.Click;
end;
procedure TfmgoodCodeSelStr.DBGrid1TitleClick(Column: TColumn);
begin
inherited;
if (not dbgrid1.DataSource.DataSet.Active ) then exit;
if trim(column.Field.AsString)='' then exit;
sortgrid(column.Field.FieldName,dmmain.DSquery,dbgrid1,column);
end;
procedure TfmgoodCodeSelStr.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
DMMAIN.DSquery.Close;
dmmain.DSquery.Data:=null;
inherited;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -