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

📄 u_copy.pas

📁 销售业绩核算系统
💻 PAS
📖 第 1 页 / 共 3 页
字号:
         begin
        ad.FieldValues['dengji']:=ji;
        firstji:=ji;
        ad.FieldValues['dengji_02']:=ji;
         end
        else
          begin
          ad.FieldValues['dengji']:=adoquery.FieldValues['dengji'];
          ad.FieldValues['dengji_02']:=adoquery.FieldValues['dengji'];
          firstji:=adoquery.FieldValues['dengji'];
          end ;

       firstbianhao:=adoquery.FieldValues['bianhao'];
       firstname:=adoquery.FieldValues['name'];

       ad.FieldValues['username']:=adoquery.FieldValues['name'];
       ad.FieldValues['bianhao_02']:=adoquery.FieldValues['bianhao'];
       
       ad.FieldValues['leibie']:='直销';
       ad.FieldValues['jiangjin']:=qian;
       ad.FieldValues['shijian']:=date;
       ad.Post;
       //#############################

       adoquery.Edit;
       adoquery.FieldValues['money']:=adoquery.FieldValues['money']+qian;
        if ji<>'' then
       adoquery.FieldValues['dengji']:=ji;
      adoquery.FieldValues['current_point']:=point01;
      adoquery.FieldValues['zong_point']:=count01;
      adoquery.Post;
      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;

      //仅仅将级别传下去就可以
      dengji01:=adoquery.FieldValues['dengji'];

//////////////////////////////////////////////////
/////////第一人结束


/////////第二人开始  #######
     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;

 //###########################################################################
 //###########################################################################
 ////////重点//重点//重点//重点///开始循环初始化
  p:=2;
  m:=2;
  k:=3;
  dengji[p-1]:=dengji01;
  while  (adoquery.RecordCount>0) do
          begin

             jj:=jj+1;
             
             ///////////////////////
              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'];

////////第二人第二人/////只判断要升级别的时候 ### 升级 ### 加点数(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
             ji:='E';
             }
   ///////////////////////////////////////////////////////////
    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)  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]=980) then
            ji:='C'
      else if  (count[p]=280) then
             ji:='D'
      else if count[p]<280 then
             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
              //C01的时候     ###B
              if  ((dengji[p-2]='C') or (dengji[p-2]='C01')) and (jj>2) then
                begin
                qian:=196;
                end;
              //C的时候       ###B
              if (dengji[p-2]<>'C') and  (dengji[p-2]<>'C01') and (jj>2) then
                begin
                qian:=294;
                end;
          end;

          //C的时候    #C01  %4育成
          if (count[p]>=980) and (count[p]<6510) and (dengji[p-2]<>'C') and  (dengji[p-2]<>'C01') and (jj>2) then
              begin
              qian:=98;
              cha:='育成';
              end;

           //C的时候  ###B
           if (jj=2) and (count[p]>=6510) then
               begin
                qian:=294
               end;
           //C的时候   ###C01
           if (jj=2) and (count[p]>=980) and (count[p]<6510) then
               begin
                qian:=98;
                cha:='育成';
               end;
     end ;

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

      //#########
      if dengji[p-1]='B01'  then       //这时候的等级是相对的
          begin

            //B01的时候     ###B02
            if ((count[p]>=6510) and (dengji[p-2]='B') and (jj>2)) or ((count[p]>=6510) and (dengji[p-2]='B01') and ((dengji[p-3]='C') or (dengji[p-3]='C01')) and (jj>3)) then
             begin
             //showmessage('B01');
             qian:=49;
             cha:='育成';
             end ;

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

           //B的时候    ###B01
           if (jj=2) and  (count[p]>=6510) then
              begin
              qian:=98;
              cha:='育成';
              end;

      end;

      //#########################
      if dengji[p-1]='B02' then
        begin
            //B01的时候      ###B02
            if (count[p]>=6510) and (dengji[p-2]='B') and (jj>2) then
                 begin
                 qian:=49;
                 cha:='育成';
                 end;
         //B01的时候      ###B02
            if (count[p]>=6510) and (dengji[p-2]='B01') and ((dengji[p-3]='C') or (dengji[p-3]='C01')) and (jj>3) then
                 begin
                 qian:=49;
                 cha:='育成';
                 end;
         //B的时候     ###B01
         if (count[p]>=6510) and (dengji[p-2]<>'B') and (dengji[p-2]<>'B01')  and (dengji[p-2]<>'B02') and (jj>2) then
                 begin
                 qian:=98;
                 cha:='育成';
                 end;
         //B的时候    ###B01
         if (jj=2) and (count[p]>=6510) then
              begin
              qian:=98;
              cha:='育成';
              end;
        end;

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

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

       if qian=0 then
         ad.Cancel
         else
       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;

       ado.Next;     //
       end;

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



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

end;

procedure TForm_copy.Button1Click(Sender: TObject);
var
i,endi:integer;
temp:string;
begin
  with dm do
begin
   //adoquery.Close;
   adoquery.SQL.Clear;
   adoquery.SQL.Text:='select shangshuname from aaa  order by bianhao';
   adoquery.Open;
   temp:=inttostr(adoquery.RecordCount);
   endi:=strtoint(Epersonal.text);
   if not adoquery.Eof then
     begin
     //temp:=adoquery.FieldValues['shangshuname'];
      adoquery.Last;
      temp:=adoquery.FieldValues['shangshuname'];
      listbox1.Clear;
      for i :=0  to endi-1 do
      begin
        //edit1.Items.Add(adoquery.FieldValues['shangshuname']);
        //listbox1.Items.Add(adoquery.FieldValues['shangshuname']);
        listbox1.Items.Insert(0,adoquery.FieldValues['shangshuname']);
        temp:=adoquery.FieldValues['shangshuname'];
        adoquery.Prior;
      end;
     end;
end;

end;

///########################################################################################
////加70点数
procedure TForm_copy.BitBtn4Click(Sender: TObject);
var
name,bianhao,sql:string;

i,endi,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;
 testname,testbianhao:string;  //察看变量测试
begin

end;

procedure TForm_copy.ListBox1Click(Sender: TObject);
begin
   //单击
   if listbox1.Items.Strings[listbox1.ItemIndex]='' then
         exit;

   edit1.Text:=trim(Listbox1.Items.Strings[listbox1.itemindex]);
   speedbutton2.Click;

end;

end.

⌨️ 快捷键说明

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