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

📄 ustoragepartsres.pas

📁 天涯進銷存系統
💻 PAS
字号:
unit uStoragePartsRes;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, jpeg, LBCtrls, LBMorphVCLBase, LBMorphButton;

type
  TfrmStoragePartsRes = class(TForm)
    Image2: TImage;
    WindowCaption: TLabel;
    SysCloseButton: TLBMorphButton;
    Panel4: TPanel;
    Panel6: TPanel;
    Panel3: TPanel;
    ClassShape1: TShape;
    ClassShape2: TShape;
    LBButton1: TLBButton;
    LBButton2: TLBButton;
    Panel2: TPanel;
    Shape3: TShape;
    Notebook: TNotebook;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    InPutPriceBox: TLBCheckBox;
    OutPutPriceBox: TLBCheckBox;
    ResInPutPriceEdit: TLBNumberEdit;
    ResOutPutPriceEdit: TLBNumberEdit;
    Shape1: TShape;
    Shape2: TShape;
    InPutPriceEdit: TLBNumberEdit;
    OutPutPriceEdit: TLBNumberEdit;
    EnterButton: TLBButton;
    CancelButton: TLBButton;
    procedure FormShow(Sender: TObject);
    procedure EnterButtonClick(Sender: TObject);
    procedure LBButton1Click(Sender: TObject);
    procedure LBButton2Click(Sender: TObject);
    procedure CancelButtonClick(Sender: TObject);
    procedure Image2MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    procedure SetSubJect(NSh: TShape);
  public
    { Public declarations }
  end;

var
  frmStoragePartsRes: TfrmStoragePartsRes;
  SelectSh :TShape;
  ResType : Integer;

implementation

uses uPublicvar, uConst;

{$R *.dfm}

procedure TfrmStoragePartsRes.SetSubJect(NSh: TShape);
begin
  SelectSh.Visible:=False;
  NSh.Visible:=True;
  SelectSh:=NSh;
end;

procedure TfrmStoragePartsRes.FormShow(Sender: TObject);
begin
  ClassShape1.Visible:=True;
  SelectSh:=ClassShape1;
  ResType:=1;
  Notebook.PageIndex:=0;
  isRedressal:=False;
  InPutPriceEdit.Value:=ResPrice3;
  OutPutPriceEdit.Value:=ResPrice4;
end;

procedure TfrmStoragePartsRes.EnterButtonClick(Sender: TObject);
begin
  if ResInPutPriceEdit.Text ='' then ResInPutPriceEdit.Text:='1';
  if ResOutPutPriceEdit.Text ='' then ResOutPutPriceEdit.Text:='1';
  if InPutPriceEdit.Text ='' then InPutPriceEdit.Value :=ResPrice3;
  if OutPutPriceEdit.Text ='' then OutPutPriceEdit.Value:=ResPrice4;
  if ResType= 1 then
  begin
    if not (InPutPriceBox.Checked) and not (OutPutPriceBox.Checked) then
    begin
      Application.MessageBox('请选择要调整的价格。',Hintinfo,$30);
      Exit;
    end;
    if ((InPutPriceBox.Checked) and (ResInPutPriceEdit.Text='0'))
    or ((OutPutPriceBox.Checked) and (ResOutPutPriceEdit.Text='0')) then
    begin
      Application.MessageBox('不能调整零价格。',Hintinfo,$30);
      Exit;
    end;
    isCost:=InPutPriceBox.Checked;
    isSell:=OutPutPriceBox.Checked;
    RedressalType:=1;
    isRedressal:=True;
  end
  else
  if ResType= 2 then
  begin
    if (InPutPriceEdit.Value<=0) or (OutPutPriceEdit.Value<=0) then
      if Application.MessageBox('成本单价或销售单价确实为零吗?',Hintinfo, $24)=idNo then Exit;
    RedressalType:=2;
    isRedressal:=True;
  end;
  ResPrice1:=StrToFloat(ResInPutPriceEdit.Text);
  ResPrice2:=StrToFloat(ResOutPutPriceEdit.Text);
  ResPrice3:=InPutPriceEdit.Value;
  ResPrice4:=OutPutPriceEdit.Value;
  Close;
end;

procedure TfrmStoragePartsRes.LBButton1Click(Sender: TObject);
begin
  SetSubJect(ClassShape1);
  ResType:=1;
  Notebook.PageIndex:=0;
end;

procedure TfrmStoragePartsRes.LBButton2Click(Sender: TObject);
begin
  SetSubJect(ClassShape2);
  ResType:=2;
  Notebook.PageIndex:=1;
end;

procedure TfrmStoragePartsRes.CancelButtonClick(Sender: TObject);
begin
  Close;
end;

procedure TfrmStoragePartsRes.Image2MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  SendMessage(Handle, wm_SysCommand ,$F012, 0);
end;

procedure TfrmStoragePartsRes.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key=27 then Close;
end;

end.

⌨️ 快捷键说明

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