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

📄 f_inputpoint.pas

📁 销售业绩核算系统
💻 PAS
📖 第 1 页 / 共 4 页
字号:
unit F_inputpoint;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls, ExtCtrls;

type
  TForm_inputpoint = class(TForm)
    Label9: TLabel;
    Panel1: TPanel;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label4: TLabel;
    Edit3: TEdit;
    Label3: TLabel;
    Label6: TLabel;
    Edit4: TEdit;
    Edit5: TEdit;
    Label7: TLabel;
    Edit7: TEdit;
    Label8: TLabel;
    Edit8: TEdit;
    Edit9: TEdit;
    Edit10: TEdit;
    Label12: TLabel;
    Edit11: TEdit;
    Edit12: TEdit;
    CheckBox1: TCheckBox;
    BitBtn2: TBitBtn;
    Panel2: TPanel;
    SpeedButton1: TSpeedButton;
    Label5: TLabel;
    Edit6: TEdit;
    SpeedButton2: TSpeedButton;
    Label15: TLabel;
    Edit13: TEdit;
    BitBtn3: TBitBtn;
    edit1: TComboBox;
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
   // procedure SpeedButton3Click(Sender: TObject);
    procedure Edit13KeyPress(Sender: TObject; var Key: Char);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_inputpoint: TForm_inputpoint;

implementation

uses F_selectname, F_DM;

{$R *.dfm}

procedure TForm_inputpoint.SpeedButton1Click(Sender: TObject);
begin

//////姓名选择
form_selectname.ShowModal;
with dm do
begin
   try
     if form_selectname.ListView1.Selected<>nil then
      begin
       edit1.text:=form_selectname.ListView1.Selected.Caption;
       adotable.open;
       adotable.Filtered:=false;
       adotable.Filter:='name='''+trim(edit1.text)+'''';
       adotable.Filtered:=true;
       edit1.text:=adotable.FieldValues['name'];
      edit2.Text:=adotable.FieldValues['bianhao'];
      edit5.Text:=adotable.FieldValues['dengji'];
      edit4.Text:=adotable.FieldValues['current_point'];
      edit6.Text:=adotable.FieldValues['leiji_point'];
      edit3.Text:=adotable.FieldValues['zong_point'];
      edit13.Text:=adotable.FieldValues['money'];
      edit7.Text:=adotable.FieldValues['shangshu'];
      edit8.Text:=adotable.FieldValues['shangshuname'];
      edit9.Text:=adotable.FieldValues['proxy'];
      edit10.Text:=adotable.FieldValues['proxy_name'];
      edit11.Text:=adotable.FieldValues['proxy_'];
      edit12.Text:=adotable.FieldValues['proxy_name'];
       adotable.Filtered:=false;
      end;
   except
      showmessage('操作错误,或者没有相关的数据');
   end;
   adotable.close;
end;
//////////////////////////
//with dm do
//begin
//   adoquery.Close;
//   adoquery.SQL.Clear;
//   adoquery.sql.Text:='select * from yeji where name='''+trim(edit1.text)+'''';
//   adoquery.Open;
//   if adoquery.RecordCount>=1 then
//   begin
//      edit1.text:=adoquery.FieldValues['name'];
//      edit2.Text:=adoquery.FieldValues['bianhao'];
//      edit5.Text:=adoquery.FieldValues['dengji'];
//      edit4.Text:=adoquery.FieldValues['current_point'];
//      edit6.Text:=adoquery.FieldValues['leiji_point'];
//      edit3.Text:=adoquery.FieldValues['zong_point'];
//      edit13.Text:=adoquery.FieldValues['money'];
//      edit7.Text:=adoquery.FieldValues['shangshu'];
//      edit8.Text:=adoquery.FieldValues['shangshuname'];
//      edit9.Text:=adoquery.FieldValues['proxy'];
//      edit10.Text:=adoquery.FieldValues['proxy_name'];
//      edit11.Text:=adoquery.FieldValues['proxy_'];
//      edit12.Text:=adoquery.FieldValues['proxy_name'];
//    end;
//end;
///////////////////
end;

procedure TForm_inputpoint.SpeedButton2Click(Sender: TObject);
var
selwhere,selsql:string;
begin
//form_selectname.ShowModal;
if (edit1.Text='') and (edit2.text='') then
exit;

if  edit2.text<>'' then
begin
selwhere:='bianhao';
selsql:=trim(edit2.text);
end;
if edit1.text<>'' then
begin
selwhere:='name';
selsql:=trim(edit1.text);
end;

with dm do
begin
   adoquery.Close;
   adoquery.SQL.Clear;
   adoquery.sql.Text:='select * from aaa where '+trim(selwhere)+'='''+trim(selsql)+'''';
   adoquery.Open;
   if adoquery.RecordCount>=1 then
   begin
      edit1.text:=adoquery.FieldValues['name'];
      edit2.Text:=adoquery.FieldValues['bianhao'];
      edit5.Text:=adoquery.FieldValues['dengji'];
      edit4.Text:=adoquery.FieldValues['current_point'];
      edit6.Text:=adoquery.FieldValues['leiji_point'];
      edit3.Text:=adoquery.FieldValues['zong_point'];
      edit13.Text:=adoquery.FieldValues['money'];
      edit7.Text:=adoquery.FieldValues['shangshu'];
      edit8.Text:=adoquery.FieldValues['shangshuname'];
      edit9.Text:=adoquery.FieldValues['proxy'];
      edit10.Text:=adoquery.FieldValues['proxy_name'];
      edit11.Text:=adoquery.FieldValues['proxy_'];
      edit12.Text:=adoquery.FieldValues['proxy_name'];
    end;
end;
end;



procedure TForm_inputpoint.Edit13KeyPress(Sender: TObject; var Key: Char);
begin
 if  not (key in ['0'..'9',#8,#46,#110,#190]) then
    begin
     messagedlg('对不起,您只能在此进行输入数字 !',mtinformation,[mbok],0);
     (sender as Tedit).SetFocus;
     key:=#0;
     end;
end;


//###############################################################################
//###############################################################################
//###############加点数70点
procedure TForm_inputpoint.BitBtn1Click(Sender: TObject);
var
name,bianhao,sql:string;
count:real;
i,forcount:integer;
name01,name02,name03,name04,name05,name06,name07,name08,name09,name10,name11,name12:string;  //临时名字
bianhao01,bianhao02,bianhao03,bianhao04,bianhao05,bianhao06,bianhao07,bianhao08,bianhao09,bianhao10,bianhao11,bianhao12:string; //临时编号
dengji01,dengji02,dengji03,dengji04,dengji05,dengji06,dengji07,dengji08,dengji09,dengji10,dengji11,dengji12:string; //临时等级
count01,count02,count03,count04,count05,count06,count07,count08,count09,count10,count11,count12:integer;  //临时总点数
point01,point02,point03,point04,point05,point06,point07,point08,point09,point10,point11,point12:integer;

begin

  if (edit1.text<>'') and (edit2.text<>'') then
   begin
   name:=edit1.text;
   bianhao:=edit2.text;
   end
   else
   exit;
 if checkbox1.Checked=true then
  begin

   if application.MessageBox(' 警告信息-------您确定要输入点数吗?        '+#13+#13+'      请保证您输入数据的正确性!    ','系统提示',MB_OkCANCEL+MB_Iconinformation)<>IDOK then
    exit;
  end;
 with dm do  //*****************
 begin

     ado.SQL.Clear;
     ado.SQL.text:='select * from aaa';
     ado.Open;
     forcount:=ado.RecordCount;
      for  i:=0  to forcount-1 do
     begin                               

       if i=361 then
         showmessage('okoko');
 /////////////第一人开始  ####### 加奖金
     adoquery.Close;
     adoquery.SQL.Clear;
     adoquery.sql.Text:='select * from aaa where name='''+trim(ado.FieldValues['name'])+''' and bianhao='''+trim(ado.FieldValues['bianhao'])+'''';
     //adoquery.sql.Text:='select * from aaa where name='''+trim(edit1.text)+''' and bianhao='''+trim(bianhao)+'''';
     adoquery.Open;

      dengji01:=adoquery.FieldValues['dengji'];
      count01:=adoquery.fieldvalues['zong_point'];
      point01:=adoquery.fieldvalues['current_point'];
      name02:=adoquery.FieldValues['shangshuname'];
      bianhao02:=adoquery.FieldValues['shangshu'];
      adoquery.Edit;
    if  count01>=6510 then
         adoquery.FieldValues['money']:=adoquery.FieldValues['money']+1029
           else if   (count01<6510) and (count01>=980)  then
            adoquery.FieldValues['money']:=adoquery.FieldValues['money']+735
              else if (count01<980) and (count01>=280) then
                adoquery.FieldValues['money']:=adoquery.FieldValues['money']+490
                else adoquery.FieldValues['money']:=adoquery.FieldValues['money']+367.5;
///////////判断定级别 ### 升级 ### 加点数(2) 11111111111111111111111

      point01:=point01+70;
      count01:=count01+70;
      if  (count01>=6510) and ((dengji01='C01') or (dengji01='C')) then
           adoquery.FieldValues['dengji']:='B'
      
       else if   (count01<6510) and (count01>=980) and (dengji01='D')  then
              adoquery.FieldValues['dengji']:='C'

      else if (count01<980) and (count01>=280) and (dengji01='E') then
        adoquery.FieldValues['dengji']:='D'
      else if (count01<280) then
      adoquery.FieldValues['dengji']:='E';

       adoquery.FieldValues['current_point']:=point01;
       adoquery.FieldValues['zong_point']:=count01;

//////////////////////////////////////////////////
      adoquery.Post;



/////////第二人开始  ####### 加奖金
     adoquery.SQL.Clear;
     adoquery.sql.Text:='select * from aaa where name='''+trim(name02)+''' and bianhao='''+trim(bianhao02)+'''';
     adoquery.Open;
   if  ADOQuery.recordcount<1 then
        begin
     // showmessage('添加完毕!');
      // exit;
      ado.Next;
      continue;
       end;

      dengji02:=adoquery.fieldvalues['dengji'];
      count02:=adoquery.fieldvalues['zong_point'];
      point02:=adoquery.fieldvalues['current_point'];
      name03:=adoquery.FieldValues['shangshuname'];
      bianhao03:=adoquery.FieldValues['shangshu'];
      adoquery.Edit;
   if dengji01='E' then
     begin       //EEEEEEEEEE
       if  (count02>=6510)  then
         adoquery.FieldValues['money']:=adoquery.FieldValues['money']+661.5
           else if   (count02<6510) and (count02>=980)  then
            adoquery.FieldValues['money']:=adoquery.FieldValues['money']+367.5
              else if (count02<980) and (count02>=280)  then
                adoquery.FieldValues['money']:=adoquery.FieldValues['money']+122.5;
       end;    //EEEEEEEEEE

     if dengji01='D' then
     begin       //EEEEEEEEEE
       if  (count02>=6510)  then
         adoquery.FieldValues['money']:=adoquery.FieldValues['money']+539
           else if   (count02<6510) and (count02>=980)  then
            adoquery.FieldValues['money']:=adoquery.FieldValues['money']+245;
      end;    //EEEEEEEEEE

       if dengji01='C' then
     begin       //EEEEEEEEEE
       if   (count02<6510) and (count02>=980) and (dengji02='C01')  then
            adoquery.FieldValues['money']:=adoquery.FieldValues['money']+98
           else if  (count02>=6510)  then
         adoquery.FieldValues['money']:=adoquery.FieldValues['money']+294;
      end;    //EEEEEEEEEE

      if dengji01='C01' then
     begin       //EEEEEEEEEE
      if  (count02>=6510)  then
         adoquery.FieldValues['money']:=adoquery.FieldValues['money']+196
       end;    //EEEEEEEEEE

     if dengji01='B'  then
       begin       //EEEEEEEEEE

⌨️ 快捷键说明

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