📄 sfc_wipprice.pas
字号:
unit Sfc_WipPrice;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Outer, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
StdCtrls, ExtCtrls, ComCtrls, ToolWin;
Type
TFrm_Sfc_WipPrice = Class(TFrm_Base_Outer)
AdoQry_MainItemCode: TStringField;
AdoQry_MainItemName: TStringField;
AdoQry_MainUomName: TStringField;
AdoQry_MainItemprice: TFloatField;
AdoQry_MainwiPMonth: TStringField;
AdoQry_MainDeptCode: TStringField;
AdoQry_MainDeptName: TStringField;
private
{ Private declarations }
public
{ Public declarations }
procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
function SetDeleteSql:String;Override;
procedure SetFormParam(FrmParam1,FrmParam2,FrmParam3,FrmParam4,FrmParam5,FrmParam6:String);Override;
end;
var
Frm_Sfc_WipPrice: TFrm_Sfc_WipPrice;
implementation
uses Sfc_WipPrice_D;
{$R *.DFM}
procedure TFrm_Sfc_WipPrice.InitForm(AdOConnection: TAdOConnection;
ReadOnly: Boolean);
begin
ExtendCaption:=False;
inherited;
Pricefields:='Itemprice,';
SelectFromSQL:='Select wipPrice.wiPMonth,wipPrice.DeptCode,Dept.DeptName,wipPrice.ItemCode,Item.ItemName,Uom.UomName,wipPrice.Itemprice '
+' From WipPrice '
+' left Join Item On Item.ItemCode=WipPrice.ItemCode '
+' left join Dept on Dept.DeptCode=wipPrice.DeptCode '
+' left join Uom on Uom.UomCode=Item.UomCode ';
OrderByFields:='ItemCode';
Frm_Sys_Detail:=TFrm_Sfc_WipPrice_D.Create(self);
AdoQry_Main.DisableControls;
AdoQry_Main.Close;
AdoQry_Main.SQL.clear;
AdoQry_Main.SQL.Add(SelectFromSQL);
AdoQry_Main.Open;
AdoQry_Main.Sort:=OrderByFields;
AdoQry_Main.EnableControls;
end;
function TFrm_Sfc_WipPrice.SetDeleteSql: String;
begin
Result:='Delete WipPrice'
+' Where ItemCode='''+AdoQry_Main.fieldbyname('ItemCode').AsString+'''';
end;
procedure TFrm_Sfc_WipPrice.SetFormParam(FrmParam1, FrmParam2, FrmParam3,
FrmParam4, FrmParam5, FrmParam6: String);
begin
inherited;
Frm_Sys_Detail.SetFormParam(FrmParam1,FrmParam2,'','','','');
if FrmParam3='ReadOnly' then
begin
Act_New.Visible:=False;
Act_Modify.Visible:=False;
Act_Delete.Visible:=False;
Act_New.Enabled:=False;
Act_Modify.Enabled:=False;
Act_Delete.Enabled:=False;
Act_Look.Enabled:=True;
Act_Look.Visible:=True;
end
else
begin
Act_New.Visible:=True;
Act_Modify.Visible:=True;
Act_Delete.Visible:=True;
Act_New.Enabled:=True;
Act_Modify.Enabled:=True;
Act_Delete.Enabled:=True;
Act_Look.Enabled:=False;
Act_Look.Visible:=False;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -