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

📄 frmphsmodifyinfo.pas

📁 小灵通机卡分离模块的设计.建立在数据库服务器
💻 PAS
📖 第 1 页 / 共 5 页
字号:
end;

//根据Tag控制控件的修改
procedure TFrmPhsmodify.EnableControl(APanel: TFrame);
var
  iCount :integer;
begin
  if apanel=nil then exit;
  with APanel do
  begin
    for iCount:=0 to ControlCount-1 do
    begin
      if pos(IntChangeStr(Controls[iCount].Tag,2,'0')+ '/',LwlServInfo.FieldByName('field_modify').AsString) > 0 then
      begin
        if Controls[iCount].ClassType=TDBLookupComboBox then
        begin
          TDBLookupComboBox(controls[iCount]).Enabled := true;
          TDBLookupComboBox(controls[iCount]).Color:=clWhite;
        end;
        if Controls[iCount].ClassType=TDBEdit then
        begin
          TDBEdit(controls[iCount]).Enabled := true;
          TDBEdit(controls[iCount]).color :=clWhite;
        end;
        if Controls[iCount].ClassType=TDateTimePicker then
        begin
          TDateTimePicker(controls[iCount]).Enabled := true;
          TDateTimePicker(controls[iCount]).color :=clWhite;
        end;
        if Controls[iCount].ClassType=TButton then
        begin
          TButton(controls[iCount]).Enabled := true;
        end;
        if Controls[iCount].ClassType=TRadioButton then
        begin
          TRadioButton(controls[iCount]).Enabled := true;
          TRadioButton(controls[iCount]).color :=clWhite;
        end;
        if Controls[iCount].ClassType=TCheckBox then
        begin
          TCheckBox(controls[iCount]).Enabled := true;
          TCheckBox(controls[iCount]).Color :=clWhite;
        end;
        if Controls[iCount].ClassType=TEdit then
        begin
          TEdit(controls[iCount]).Enabled := true;
          TEdit(controls[iCount]).color :=clWhite;
        end;
        if Controls[iCount].ClassType=TComboBox then
        begin
          TComboBox(controls[iCount]).color :=clWhite;
        end;
      end;
    end;
  end;
end;
function TFrmPhsmodify.appendvalue(alink:tlwlink;apara1,apara2,apara3,apara4,apara5,apara6,apara7,apara8,apara9:string):integer;
begin
   result:=0;
   alink.Append;
   alink.FieldByName('tab_brief').AsString:=apara1;
   alink.FieldByName('fld_id').AsString:=apara2;
   alink.FieldByName('field_code').AsString:=apara3;
   alink.FieldByName('field_name').AsString:=apara4;
   alink.FieldByName('field_type').AsString:=apara5;
   alink.FieldByName('record_type').AsString:=apara6;
   alink.FieldByName('record_id').AsString:=apara7;
   alink.FieldByName('new_value').AsString:=apara8;
   alink.FieldByName('old_value').AsString:=apara9;
   alink.Post;
end;
//初始化窗口
procedure TFrmPhsmodify.FormShow(Sender: TObject);
var
  i,j,li_step :integer;
  UserId, CustId,ls_flag,ls_tablestr,ls_newflagstr,ls_ywlx : string;
  llwl_userinfo:TLWLINK;
begin
  inherited;
  //把产品信息与PHS信息进行关联
  framephsinfo.Setprodinfo(prodinfo);
//******************************************************************************
//生产编号为空,窗口生成空白记录;不为空则通过生产编号和生产类型调出记录
  Currcpbh:=FrmYyslzx.Getcpbh();
  Currsldlx:=FrmYyslzx.Getsldlx();
  Currscbh:=FrmYyslzx.Getscbh();
  Currscls:=FrmYyslzx.Getscls();
  Currslbh:=FrmYyslzx.Getslbh();
  Currddbh:=FrmYyslzx.Getddbh();
  Currywm:=FrmYyslzx.Getywm();
  ls_ywlx:=FrmYyslzx.Getywlx();
  label6.caption:=FrmYyslzx.Getywmc();
  if currcpbh = -1 then icpbh:='';
  if currcpbh <>-1 then icpbh :=inttostr(currcpbh);
  if currscbh = -1 then iscbh:='';
  if currscbh <> -1 then iscbh := inttostr(currscbh);
  if currscls = -1 then iscls := '';
  if currscls <> -1 then iscls := inttostr(currscls);
  //初始化窗口

  //==========================================
  //经办人信息初始化  薛盈  2003-10-4
  //=============================================
  FrmYhxx.ApplyInfo1.ApplyInit;
  //==============================================
  Frmyhxx.UserInit();
  ProdInfo.ProdInit();
  SetBlankData(LwlAcceLog);
  LwlAcceLog.FieldByName('accept_grade').AsString :='C';                //受理等级
  phoneinfo.PhoneInit;
  progfunc.ProgFuncInit;
  framephsinfo.Init;
  //add by zgw 20050427
  PhsSimInfo1.PhsSimInit();

  ls_flag:='0';
  //检索数据
  //判定所要检索的信息
  ls_tablestr:='A0/E7/A1/G0/G1/A5/E7/A0/A1/G0/G1/A5/D6/D6/H3/H3/J2/J2/';
  ls_newflagstr:='0/0/0/0/0/0/1/1/1/1/1/1/0/1/0/1/0/1/';
  ls_flag:='/owner/main////owner//main//////////';
  //检索相关表信息
  if RetrieveTables(Currscbh,Currscls,currcpbh,ls_tablestr,ls_newflagstr,ls_flag)<0 then exit;
  //分拣客户信息
  GetTableInfo(Frmyhxx.LwlUserInfo,'E7','1','owner');
  Gettableinfo(Frmyhxx.LwlUserInfoOld,'E7','0','owner');
  if Frmyhxx.LwlUserInfo.RecordCount <= 0 then
  begin
     messagedlg('检索所有者客户信息失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
  if frmyhxx.LwlUserInfoOld.RecordCount <= 0 then
  begin
     messagedlg('检索客户原信息失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
  //分拣产品信息
  GetTableInfo(prodinfo.LwlProdInfo,'A0','1','');
  if prodinfo.LwlProdInfo.RecordCount <= 0 then
  begin
     messagedlg('检索产品信息失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
  GetTableInfo(prodinfo.LwlProdInfoOld,'A0','0','');
  if prodinfo.LwlProdInfoOld.RecordCount <= 0 then
  begin
     messagedlg('检索产品原信息失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
  //分拣号码信息
  GetTableInfo(phoneinfo.LwlPhoneInfo,'A1','1','main');
  if phoneinfo.LwlPhoneInfo.RecordCount <= 0 then
  begin
     messagedlg('检索号码信息失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
  GetTableInfo(phoneinfo.LwlPhoneInfoOld,'A1','0','main');
  if phoneinfo.LwlPhoneInfoOld.RecordCount <= 0 then
  begin
     messagedlg('检索号码原信息失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
  //分拣产品增值信息
  GetTableInfo(ProgFunc.LwlIncrProdOld,'G0','0','');
  GetTableInfo(ProgFunc.LwlIncrProd,'G0','1','');
  GetTableInfo(ProgFunc.LwlIncrProdPropOld,'G1','0','');
  GetTableInfo(ProgFunc.LwlIncrProdProp,'G1','1','');
  ProgFunc.gCpbh := ProdInfo.LwlProdInfo.FieldByName('product_id').AsString;
  //modify kenshine 20040816
  //由于缺少客户编号影响了预付费信息的互改
  ProgFunc.gCustId:= Frmyhxx.LwlUserInfo.FieldByName('cust_id').AsString;
  //modify kenshine 20040816
  ProgFunc.FuncShow();
  if (ProgFunc.LwlIncrProd.RecordCount <=0) and (ProgFunc.LwlIncrProdProp.RecordCount > 0) then
  begin
    MessageDlg('增值产品信息有误,请确认!',mtWarning,[mbok],0);
    PostMessage(self.handle, WM_CLOSE, 0, 0);
    exit;
  end;
  //检索预付费信息(modify on 2003.10.08)
  if ProgFunc.LwlIncrProdProp.Locate('item_code','prepay_info',[loCaseInsensitive]) then
  begin
    GetTableInfo(ProgFunc.LwlPrepay,'H3','1','');
    if ProgFunc.LwlPrepay.RecordCount <=0 then
    begin
      MessageDlg('预付费信息有误,请确认!',mtWarning,[mbok],0);
      PostMessage(self.handle, WM_CLOSE, 0, 0);
      exit;
    end;
    GetTableInfo(ProgFunc.LwlPrepayOld,'H3','0','');
  end;

  //modify kenshine 20040609
  //PHS的CENTREX功能检验(modify on 2003.02.23)
  {if ProgFunc.LwlIncrProd.Locate('prod_class','H3',[loCaseInsensitive]) then
  begin
    PhoneInfo.DbeGroupNo.Enabled := true;
    PhoneInfo.DbeGroupNo.Color := clWindow;
    PhoneInfo.DbeInsideNo.Enabled := true;
    PhoneInfo.DbeInsideNo.Color := clWindow;
    PhoneInfo.BtnGroupSel.Enabled := true;
  end
  else
  begin
    PhoneInfo.DbeGroupNo.Enabled := false;
    PhoneInfo.DbeGroupNo.Color := $00EAEAEA;
    PhoneInfo.DbeInsideNo.Enabled := false;
    PhoneInfo.DbeInsideNo.Color := $00EAEAEA;
    PhoneInfo.BtnGroupSel.Enabled := false;
  end;}

//  CopyData(ProgFunc.LwlIncrProd,ProgFunc.LwlIncrProdShow);
//  CopyData(ProgFunc.LwlIncrProdProp,wProgFunc.LwlIncrProdPropShow);
  //分拣终端设备信息
  GetTableInfo(ProgFunc.LwlDeviceOld,'A5','0','');
  GetTableInfo(ProgFunc.LwlDevice,'A5','1','');
  if ProgFunc.LwlDevice.RecordCount > 0 then
  begin
    SetComboBox(ProgFunc.CbDevice,ProgFunc.LwlDevice,'LuDevCode');
  end;

  if (iscbh<>'') and ((ls_ywlx='1') or (ls_ywlx='2')) then
  begin
      GetProdData(LwlAcceLog,iscbh,iscls,icpbh,'B2','1','');                      //检索营业受理辅助信息
      if LwlAcceLog.RecordCount = 0 then
      begin
            MessageDlg('缺少受理辅助信息,请确认!',mtError,[mbok],0);
            PostMessage(self.handle, WM_CLOSE, 0, 0);
            exit;
      end;
      //==========================================================================================
    //显示经办人信息  薛盈2003-10-1
    //==========================================================================================
    FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_name').AsString := LwlAcceLog.FieldByName('apply_name').AsString;
    FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_cert').AsString := LwlAcceLog.FieldByName('apply_cert').AsString;
    FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_certno').AsString := LwlAcceLog.FieldByName('apply_certno').AsString;
    FrmYhxx.ApplyInfo1.LwlApplyInfo.FieldByName('apply_tel').AsString := LwlAcceLog.FieldByName('apply_tel').AsString;
    //==========================================================================================
    //以上为修改内容
    //==========================================================================================
  end;
//add by zgw 20050425
//检索phssim信息
if prodinfo.LwlProdInfo.FieldByName('prod_prop').AsString  ='B3' then

begin
   prodinfo.DblcProdProp.Enabled :=false;
   framephsinfo.Visible :=false;
   framephsinfo.DBEdtpscode.Enabled :=false ;
   cbxrepair.Enabled :=false;
   cbxrepair.Visible :=false;
   PhsSimInfo1.Visible :=true;
   GetTableInfo(PhsSimInfo1.LwlPhsSim ,'J2','1','');

   Gettableinfo(PhsSimInfo1.lwlphsSimold,'J2','0','');
  if PhsSimInfo1.LwlPhsSim.RecordCount <= 0 then
  begin
     messagedlg('检索无线市话新信息phsSim失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
  if PhsSimInfo1.lwlphsSimold.RecordCount <= 0 then
  begin
     messagedlg('检索无线市话原信息phsSim失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
end
else if prodinfo.LwlProdInfo.FieldByName('prod_prop').AsString  ='B1' then
begin
 prodinfo.DblcProdProp.Enabled :=false;
   framephsinfo.Visible :=true;
   PhsSimInfo1.Visible :=false;
   cbxmend.Visible :=false;
    PhsSimInfo1.DbeCardiccid.Enabled:=false;
    PhsSimInfo1.DblcCardType.Enabled :=false;
    PhsSimInfo1.DbeProdsecNo.Enabled :=false;
    CBxmend.Enabled :=false;
  //分拣流动市话产品信息
  GetTableInfo(framephsinfo.lwlphs,'D6','1','');
  Gettableinfo(framephsinfo.lwlphsold,'D6','0','');
  if framephsinfo.lwlphs.RecordCount <= 0 then
  begin
     messagedlg('检索无线市话新信息失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;
  if framephsinfo.lwlphsold.RecordCount <= 0 then
  begin
     messagedlg('检索无线市话原信息失败!',mtinformation,[mbok],0);
     PostMessage(self.handle, WM_CLOSE, 0, 0);
     exit;
  end;

end;
//add end

  //取出业务修改信息表对应信息
  if FrmYyslzx.Getywm <> '' then
  begin
      if GetDataThree(LwlServInfo,'GDATABY','servinfo',ProdInfo.LwlProdInfo.FieldByName('prod_class').AsString,FrmYyslzx.Getywm()) =1 then
      begin
        PostMessage(self.handle, WM_CLOSE, 0, 0);
        exit;
      end;
  end
  else
  begin
      if GetDataThree(LwlServInfo,'GDATABY','servinfo',ProdInfo.LwlProdInfo.FieldByName('prod_class').AsString,FrmYyslzx.GetOldywmstr()) = 1 then
      begin
        PostMessage(self.handle, WM_CLOSE, 0, 0);
        exit;
      end;
  end;

  //使老信息不可修改
  disablePanel(FrmYhxx);
  FrmYhxx.DbeRelPeop.Enabled :=true;
  FrmYhxx.DbeRelPeop.Color := clWhite;
  FrmYhxx.DbeRelPhon.Enabled :=true;
  FrmYhxx.DbeRelPhon.Color := clWhite;
  FrmYhxx.DbeRelEmail.Enabled :=true;

⌨️ 快捷键说明

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