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

📄 jiangjin_chaxun.pas

📁 类似于安利公司的奖金制度下的会员层次关系、会员级别、会员奖金等
💻 PAS
字号:
unit jiangjin_chaxun;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, DBCtrls, Mask, Grids, DBGrids;

type
  TForm6 = class(TForm)
    DBGrid1: TDBGrid;
    Label1: TLabel;
    Button2: TButton;
    Label3: TLabel;
    DBGrid2: TDBGrid;
    Edit1: TEdit;
    Button1: TButton;
    ListBox1: TListBox;
    Label2: TLabel;
    procedure Button2Click(Sender: TObject);
    procedure DBGrid2CellClick(Column: TColumn);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ChangeFonts(OldFormWidth:integer;NewFormWidth:integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form6: TForm6;
  Selected_MemberID:string;

implementation

{$R *.dfm}
uses
    Data_Unit1;

type
  TFooClass = class(TControl); { needed to get at protected }
                             { font property }
const
ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
ScreenHeight: LongInt = 600;

procedure TForm6.ChangeFonts(OldFormWidth:integer;NewFormWidth:integer);
var
i: integer;
begin
  NewFormWidth := longint(width) * longint(screen.width) div ScreenWidth;
  for i := ControlCount - 1 downto 0 do
    TFooClass(Controls[i]).Font.Size :=
      (NewFormWidth div OldFormWidth) *
      TFooClass(Controls[i]).Font.Size;
end;

procedure TForm6.Button2Click(Sender: TObject);
begin
   Form6.close;
end;

procedure TForm6.DBGrid2CellClick(Column: TColumn);
begin
  Edit1.Text := DataModule1.ADOTable2.FieldValues['member_id'];
end;

procedure TForm6.Button1Click(Sender: TObject);
begin
   label2.Caption := '编号为:'+Edit1.Text+'的会员,本月奖金明细如下:';
   ListBox1.Items.Clear;
   ListBox1.Items.Add('一、开拓奖');
   with DataModule1.ADOQuery_jiangjin do begin
//开拓奖查询
     sql.Clear;
     sql.Add('Select lower_id,amount,date_valid from jiangjin where member_id = :AA1 and jj_type = :AA2 and sign_month = false');
     Parameters.ParamValues['AA1'] := Edit1.Text;
     Parameters.ParamValues['AA2'] := '开拓奖';
     open;
     if RecordCount > 0 then begin
//       Application.showmessage('输入错误','输入的会员编号不存在!',MB_OK + MB_DEFBUTTON1);
       Recordset.MoveFirst;
       repeat
         ListBox1.Items.Add('  由于编号为:'+Recordset.Fields.Item['lower_id'].Value+'的会员加入,奖金额:'+floattostr(Recordset.Fields.Item['amount'].Value)+',日期:'+datetostr(Recordset.Fields.Item['date_valid'].Value));
         Recordset.MoveNext;
       until Recordset.EOF;
     end;
     close;
   end;
   ListBox1.Items.Add('二、辅导奖');
   with DataModule1.ADOQuery_jiangjin do begin
//辅导奖查询
     sql.Clear;
     sql.Add('Select lower_id,amount,date_valid from jiangjin where member_id = :AA1 and jj_type = :AA2 and sign_month = false');
     Parameters.ParamValues['AA1'] := Edit1.Text;
     Parameters.ParamValues['AA2'] := '辅导奖';
     open;
     if RecordCount > 0 then begin
//       Application.showmessage('输入错误','输入的会员编号不存在!',MB_OK + MB_DEFBUTTON1);
       Recordset.MoveFirst;
       repeat
         ListBox1.Items.Add('  由于编号为:'+Recordset.Fields.Item['lower_id'].Value+'的会员加入,奖金额:'+floattostr(Recordset.Fields.Item['amount'].Value)+',日期:'+datetostr(Recordset.Fields.Item['date_valid'].Value));
         Recordset.MoveNext;
       until Recordset.EOF;
     end;
     close;
   end;
   ListBox1.Items.Add('三、管理奖');
   with DataModule1.ADOQuery_jiangjin do begin
//开拓奖查询
     sql.Clear;
     sql.Add('Select lower_id,amount,date_valid from jiangjin where member_id = :AA1 and jj_type = :AA2 and sign_month = false');
     Parameters.ParamValues['AA1'] := Edit1.Text;
     Parameters.ParamValues['AA2'] := '管理奖';
     open;
     if RecordCount > 0 then begin
//       Application.showmessage('输入错误','输入的会员编号不存在!',MB_OK + MB_DEFBUTTON1);
       Recordset.MoveFirst;
       repeat
         ListBox1.Items.Add('  由于编号为:'+Recordset.Fields.Item['lower_id'].Value+'的会员加入,奖金额:'+floattostr(Recordset.Fields.Item['amount'].Value)+',日期:'+datetostr(Recordset.Fields.Item['date_valid'].Value));
         Recordset.MoveNext;
       until Recordset.EOF;
     end;
     close;
   end;
end;

procedure TForm6.FormCreate(Sender: TObject);
begin
  scaled := true;
  if (screen.width <> ScreenWidth) then
  begin
    height := longint(height) * longint(screen.height) div ScreenHeight;
    width := longint(width) * longint(screen.width) div ScreenWidth;
    scaleBy(screen.width, ScreenWidth);
  end;
  ChangeFonts(ScreenWidth,width);

    Edit1.Text := Selected_MemberID;
end;

end.

⌨️ 快捷键说明

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