⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sal_enter_salparam.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Sal_Enter_SalParam;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Dialog, Db, AdODB, StdCtrls, ExtCtrls, ComCtrls, Mask;

Type
  TFrm_Sal_Enter_SalParam = Class(TFrm_Base_Dialog)
    Label2: TLabel;
    Cmbx_ShiPassess: TComboBox;
    Label1: TLabel;
    Cmb_IsPriceRequestPass: TComboBox;
    procedure btn_okClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure btn_CancelClick(Sender: TObject);
    procedure Cmbx_ShiPassesSChange(Sender: TObject);
  private
    { Private declarations }
    FReadOnly:Boolean;
  public
   procedure InitForm(AdoConnection:TAdoConnection;ReadOnly:Boolean);
    { Public declarations }
  end;

var
  Frm_Sal_Enter_SalParam: TFrm_Sal_Enter_SalParam;

implementation

{$R *.DFM}
uses Sys_Global;
{ TFrm_Bas_Param }


procedure TFrm_Sal_Enter_SalParam.InitForm(AdoConnection: TAdoConnection;
  ReadOnly: Boolean);
begin
  FReadOnly:=ReadOnly;
  AdoQry_Tmp.Connection:=AdOConnection;
  AdoQry_Tmp.Close ;
  AdoQry_Tmp.SQL.clear ;
  AdoQry_Tmp.SQL.Add('select * from Sa_SalParam');
  AdoQry_Tmp.Open ;
  With AdoQry_Tmp do
  begin
    if Locate('SalParamCode','ShiPassess',[]) then
      Cmbx_ShiPassess.ItemIndex:=fieldbyname('SalParamValueN').asinteger;
    if Locate('SalParamCode','ISPriceRequestPass',[]) then
      Cmb_IsPriceRequestPass.ItemIndex:=fieldbyname('SalParamValueN').asinteger;
  end;
  If Cmbx_ShiPassess.CanFocus then
      Cmbx_ShiPassess.SetFocus;
  Btn_OK.enabled:=False;

end;

procedure TFrm_Sal_Enter_SalParam.btn_okClick(Sender: TObject);
begin
  inherited;
  With AdoQry_Tmp do
  begin
    Close ;
    SQL.clear ;
    SQL.Add('Update Sa_SalParam Set SalParamValueN='+inttostr(Cmbx_ShiPassess.ItemIndex)+
      ' where SalParamCode='''+'ShiPassess'+'''');
    ExecSql;

    Close ;
    SQL.clear ;
    SQL.Add('Update Sa_SalParam Set SalParamValueN='+inttostr(Cmb_IsPriceRequestPass.ItemIndex)+
      ' where SalParamCode='''+'IsPriceRequestPass'+'''');
    ExecSql;
  end;
  Close;
end;

procedure TFrm_Sal_Enter_SalParam.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  Action:=CaFree;
end;

procedure TFrm_Sal_Enter_SalParam.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  inherited;
  If Key=Vk_EScApe then
    Close;
end;

procedure TFrm_Sal_Enter_SalParam.btn_CancelClick(Sender: TObject);
begin
  inherited;
  Close;
end;

procedure TFrm_Sal_Enter_SalParam.Cmbx_ShiPassesSChange(Sender: TObject);
begin
  inherited;
  if not FReadOnly then
    Btn_Ok.Enabled :=True;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -