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

📄 unit_archivesgroupinfo.pas

📁 delphi开发的中国移动大客户管理系统,后台数据库为oracle
💻 PAS
📖 第 1 页 / 共 3 页
字号:
            QueryCustInfoMember.Close;
            QueryCustInfoMember.Open;
         End;
      3:
         Begin
            If QueryGroupMemoDay.IsEmpty Then
               Begin
                  Application.MessageBox('请选择将要删除的集团客户纪念日资料!','提示',MB_ICONINFORMATION);
                  Exit;
               End;
            If Application.MessageBox('是否确定删除该集团客户纪念日资料.','系统提示',MB_YesNO)=IDno then
               Exit;

            SQL:='Delete From T_F_GroupMemoDay Where GMEMO_ID='+QueryGroupMemoDay.FieldByName('GMEMO_ID').AsString;

            AnalyzeSQL(SQL);        //执行SQL语句

            QueryGroupMemoDay.Close;
            QueryGroupMemoDay.Open;
         End;
      4:
         Begin
         End;
   End;
end;

procedure TForm_ArchivesGroupInfo.Btn_CancelClick(Sender: TObject);
begin
   iSign:=0;
   Fun_ButtonStatus(Self,False);
   Case PageControl1.ActivePageIndex Of
      0:
         Begin
            Fun_ComponentStatus(Self,0,False,Panel3);
            queryjtyhAfterScroll(Nil);
         End;
      1:
         Begin
         End;
      2:
         Begin
            Fun_ComponentStatus(Self,0,False,Panel8);
            QueryCustInfoMemberAfterScroll(Nil);
         End;
      3:
         Begin
            Fun_ComponentStatus(Self,0,False,Panel10);
            QueryGroupMemoDayAfterScroll(Nil);
         End;
      4:
         Begin
         End;
   End;
   Panelleft.Enabled:=True;


end;


procedure TForm_ArchivesGroupInfo.PageControl1Change(Sender: TObject);
Var
   SQL:String;
begin
   Case PageControl1.ActivePageIndex Of
      0:
         Begin
            ButtonVisible(True);
            ShowRecord(QueryJtyh,Panel3);
            If QueryJTYH.IsEmpty Then
               FlatComboBox_JTBZ.ItemIndex:=0
            Else
               FlatComboBox_JTBZ.ItemIndex:=QueryJtyh.FieldByName('JTBZ').AsInteger;
         End;
      1:
         Begin
            ButtonVisible(False);
            If Not QueryJtyh.Active then
               Exit;

            If QueryJTYH.IsEmpty Then
               Exit;

            SQL:='select a.*,c.productname,d.par_desc statsm '+
                 'from t_f_custinfo a,(select Par_Values ProductNo,Par_Desc ProductName from t_d_config where Upper(Par_Name)=''BRANDNAME'') c,t_v_custstatus d'+
                 ' where a.fybz<>0 and a.user_zjbs=c.productno(+) and a.stat=d.stat(+) And '+
                 ' jtyhdm='+ Queryjtyh.fieldbyname('JTYHDM').asstring +' And'+
                 ' a.CityNo='''+Queryjtyh.fieldbyname('CityNo').asstring+''' And a.Off_no_Home='+Queryjtyh.fieldbyname('Off_No_Home').asstring;

            QueryT_F_CustInfo.Close;
            QueryT_F_CustInfo.SQL.Clear;
            QueryT_F_CustInfo.SQL.Add(SQL);
            QueryT_F_CustInfo.Open;

            Label26.Caption:='集团客户成员数:'+IntToStr(QueryT_F_CustInfo.RecordCount);

         End;
      2:
         Begin
            ButtonVisible(True);

            If Not QueryJtyh.Active then
               Exit;

            If QueryJTYH.IsEmpty Then
               Exit;

            QueryCustInfoMember.Close;
            QueryCustInfoMember.SQL.Clear;
            QueryCustInfoMember.SQL.Add('Select * From T_F_CustInfoMember Where Jtyhdm='+QueryJtyh.FieldByName('JTYHDM').AsString);
            QueryCustInfoMember.Open;
            If QueryCustInfoMember.IsEmpty Then
               ShowRecord(QueryCustInfoMember,Panel8);
         End;
      3:
         Begin
            ButtonVisible(True);

            If Not QueryJtyh.Active then
               Exit;

            If QueryJTYH.IsEmpty Then
               Exit;

            QueryGroupMemoDay.Close;
            QueryGroupMemoDay.SQL.Clear;
            QueryGroupMemoDay.SQL.Add('Select * From T_F_GroupMemoDay Where JTYHDM='+QueryJtyh.FieldByName('JTYHDM').AsString);
            QueryGroupMemoDay.Open;
            If QueryGroupMemoDay.IsEmpty Then
               ShowRecord(QueryGroupMemoDay,Panel10);

         End;
      4:
         Begin
            ButtonVisible(False);
            If Not QueryJtyh.Active then
               Exit;

            If QueryJTYH.IsEmpty Then
               Exit;

            SQL:='select a.*,c.productname,d.par_desc statsm '+
                 'from t_f_custinfo a,(select Par_Values ProductNo,Par_Desc ProductName from t_d_config where Upper(Par_Name)=''BRANDNAME'') c,t_v_custstatus d'+
                 ' where a.fybz<>0 and a.user_zjbs=c.productno(+) and a.stat=d.stat(+) And '+
                 ' jtyhdm='+ Queryjtyh.fieldbyname('JTYHDM').asstring +' and a.sxdm=1 And'+
                 ' a.CityNo='''+Queryjtyh.fieldbyname('CityNo').asstring+''' And a.Off_no_Home='+Queryjtyh.fieldbyname('Off_No_Home').asstring;

            QueryT_F_CustInfo.Close;
            QueryT_F_CustInfo.SQL.Clear;
            QueryT_F_CustInfo.SQL.Add(SQL);
            QueryT_F_CustInfo.Open;
            Label28.Caption:='集团客户关键成员数:'+IntToStr(QueryT_F_CustInfo.RecordCount);
         End;
   End;


end;

procedure TForm_ArchivesGroupInfo.FlatButton2Click(Sender: TObject);
Var
   SQL:String;
begin

   If Not QueryT_F_CustInfo.Active Then
      Exit;

   If QueryT_F_CustInfo.IsEmpty Then
      Begin
         Application.MessageBox('请选择将要退出该集团的成员!','提示',MB_ICONINFORMATION);
         Exit;
      End;

   If Application.MessageBox(Pchar('您确定是否要将<< '+QueryT_F_CustInfo.FieldByName('SID').AsString+' >>客户退出<< '+QueryJtyh.FieldByName('JTYHMC').AsString+' >>集团成员吗?'), '提示', MB_YESNO+MB_ICONINFORMATION) =IDNO Then
      Exit;

   SQL:='Update t_f_custinfo set Fybz=0 where sid='''+QueryT_F_CustInfo.FieldByName('SID').AsString+'''';

   AnalyzeSQL(SQL);

   QueryT_F_CustInfo.Close;
   QueryT_F_CustInfo.Open;

end;

procedure TForm_ArchivesGroupInfo.FlatButton6Click(Sender: TObject);
Var
   SQL:String;
begin
   If Not QueryT_F_CustInfo.Active Then
      Exit;

   If QueryT_F_CustInfo.IsEmpty Then
      Begin
         Application.MessageBox('','提示',MB_ICONINFORMATION);
         Exit;
      End;

   If Application.MessageBox(Pchar(QueryT_F_CustInfo.FieldByName('SID').AsString+'确定退出'+QueryJtyh.FieldByName('JTYHMC').AsString+'集团成员?'), '提示', MB_YESNO) =IDNO Then
      Exit;

   SQL:='Update t_f_custinfo set Fybz=0 where sid='''+QueryT_F_CustInfo.FieldByName('SID').AsString+'''';

   AnalyzeSQL(SQL);

   QueryT_F_CustInfo.Close;
   QueryT_F_CustInfo.Open;
end;

procedure TForm_ArchivesGroupInfo.FlatButton7Click(Sender: TObject);
var
   SQL:String;
begin

   If Not QueryT_F_CustInfo.Active Then
      Exit;

   If QueryT_F_CustInfo.IsEmpty Then
      Begin
         Application.MessageBox('当前集团没有客户可转为集团关键人!','提示',MB_ICONINFORMATION);
         Exit;
      End;

   If Application.MessageBox('是否转为集团关键人', '提示', MB_YESNO+MB_ICONINFORMATION) =IDNO Then
      Exit;

   SQL:='Update t_f_custinfo set sxdm=1 where sid='''+QueryT_F_CustInfo.FieldByName('SID').AsString+'''';

   AnalyzeSQL(SQL);

   QueryT_F_CustInfo.Close;
   QueryT_F_CustInfo.Open;

end;

procedure TForm_ArchivesGroupInfo.FlatButton8Click(Sender: TObject);
var
   SQL:String;
begin

   If Not QueryT_F_CustInfo.Active Then
      Exit;

   If QueryT_F_CustInfo.IsEmpty Then
      Begin
         Application.MessageBox('当前集团中没有关键人物!','提示',MB_ICONINFORMATION);
         Exit;
      End;

   If Application.MessageBox('确定转为集团中的普通客户?', '提示', MB_YESNO) =IDNO Then
      Exit;

   SQL:='Update t_f_custinfo set sxdm=0 where sid='''+QueryT_F_CustInfo.FieldByName('SID').AsString+'''';

   AnalyzeSQL(SQL);

   QueryT_F_CustInfo.Close;
   QueryT_F_CustInfo.Open;

end;

procedure TForm_ArchivesGroupInfo.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  FormMain.StatusBarMain.Panels[1].Text := '';
  FormMain.Update;
  Action:=caFree;
end;

procedure TForm_ArchivesGroupInfo.FlatButton3Click(Sender: TObject);
Var
   InputString,str:String;
begin
  //怎么用queryjtyh.RecordCount,慢
  //if (queryjtyh.Eof) or (queryjtyh.RecordCount <= 0)  then
  if queryjtyh.Eof and queryjtyh.bof  then
    begin
      Application.MessageBox('请选择要新增集团用户的集团!', '系统提示', MB_OK);
      Exit;
    end;
  InputString:= InputBox('输入框', '集团用户的手机号码!', '');
  if InputString = '' then Exit;
  with query1 do
    begin
      close;
      sql.clear;
      sql.add('select * from t_f_custinfo where sid=:sid');
      ParamByName('sid').AsString := InputString;
      Open;
      if eof then
        begin
          StoredProc_InsJTYH.Close;
          StoredProc_InsJTYH.ParamByName('P_SID').AsString := InputString;
          StoredProc_InsJTYH.ParamByName('P_JTYHDM').AsString := queryjtyh.FieldByName('JTYHDM').AsString;
          StoredProc_InsJTYH.ParamByName('P_cityno').AsString := PS_CityNo;
          StoredProc_InsJTYH.ParamByName('P_GH').AsString := GH;
          StoredProc_InsJTYH.ExecProc;
//          StoredProc_InsJTYH.ParamByName('RESULT').AsString :=str;
          if StoredProc_InsJTYH.ParamByName('RESULT').AsString = '1' then
            Application.MessageBox('新增集团用户成功!', '系统提示', MB_OK)
          else

            begin
              Application.MessageBox('新增集团用户未成功!请重试', '系统提示', MB_OK);
              Exit;
            end;
          PageControl1Change(nil);
        end
      else
        Application.MessageBox('该用户已经存在', '系统提示', MB_OK);
   end;
end;
procedure TForm_ArchivesGroupInfo.FlatEdit_sidKeyPress(Sender: TObject;
  var Key: Char);
begin
   If Not (Key In ['0'..'9',#8,#13]) Then
      Key:=#0;
end;

procedure TForm_ArchivesGroupInfo.PageControl1Changing(Sender: TObject;
  var AllowChange: Boolean);
begin
   If iSign<>0 Then
      AllowChange:=False;
end;

procedure TForm_ArchivesGroupInfo.queryjtyhAfterScroll(DataSet: TDataSet);
begin
   PageControl1Change(Nil);
end;

procedure TForm_ArchivesGroupInfo.QueryCustInfoMemberAfterScroll(
  DataSet: TDataSet);
begin
   ShowRecord(QueryCustInfoMember,Panel8);
end;

procedure TForm_ArchivesGroupInfo.QueryGroupMemoDayAfterScroll(
  DataSet: TDataSet);
begin
   ShowRecord(QueryGroupMemoDay,Panel10);
end;

procedure TForm_ArchivesGroupInfo.FlatCheckBox1Click(Sender: TObject);
begin
   FlatEditbg.Enabled:= FlatCheckBox1.Checked;
   FlatEditen.Enabled:= FlatCheckBox1.Checked;
end;

procedure TForm_ArchivesGroupInfo.FlatEditbgExit(Sender: TObject);
begin
   If Trim(TFlatEdit(Sender).Text)='' Then
      Exit;

   Try
      StrToDate(TFlatEdit(Sender).Text);
   Except
      Application.MessageBox('填写的日期格式错误,格式:YYYY-MM-DD','提示',MB_ICONINFORMATION);
      TFlatEdit(Sender).SetFocus;
   End;

   If Sender=FlatEdit_GMEMO_SDATE Then
      If FlatEdit_GMEMO_EDATE.Text='' Then
         FlatEdit_GMEMO_EDATE.Text:=FlatEdit_GMEMO_SDATE.Text;

end;

procedure TForm_ArchivesGroupInfo.FED_NameKeyPress(Sender: TObject;
  var Key: Char);
begin
   If Key=#13 Then
      FlatButtonSearchClick(Nil);      
end;

procedure TForm_ArchivesGroupInfo.FlatCheckBox_SMS_FLAGClick(
  Sender: TObject);
begin
   FlatEdit_SEND_TIME.Enabled:=FlatCheckBox_Sms_Flag.Checked;
   If FlatCheckBox_Sms_Flag.Checked Then
      Begin
         If FlatEdit_GMEMO_SDATE.Text <>'' Then
            FlatEdit_SEND_TIME.Text:=FlatEdit_GMEMO_SDATE.Text;
      End
   Else
      FlatEdit_SEND_TIME.Text:='';

end;

end.

⌨️ 快捷键说明

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