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

📄 u_copy.pas

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

       end;

 //###########################################################################
 //###########################################################################
  p:=2;
  m:=2;
  k:=3;
  dengji[p-1]:=dengji01;
  while  (adoquery.RecordCount>0) do
          begin        

             jj:=jj+1;

          //  if sname[k]='白玉碧' then
           //    showmessage('白玉碧');
              ///////////////////////
              dengji[p]:=adoquery.fieldvalues['dengji'];
              count[p]:=adoquery.fieldvalues['zong_point'];
              point[p]:=adoquery.fieldvalues['current_point'];
              bname[m]:=adoquery.fieldvalues['name'];
              bbianhao[m]:=adoquery.fieldvalues['bianhao'];
              sname[k]:=adoquery.FieldValues['shangshuname'];
              sbianhao[k]:=adoquery.FieldValues['shangshu'];

           //   if sname[k]='白玉碧' then
           //    showmessage('白玉碧');
////////第二人第二人/////只判断要升级别的时候 ### 升级 ### 加点数(2) 222222222222//只考虑比现有级别高才升级的情况

            ji:='';

            point[p]:=adoquery.FieldValues['current_point']+70;
            count[p]:=adoquery.FieldValues['zong_point']+70;

       if  (count[p]>=6510) and (dengji[p-1]='B01') and (dengji[p]='B01') then
            ji:='B02'
      else if  (count[p]>=6510) and (dengji[p-1]='B') and (dengji[p]='B') then
            ji:='B01'
      else if  (count[p]>=6510) and (dengji[p]<>'B01') and (dengji[p]<>'B02') then
            ji:='B'
      else if   (count[p]<6510) and (count[p]>=980) and (dengji[p-1]='C') and (dengji[p]='C') then
            ji:='C01'
      else if   (count[p]<6510) and (count[p]>=980) and (dengji[p]<>'C01') then
            ji:='C'
      else if (count[p]<980) and (count[p]>=280) then
             ji:='D'
      else if count[p]<280 then                              //错误///count04
             ji:='E';
   ///////////////////////////////////////////////////////////

      //////增加点数
       adoquery.Edit;
      // adoquery.FieldValues['money']:=adoquery.FieldValues['money']+qian;
       if ji<>'' then
       adoquery.FieldValues['dengji']:=ji;
       adoquery.FieldValues['current_point']:=point[p];
       adoquery.FieldValues['zong_point']:=count[p];
       adoquery.Post;


//////////////////////////////////////////////////////
      //////增加点数后的纪录
      adoquery.SQL.Clear;
      adoquery.sql.Text:='select * from aaa where name='''+trim(bname[m])+''' and bianhao='''+trim(bbianhao[m])+'''';
      adoquery.Open;
      dengji[p]:=adoquery.fieldvalues['dengji'];
      count[p]:=adoquery.fieldvalues['zong_point'];
      point[p]:=adoquery.fieldvalues['current_point'];


            //####
            ad.sql.clear;
            ad.sql.text:='select * from yejidan';
            ad.Open;
            ad.Append;
            ad.FieldValues['bianhao']:=firstbianhao;
            ad.FieldValues['zhiname']:=firstname;
            ad.FieldValues['dengji']:=firstji;
            ad.FieldValues['username']:=adoquery.FieldValues['name'];
            ad.FieldValues['bianhao_02']:=adoquery.FieldValues['bianhao'];
            ad.FieldValues['dengji_02']:=adoquery.FieldValues['dengji'];
            ad.FieldValues['shijian']:=date;
            //####

///////////////////////////////////////////////////////////////////////////////

    cha:='';
    qian:=0;  //钱进行初始化
   if dengji[p-1]='E' then

     begin
       if  (count[p]>=6510)  then
         qian:=661.5
           else if   (count[p]<6510) and (count[p]>=980)  then
             qian:=367.5
              else if (count[p]<980) and (count[p]>=280)  then
                qian:=122.5;
       end;

     if dengji[p-1]='D' then
     begin
      if  (count[p]>=6510)  then
         qian:=539
           else if   (count[p]<6510) and (count[p]>=980)  then
            qian:=245;
      end;

       if dengji[p-1]='C' then
        begin
       if   (count[p]<6510) and (count[p]>=980)  then  // and (dengji[p]='C01')
             begin
             qian:=98;
             cha:='育成';
             end
           else if  count[p]>=6510 then
              qian:=294 ;
      end;

     //####
      if (dengji[p-1]='C01')  then
     begin
         if  (count[p]>=6510)  then
         begin
              if  (dengji[p-2]='C') or (dengji[p-2]='C01') then
                begin
                //showmessage('196');
                qian:=196;
                end;
              if  (dengji[p-2]<>'C') and  (dengji[p-2]<>'C01') then
                begin
                //showmessage('294');
                qian:=294;
                end;
          end;

          if (count[p]>=980) and (count[p]<6510) and (dengji[p-2]<>'C') and  (dengji[p-2]<>'C01') then
              begin
              //showmessage('C01');
              qian:=98;
              cha:='育成';
              end
     end ;

     //####
     if dengji[p-1]='B'  then
      begin
        if  (count[p]>=6510)  then
             begin
              //showmessage('B');
              qian:=98;
              cha:='育成';
              end;
      end;

      //####
      if dengji[p-1]='B01'  then
       begin
          if (count[p]>=6510) and (dengji[p-2]='B') then
             begin
             //showmessage('B01');
             qian:=49;
             cha:='育成';
             end ;

         if (count[p]>=6510)  and  (dengji[p-2]<>'B01') and (dengji[p-2]<>'B') then
                       begin
                       //showmessage('B01');
                       qian:=98;
                       cha:='育成';
                       end;
      end;

      //####
      if dengji[p-1]='B02' then
        begin
            if (count[p]>=6510) and (dengji[p-2]='B')  then
                 begin
                 //showmessage('B02');
                 qian:=49;
                 cha:='育成';
                 end;
             if  (count[p]>=6510) and (dengji[p-2]<>'B') and (dengji[p-2]<>'B01')  and (dengji[p-2]<>'B02') then
                 begin
                 //showmessage('B02');
                 qian:=98;
                 cha:='育成';
                 end;
        end;

      //###################

      ad.FieldValues['jiangjin']:=qian;
       if cha='' then
         ad.FieldValues['leibie']:='差额'
       else
          ad.FieldValues['leibie']:=cha;
       ad.Post;

       //###################
////////////////////////////////////////////
       adoquery.Edit;
       adoquery.FieldValues['money']:=adoquery.FieldValues['money']+qian;
       adoquery.Post;

//////////////////////////////////////////结束

/////////查找下一个人
       adoquery.SQL.Clear;
       adoquery.sql.Text:='select * from aaa where name='''+trim(sname[k])+''' and bianhao='''+trim(sbianhao[k])+'''';
       adoquery.Open;
        p:=p+1;
        k:=k+1;
        m:=m+1

       end;



    showmessage('成功!');
  //###########################################################################
 //###########################################################################



end;  //*****************


end;
 
procedure TForm_copy.FormActivate(Sender: TObject);
var
i:integer;
begin
edit1.text:='';
edit2.text:='';
edit3.text:='';
edit4.text:='';
edit5.text:='';
edit6.text:='';
edit7.text:='';
edit8.text:='';
edit9.text:='';
edit10.text:='';
edit11.text:='';
edit12.text:='';
edit13.text:='';
listbox1.Clear;
Edit1.Clear;


end;

procedure TForm_copy.BitBtn3Click(Sender: TObject);
var
i:integer;
begin
  with dm do
  begin
     adoquery.SQL.Clear;
     adoquery.sql.text:='select * from aaa';
     adoquery.Open;
      
     for  i:=0  to adoquery.RecordCount-1 do
     begin
          adoquery.Edit;
          adoquery.FieldValues['dengji']:='E';     //级别当前点累计点数
          adoquery.FieldValues['current_point']:=0;
          adoquery.FieldValues['leiji_point']:=0;
          adoquery.FieldValues['zong_point']:=0;
          adoquery.FieldValues['money']:=0;
          adoquery.FieldValues['proxy_']:='代理员';
          adoquery.FieldValues['proxy_name']:='代理员姓名';
          adoquery.FieldValues['proxyname']:='王新安';
          adoquery.FieldValues['proxy']:='HK080208';
          adoquery.Post;
          adoquery.Next;
     end; 

     adoquery.Close;
  end;


end;

///#######################################################################################
procedure TForm_copy.SpeedButton3Click(Sender: TObject);
var
name,bianhao,sql:string;

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;
name01,name02:string;  //临时名字
bianhao01,bianhao02:string; //临时编号
dengji01,dengji02:string; //临时等级
count01,count02:integer;  //临时总点数
point01,point02:integer;
sname,sbianhao,dengji:array[0..100] of string;
bname,bbianhao:array[0..100] of string;
count,point:array[0..50] of integer;
 p,k,m:integer;
 qian:single;   //奖金
 cha,ji:string;
 jj:integer;   //判断现在处在几级运算
 firstname,firstbianhao,firstji:string;
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  //***************** 675
 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<358 then
    // if   i>=358 then
    // if (i<325) or (i>328) then
          begin
          ado.Next;
          continue;
          end;

 /////////////第一人开始  ####### 加奖金
     adoquery.Close;
     adoquery.SQL.Clear;
     adoquery.sql.Text:='select * from aaa where name='''+trim(ado.FieldValues['shangshuname'])+''' and bianhao='''+trim(ado.FieldValues['shangshu'])+'''';
     //adoquery.sql.Text:='select * from aaa where name='''+trim(edit1.text)+''' and bianhao='''+trim(edit2.text)+'''';
     //adoquery.sql.Text:='select * from aaa where name='''+trim(edit1.text)+''' and bianhao='''+trim(bianhao)+'''';
     adoquery.Open;
  if  ADOQuery.recordcount<1 then
        begin
   //  showmessage('添加完毕!');
   //  exit;
      ado.Next;
      continue;
       end;

///////////第一人第一人////判断定级别 ### 升级 ### 加点数(2) 11111111111111111111111

      //#####
       jj:=1;
       ji:='';
       //#####
      dengji01:=adoquery.FieldValues['dengji'];
      point01:=adoquery.FieldValues['current_point']+70;
      count01:=adoquery.FieldValues['zong_point']+70;
      name02:=adoquery.FieldValues['shangshuname'];     //上级姓名
      bianhao02:=adoquery.FieldValues['shangshu'];      //上级编号

       {
       if  (count01>=6510) and ((dengji01='C01') or (dengji01='C')) then
           ji:='B'
       else if   (count01<6510) and (count01>=980) and (dengji01='D')  then
           ji:='C'
      else if (count01<980) and (count01>=280) and (dengji01='E') then
             ji:='D'
      else if (count01<280) then
               ji:='E';
        }

       if  (count01=6510)  then
           ji:='B'
       else if   (count01=980)  then
           ji:='C'
      else if (count01=280)  then
             ji:='D'
      else if (count01<280) then
               ji:='E';


       qian:=0;       //钱进行初始化
      /////////////////
       if  count01>=6510 then
               qian:=1029
           else if   (count01<6510) and (count01>=980)  then
               qian:=735
              else if (count01<980) and (count01>=280) then
                  qian:=490
                else
                   qian:=367.5;

        //######################
       ad.SQL.Clear;
       ad.SQL.Text:='select * from yejidan';
       ad.Open;
       ad.Append;
       ad.FieldValues['bianhao']:=adoquery.FieldValues['bianhao'];
       ad.FieldValues['zhiname']:=adoquery.FieldValues['name'];
         if ji<>'' then

⌨️ 快捷键说明

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