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

📄 formphszj.pas

📁 小灵通机卡分离模块的设计.建立在数据库服务器
💻 PAS
📖 第 1 页 / 共 5 页
字号:
//检查产品信息
  RetVal :=ProdInfo.ProdValidate();
  if RetVal = 1 then
  begin
    PageControl1.ActivePage := TabSheet3;
    ProdInfo.FocusSet();  //设置焦点
    exit;
  end;
//modify kenshine 20040609
//判断是否选择组群功能(2003.02.22)
  {if ProgFunc.LwlIncrProd.Locate('prod_class','H3',[loCaseInsensitive]) then
  begin
    PhoneInfo.iFlag := 1;
  end
  else
  begin
    PhoneInfo.iFlag := 0;  
    PhoneInfo.LwlPhoneInfo.FieldByName('group_no').AsString := '';
    PhoneInfo.LwlPhoneInfo.FieldByName('inside_no').AsString := '';    
  end;}
//检查号码信息
  PhoneInfo.iProtCode := ProdInfo.LwlProdInfo.FieldByName('prot_code').AsString; //协议号
  PhoneInfo.iExchCode := ProdInfo.LwlProdInfo.FieldByName('exch_code').AsString;  //地址局向
  PhoneInfo.iSwithId := PhoneInfo.LwlPhoneInfo.FieldByName('switch_id').AsString; //交换机
  RetVal := PhoneInfo.PhoneValidate();
  if RetVal = 1 then
  begin
    PageControl1.ActivePage := TabSheet3;
    PhoneInfo.FocusSet(); //设置焦点
    exit;
  end;

//检查担保信息
  if CbxVouch.Checked = true then
  begin
    RetVal :=FrmYhdb.VouchValidate();
    if RetVal = 1 then
    begin
      PageControl1.ActivePage := TabSheet1;
      FrmYhdb.FocusSet(); //设置焦点
      exit;
    end;
  end;

//流动市话号码的校验
  ls_prodno:=trim(phoneinfo.LwlPhoneInfo.fieldbyname('product_no').AsString);
  if (ls_prodno <> '') then
  begin
     if (progfunc.Bevalidprodno(ls_prodno) = 0) then exit;
  end;

//检查押金信息
  RetVal :=ForegiftInfo.Validate();
  if RetVal = 1 then
  begin
    PageControl1.ActivePage := TabSheet4;
    ForegiftInfo.FocusSet(); //设置焦点
    exit;
  end;

//------------------------------------------------------------------------------
//判断帐务和帐目信息是否为空(pdn_account,pdn_accountinfo)
  if (AccountInfo.LwlAccount.State = dsEdit) or (AccountInfo.LwlAccount.State = dsInsert)then
     AccountInfo.LwlAccount.Post;
  if (AccountInfo.LwlAccoInfo.State = dsEdit) or (AccountInfo.LwlAccoInfo.State = dsInsert)then
    AccountInfo.LwlAccoInfo.Post;
  if AccountInfo.LwlAccount.RecordCount = 0 then
  begin
    Accountinfo.LwlAccount.Append;
    MessageDlg('帐目信息不能为空,请输入!',mtError	,[mbok],0);
    exit;
  end
  else
  begin
    if AccountInfo.LwlAccoInfo.RecordCount = 0 then
    begin
      Accountinfo.LwlAccoInfo.Append;
      MessageDlg('帐务信息不能为空,请输入!',mtError	,[mbok],0);
      exit;
    end
  end;

//帐务信息和增值产品不能同时选择预付费方式 (modify on 2003.10.30)
  if (ProgFunc.CbProgFunc.Items.Text <> '') or (ProgFunc.LwlIncrProd.RecordCount > 0) then
  begin
    ProgFunc.LwlIncrProdProp.First;
    while not ProgFunc.LwlIncrProdProp.Eof do
    begin
      //将预付费信息的数据插入当地的数据集中 (modify on 2003.10.08)
      ProgFunc.LwlPrepay.First;
      if ProgFunc.LwlIncrProdProp.FieldByName('item_code').AsString = 'prepay_info' then
      begin
        ls_prodprepay := 1;
        break;
      end;
      ProgFunc.LwlIncrProdProp.Next;
    end;
  end;
  AccountInfo.LwlAccoInfo.First;
  while not AccountInfo.LwlAccoInfo.Eof do
  begin
    if AccountInfo.LwlAccoInfo.FieldByName('account_id').AsString <> '' then
    begin
      ls_accprepay := 1;
    end;
    AccountInfo.LwlAccoInfo.Next;
  end;
  if (ls_prodprepay = 1) and (ls_accprepay = 1) then
  begin
    MessageDlg('帐务信息和增值产品中的预付费方式只能选择一种!',mtInformation,[mbOk],0);
    exit;    
  end;  
//--------------add by yqd about 机卡分离 start------------------------------
//PHS信息校验
  if self.iproducttype = '1'then//合一机
  begin
        if Framephsinfo.Validate=-1 then
        begin
        PageControl1.ActivePage := TabSheet3;
        Framephsinfo.DBEdtpscode.SetFocus;
        exit;
        end;
  end
  else if self.iproducttype = '0' then //分离机
  begin
        if self.PhsSimInfo1.PhsSimValidate =1 then
        begin
        PageControl1.ActivePage := TabSheet3;
        self.PhsSimInfo1.SetFocus;
        exit;
        end;
   end;


//--------------add by yqd about 机卡分离 end -------------------------

  //设置默认长途类型,暂时屏蔽 edited by ljb 2003.12.14
  //ProgFunc.SetDistType();
//------------------------------------------------------------------------------

//调用生成记录的中间件服务
  LwlphsZj.Open;
  LwlphsZj.Clear;
  LwlphsZj.Param.Clear;
  LwlphsZj.CicsRegion := vg_CicsRegion; //设置CicsRegion
  LwlphsZj.CicsProgram := 'DINSTALL';
  SetLinkParmIn(LwlphsZj,'param1',ls_scbh);
  SetLinkParmIn(LwlphsZj,'param2',ls_scls);
 // showmessage(Currddbh);
  SetLinkParmIn(LwlphsZj,'param3',Currddbh);
  SetLinkParmIn(LwlphsZj,'param4',Currslbh);
  SetLinkParmIn(LwlphsZj,'param5',trim(prodinfo.LwlProdInfo.fieldbyname('product_id').AsString));
  SetLinkParmIn(LwlphsZj,'param6',Currywm);
  SetLinkParmIn(LwlphsZj,'param7',Currywm);
  SetLinkParmIn(LwlphsZj,'param8',Currsldlx);
  SetLinkParmIn(LwlphsZj,'param9','0');
  SetLinkParmIn(LwlphsZj,'param10','0');
  SetLinkParmIn(LwlphsZj,'param11',vg_lan_code);
  SetLinkParmIn(LwlphsZj,'param12',vg_lan_code);
  SetLinkParmIn(LwlphsZj,'param13',trim(lwlaccelog.fieldbyname('accept_grade').asstring));
  SetLinkParmIn(LwlphsZj,'param14',vg_accept_mode);
  SetLinkParmIn(LwlphsZj,'param15',vg_order_tache);
  SetLinkParmIn(LwlphsZj,'param16',vg_unit_type);
  SetLinkParmIn(LwlphsZj,'param17',vg_unit_code);
  SetLinkParmIn(LwlphsZj,'param18',vg_exch_code);
  SetLinkParmIn(LwlphsZj,'param19',vg_depart_code);
  SetLinkParmIn(LwlphsZj,'param20',vg_depart_type);
  SetLinkParmIn(LwlphsZj,'param21',vg_oper_code);
  SetLinkParmIn(LwlphsZj,'param22',vg_ipaddr);
  SetLinkParmIn(LwlphsZj,'param23',vg_term_code);

  ls_prodno:=trim(phoneinfo.LwlPhoneInfo.fieldbyname('product_no').AsString);
  if (trim(ls_prodno)<>trim(Oldprodno)) and (trim(Oldprodno)<>'') then
  begin
     ls_prodno:=trim(Oldprodno);
  end
  else
     ls_prodno:='';
  SetLinkParmIn(LwlphsZj,'param24',ls_prodno);
  SetLinkParmIn(LwlphsZj,'param25','1');
  SetLinkParmIn(LwlphsZj,'param26',Frmyhxx.LwlUserInfo.fieldbyname('cust_type').AsString);
///////////////////////////modify by yqd about 机卡分离////////////
     //获取要释放合一机的ps编码
   ls_oldpscode:='';
  if self.iproducttype = '1' then
  begin
        ls_oldpscode:=trim(framephsinfo.oldpscode);
        ls_newpscode:=trim(framephsinfo.Lwlphs.fieldbyname('ps_code').AsString);
        if ls_oldpscode = ls_newpscode then
        begin
                ls_oldpscode:='';
        end
        else
        begin
                ls_oldpscode:=ls_oldpscode+'/';
        end;
  end ;
  SetLinkParmIn(LwlphsZj,'param27',ls_oldpscode);

  //============================================================================
  //经办人信息输入  薛盈  2003-10-3
  //============================================================================
  SetLinkParmIn(LwlphsZj,'param28',FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_name').AsString);
  SetLinkParmIn(LwlphsZj,'param29',FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_cert').AsString);
  SetLinkParmIn(LwlphsZj,'param30',FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_certno').AsString);
  SetLinkParmIn(LwlphsZj,'param31',FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_tel').AsString);
  SetLinkParmIn(LwlphsZj,'param32',FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_addr').AsString);
//////////////////add by yqd start about 机卡分离//////////////////////////////////////////////////
 ///////////////////////释放分离机的sim卡号码
  ls_oldpscode:='';
  if self.iproducttype = '0' then
  begin
        ls_oldpscode:=trim(self.PhsSimInfo1.iOldSim);
        ls_newpscode:=trim(PhsSimInfo1.LwlPhsSim.fieldbyname('card_iccid').AsString);
        if ls_oldpscode = ls_newpscode then
        begin
                ls_oldpscode:=''
        end
        else
        begin
                ls_oldpscode:=ls_oldpscode+'/';
        end;
  end;
 // showmessage('要释放得号码'+ls_oldpscode);
  SetLinkParmIn(LwlphsZj,'param33',ls_oldpscode);

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

  //============================================================================
  SetLinkParmOut(LwlphsZj,'retparam1');
  SetLinkParmOut(LwlphsZj,'retparam2');
  SetLinkParmOut(LwlphsZj,'retparam3');
  SetLinkParmOut(LwlphsZj,'retparam4');
  SetLinkParmOut(LwlphsZj,'retparam5');                                  //产品号码
  SetLinkParmOut(LwlphsZj,'retparam6');                                  //产品编号
  SetLinkParmOut(LwlphsZj,'retparam7');                                  //所有者客户编号
  SetLinkParmOut(LwlphsZj,'retparam8');                                  //所有者客户标识
  SetLinkParmOut(LwlphsZj,'retparam9');                                  //使用者客户编号
  SetLinkParmOut(LwlphsZj,'retparam10');                                 //使用者客户标识

//******************************************************************************
//将用户信息的数据插入当地的数据集中
  for i := 0 to (FrmYhxx.LwlUserInfoOld.FieldCount-1) do
  begin
    LwlphsZj.Append;
    LwlphsZj.Fields[0].asstring := 'E7';
    LwlphsZj.Fields[1].asstring := InttoStr(i);

    LwlphsZj.Fields[2].asstring := '1';
    LwlphsZj.Fields[3].asstring := trim(FrmYhxx.LwlUserInfo.Fields.Fields[i].AsString);
    LwlphsZj.Post;
  end;

//如果客户信息与用户信息不相同,将客户信息的数据插入当地的数据集中
  if CbxDifference.Checked = true then
  begin
    for i := 0 to (FrmKhxx.LwlUserInfoOld.FieldCount-1) do
    begin
      LwlphsZj.Append;
      LwlphsZj.Fields[0].Value := 'E7';
      LwlphsZj.Fields[1].Value := InttoStr(i);
      LwlphsZj.Fields[2].Value := '2';
      LwlphsZj.Fields[3].Value := trim(FrmKhxx.LwlUserInfo.Fields.Fields[i].AsString);
      LwlphsZj.Post;
   end;
  end;

//将帐目信息的数据插入当地的数据集中
  if AccountInfo.LwlAccount.RecordCount > 1 then
  begin
    AccountInfo.LwlAccount.First;
  end;
  for i := 1 to AccountInfo.LwlAccount.RecordCount do
  begin
    for j := 0 to (AccountInfo.LwlAccountOld.FieldCount-1) do
    begin
      LwlphsZj.Append;
      LwlphsZj.Fields[0].Value := 'A3';
      LwlphsZj.Fields[1].Value := InttoStr(j);
      LwlphsZj.Fields[2].Value := InttoStr(i);
      LwlphsZj.Fields[3].Value := trim(AccountInfo.LwlAccount.Fields[j].AsString);
      LwlphsZj.Post;
    end;
    AccountInfo.LwlAccount.Next;
  end;

//将帐务信息的数据插入当地的数据集中
  AccountInfo.LwlAccoInfo.First;
  for i := 1 to AccountInfo.LwlAccoInfo.RecordCount do
  begin
    for j := 0 to (AccountInfo.LwlAccoInfoOld.FieldCount-1) do
    begin
      LwlphsZj.Append;
      LwlphsZj.Fields[0].Value := 'A4';
      LwlphsZj.Fields[1].Value := InttoStr(j);
      LwlphsZj.Fields[2].Value := InttoStr(i);
      LwlphsZj.Fields[3].Value := trim(AccountInfo.LwlAccoInfo.Fields[j].AsString);
      LwlphsZj.Post;
    end;
    AccountInfo.LwlAccoInfo.Next;
  end;

//将产品信息的数据插入当地的数据集中
  ls_ownerid:=trim(FrmYhxx.LwlUserInfo.fieldbyname('cust_id').AsString);
  ls_userid:=trim(FrmKhxx.LwlUserInfo.fieldbyname('cust_id').AsString);
  if CbxDifference.Checked and (ls_userid=ls_ownerid) then
  begin
     ls_userid:='';
  end;
  if (not CbxDifference.Checked) then
  begin
     ls_userid:=ls_ownerid;
  end;
  for i := 0 to (ProdInfo.LwlProdInfoOld.FieldCount-1) do
  begin
    LwlphsZj.Append;
    LwlphsZj.Fields[0].asstring := 'A0';
    LwlphsZj.Fields[1].asstring := InttoStr(i);
    LwlphsZj.Fields[2].asstring := '1';
    if i=4 then  //处理所有者客户和使用者客户
    begin
       Lwlphszj.Fields[3].AsString:=ls_userid;
    end;
    if i=3 then
    begin
       Lwlphszj.Fields[3].AsString:=ls_ownerid;
    end;
    if i=6 then
       Lwlphszj.Fields[3].AsString:=trim(PhoneInfo.LwlPhoneInfo.fieldbyname('product_no').AsString);

    if (i<>3) and (i<>4) and (i<>6) then
    begin
       LwlphsZj.Fields[3].asstring := trim(ProdInfo.LwlProdInfo.Fields[i].AsString);
    end;
    LwlphsZj.Post;
  end;

//将主电话信息的数据插入当地的数据集中
  for i := 0 to (phoneinfo.LwlPhoneInfoOld.FieldCount-1) do
    begin

⌨️ 快捷键说明

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