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

📄 unit4.~pas

📁 用dephi写的一个银行管理系统
💻 ~PAS
📖 第 1 页 / 共 2 页
字号:
                    else
                    s:=s+inttostr(i+1);
           end;
    //-----需不需要插入用户信息 -------
     Adoquery2.SQL.Clear;
     Adoquery2.SQL.Add('select * from Customer where Customer_id=:a');
     Adoquery2.Parameters[0].Value:=Edit3.Text;
     Adoquery2.Open;
     if(Adoquery2.RecordCount<=0)then
     begin
                 //可开户
                 //开户的同时可插入用户信息
      temp:='欢迎加入';
      temp:=temp+combobox2.Text;
      temp:=temp+'的行列!';
      showmessage(temp);
      StaticText9.Visible:=true;
      Edit4.Visible:=true;
      if(Edit4.Text='')then
      begin
        showmessage('用户名不能为空');
        Edit4.SetFocus;
        Exit;
      end;
      ADOStoredProc1.ProcedureName:='kaihu1';
      ADOStoredProc1.Parameters.Refresh;
      adostoredProc1.Parameters.ParamByName('@cus_id').Value:=Edit3.Text;
      adostoredProc1.Parameters.ParamByName('@Card_type').Value:=trim(combobox2.Text);
      adostoredProc1.Parameters.ParamByName('@name').Value:=Edit4.Text;
      adostoredProc1.Parameters.ParamByName('@trust_abi').Value:=10;
      adostoredProc1.Parameters.ParamByName('@pay_abi').Value:=0;
      adostoredProc1.Parameters.ParamByName('@card_no').Value:=s;
      adostoredProc1.Parameters.ParamByName('@key').Value:='888888';
      adostoredProc1.Parameters.ParamByName('@amount').Value:=0.0;
      adostoredProc1.Parameters.ParamByName('@date').Value:=Now();
      adostoredProc1.ExecProc;
       Application.MessageBox('开户成功!!!','提示',0+64);
        StaticText7.Caption:=s;
        StaticText10.Caption:='888888';
      Exit;
     end;
     //--------判断该用户是否拥有所选的银行卡----
    adoquery2.SQL.Clear;
    adoquery2.SQL.Add('select * from Customer_Fund where (Customer_id=:a and Card_type=:b)');
    adoquery2.Parameters[0].Value:=Edit3.Text;
    adoquery2.Parameters[1].Value:=trim(combobox2.Text);
    adoquery2.Open ;
    if(adoquery2.RecordCount<=0)then
    begin
     ADOStoredProc1.ProcedureName:='kaihu2';
     ADOStoredProc1.Parameters.Refresh;
     adostoredProc1.Parameters.ParamByName('@cus_id').Value:=Edit3.Text;
     adostoredProc1.Parameters.ParamByName('@Card_type').Value:=trim(combobox2.Text);
     adostoredProc1.Parameters.ParamByName('@card_no').Value:=s;
     adostoredProc1.Parameters.ParamByName('@key').Value:='888888';
     adostoredProc1.Parameters.ParamByName('@amount').Value:=0.0;
     adostoredProc1.Parameters.ParamByName('@date').Value:=formatdatetime('yyyymmdd',Now());
     adostoredProc1.ExecProc;
       Application.MessageBox('开户成功!!!','提示',0+64);
        StaticText7.Caption:=s;
        StaticText10.Caption:='888888';
      Exit;
   end;     //可以开一个所选的银行卡给用户
 //--------------------------------------------------
    showmessage('该用户已经存在');
end;

procedure TForm4.Image1Click(Sender: TObject);
begin
 form1.N5.Visible:=true;
 form1.N8.Visible:=false;
 form1.Show;
 self.Hide;


end;

procedure TForm4.Image2Click(Sender: TObject);
begin

 form1.N5.Visible:=true;
 form1.N8.Visible:=false;
 form1.Show;
 self.Hide;
end;

procedure TForm4.Image3Click(Sender: TObject);
begin

 form1.N5.Visible:=true;
 form1.N8.Visible:=false;
 form1.Show;
 self.Hide;
end;

procedure TForm4.Button3Click(Sender: TObject);
var
mon:double;
day:integer;
id:string;
begin
  if(trim(Edit5.Text)='')then begin showmessage('卡号不能为空');Exit;end;
  if(trim(Edit6.Text)='')then begin showmessage('密码不能为空');Exit;end;

  adoquery1.SQL.Clear;
  adoquery1.SQL.Add('select fortune_amount as ss from Fund_bill where (Card_type=:a and Card_no=:b and Keyword=:c)');
  adoquery1.Parameters[0].Value:=comboBox3.Text;
  adoquery1.Parameters[1].Value:=Edit5.Text;
  adoquery1.Parameters[2].Value:=Edit6.Text;
  adoquery1.Open;
  if(adoquery1.RecordCount<=0)then begin showmessage('请确保你输入的卡号,密码正确');Edit6.SetFocus;Exit;end;
  mon:=Adoquery1.FieldByName('ss').Value;

  //----有透支不能消户----
   adoquery1.SQL.Clear;
   adoquery1.SQL.Add('select amount as tto from overdraft where (card_type=:a and card_no=:b)');
   adoquery1.Parameters[0].Value:=trim(combobox3.Text);
   adoquery1.Parameters[1].Value:=Edit5.Text;
   adoquery1.Open;
   if(adoquery1.RecordCount>0)then begin
     showmessage('此卡处于透支状态不能消户');
     Exit;
   end;
  //----end---

  adoquery1.SQL.Clear;
  adoquery1.SQL.Add('select datediff(day,Deposit_date,getdate()) as ttot from fund_bill where (card_type=:a and card_no=:b)');
  adoquery1.Parameters[0].Value:=comboBox3.Text;
  adoquery1.Parameters[1].Value:=Edit5.Text;
  adoquery1.Open;
  day:=Adoquery1.FieldByName('ttot').Value;
  mon:=mon+mon*0.005*day;
  Edit7.Text:=floattostr(mon);

  if(comboBox3.Text='中国工商银行')then begin staticText16.Caption:='欢迎使用中国工商银行服务';end;
  if(comboBox3.Text='中国招商银行')then begin staticText16.Caption:='欢迎使用中国招商银行服务';end;
  if(comboBox3.Text='中国农业银行')then begin staticText16.Caption:='欢迎使用中国农业银行服务';end;
  if(comboBox3.Text='中信银行')then begin staticText16.Caption:='欢迎使用中信银行服务';end;
  if(comboBox3.Text='中国光大银行')then begin staticText16.Caption:='欢迎使用中国光大银行服务';end;
  if(comboBox3.Text='中国建设银行')then begin staticText16.Caption:='欢迎使用中国建设银行服务';end;

   adoquery1.SQL.Clear;
   adoquery1.SQL.Add('select customer_id as ss from customer_fund where (card_type=:a and card_no=:b)');
   adoquery1.Parameters[0].Value:=combobox3.Text;
   adoquery1.Parameters[1].Value:=Edit5.Text;
   adoquery1.Open;
   id:=adoquery1.fieldbyname('ss').Value;
   ADOStoredProc1.ProcedureName:='xiaohu';
   ADOStoredProc1.Parameters.Refresh;
   adostoredProc1.Parameters.ParamByName('@type').Value:=comboBox3.Text;
   adostoredProc1.Parameters.ParamByName('@no').Value:=edit5.Text;
   adostoredProc1.Parameters.ParamByName('@id').Value:=id;
   adostoredProc1.Parameters.ParamByName('@sub1').Value:=mon;
   ADOStoredProc1.ExecProc;
   Application.messagebox('消户成功','提示',0+64);
   panel1.Visible:=true;


end;

procedure TForm4.RadioButton1Click(Sender: TObject);
begin
 showmessage('请输入你所查询的银行名称');
end;

procedure TForm4.Button4Click(Sender: TObject);
begin
 adoquery1.SQL.Clear;
 adoquery2.SQL.Clear;
 if(checkbox1.Checked=true)then begin
   if(combobox4.Text='')then begin
    showmessage('选择银行名称');
    exit;
   end;
 end;
 if(checkbox2.Checked=true)then begin
   if(edit8.Text='')then begin
    showmessage('输入卡号');
    exit;
   end;
 end;
 if checkbox1.Checked=true and checkbox2.Checked=true then begin
    adoquery1.SQL.Clear;
    adoquery1.SQL.Add('select card_type,card_no,fortune_amount as amount from fund_bill where card_type=:a and card_no=:b');
    adoquery1.Parameters[0].Value:=combobox4.Text;
    adoquery1.Parameters[1].Value:=edit8.Text;
    adoquery1.Open;
    Exit;
 end;
 if checkbox1.Checked=true then begin
   adoquery1.SQL.Clear;
   adoquery1.SQL.Add('select card_type,card_no,fortune_amount as amount from fund_bill where card_  no=:a');
   adoquery1.Parameters[0].Value:=combobox4.Text;
   adoquery1.Open;
   Exit;
 end;
 if checkbox2.Checked=true then begin
   adoquery1.SQL.Clear;
   adoquery1.SQL.Add('select card_type,card_no,fortune_amount as amount from fund_bill where card_no=:a');
   adoquery1.Parameters[0].Value:=edit8.Text;
   adoquery1.Open;
   Exit;
 end;


 

end;

procedure TForm4.Button5Click(Sender: TObject);
var
 str:string;
begin
  if(edit9.Text='')then begin
    showmessage('输入姓名中所包含的字符');
    edit9.SetFocus;
    exit;
  end;
  str:='select distinct a.customer_id,customer_name,b.card_type,b.card_no,c.fortune_amount from customer as a,customer_fund as b,fund_bill  as c where customer_name like'+''''+'%'+edit9.text+'%'+''''+' and a.customer_id=b.customer_id and b.card_type=c.card_type and b.card_no=c.card_no';
  adoquery1.SQL.Clear;
  adoquery1.SQL.Add(str);
  adoquery1.Open;
end;

procedure TForm4.CheckBox1Click(Sender: TObject);
begin
 showmessage('选择银行名称');
 combobox4.SetFocus;
 Exit;
end;

procedure TForm4.CheckBox2Click(Sender: TObject);
begin
 showmessage('输入银行卡号');
 Edit8.SetFocus;
 Exit;

end;

procedure TForm4.Image4Click(Sender: TObject);
begin
  form1.N5.Visible:=true;
  form1.N8.Visible:=false;
  form1.Show;
  self.Hide;
end;

procedure TForm4.Image5Click(Sender: TObject);
begin
 form1.N5.Visible:=true;
 form1.N8.Visible:=false;
 form1.Show;
 self.Hide;
end;

end.

⌨️ 快捷键说明

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