📄 unit9.pas
字号:
unit Unit9;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, ExtCtrls, StdCtrls;
type
TForm9 = class(TForm)
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
StaticText1: TStaticText;
ComboBox1: TComboBox;
StaticText2: TStaticText;
Edit1: TEdit;
StaticText3: TStaticText;
Edit2: TEdit;
Button1: TButton;
StaticText6: TStaticText;
ComboBox2: TComboBox;
StaticText7: TStaticText;
Edit5: TEdit;
StaticText8: TStaticText;
Edit6: TEdit;
Panel1: TPanel;
StaticText9: TStaticText;
StaticText10: TStaticText;
Edit8: TEdit;
Button3: TButton;
ADOQuery1: TADOQuery;
StaticText11: TStaticText;
Edit9: TEdit;
ADOStoredProc1: TADOStoredProc;
Panel2: TPanel;
StaticText4: TStaticText;
Edit3: TEdit;
StaticText5: TStaticText;
Edit4: TEdit;
Button2: TButton;
Panel3: TPanel;
StaticText12: TStaticText;
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TForm9;
implementation
uses Unit3;
{$R *.dfm}
procedure TForm9.FormCreate(Sender: TObject);
begin
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from Bank where Card_type=:a');
ADOQuery1.Parameters[0].Value:='中国工商银行';
ADOQuery1.Active:=true;
ADOQuery1.Open;
if(ADOQuery1.RecordCount>0)then begin combobox1.Items.Add('中国工商银行');combobox2.Items.Add('中国工商银行');end;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from Bank where Card_type=:a');
ADOQuery1.Parameters[0].Value:='中国招商银行';
ADOQuery1.Open;
if(ADOQuery1.RecordCount>0)then begin combobox1.Items.Add('中国招商银行');combobox2.Items.Add('中国招商银行');end;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from Bank where Card_type=:a');
ADOQuery1.Parameters[0].Value:='中国农业银行';
ADOQuery1.Open;
if(ADOQuery1.RecordCount>0)then begin combobox1.Items.Add('中国农业银行');combobox2.Items.Add('中国农业银行');end;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from Bank where Card_type=:a');
ADOQuery1.Parameters[0].Value:='中信银行';
ADOQuery1.Open;
if(ADOQuery1.RecordCount>0)then begin combobox1.Items.Add('中信银行');combobox2.Items.Add('中信银行');end;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from Bank where Card_type=:a');
ADOQuery1.Parameters[0].Value:='中国光大银行';
ADOQuery1.Open;
if(ADOQuery1.RecordCount>0)then begin combobox1.Items.Add('中国光大银行');combobox2.Items.Add('中国光大银行');end;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from Bank where Card_type=:a');
ADOQuery1.Parameters[0].Value:='中国建设银行';
ADOQuery1.Open;
if(ADOQuery1.RecordCount>0)then begin combobox1.Items.Add('中国建设银行');combobox2.Items.Add('中国建设银行');end;
end;
procedure TForm9.Button3Click(Sender: TObject);
var
i:integer;
str:string;
day:integer;
lixi,rate,benjin:double;
begin
//----检查该贷款存不存在----
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from Customer_loan where customer_id=:a and loan_pack_no=:b and card_type=:c');
adoquery1.Parameters[0].Value:=Edit9.Text;
adoquery1.Parameters[1].Value:=Edit5.Text;
adoquery1.Parameters[2].Value:=combobox2.Text;
adoquery1.Open;
if(adoquery1.RecordCount<=0)then begin
showmessage('该贷款不存在');
exit;
end;
//-----判断是否大于贷款额
adoquery1.SQL.Clear;
str:='select datediff(day,borrow_date,getdate()) as ttot, rest_money as ss ,rate as rate from loan_pack where (Card_type='''+combobox2.Text+''' and loan_pack_no='''+edit5.Text+''')';
adoquery1.SQL.Add(str);
adoquery1.Open;
day:=adoquery1.fieldbyname('ttot').Value;
benjin:=adoquery1.fieldbyname('ss').Value;
rate:=adoquery1.fieldbyname('rate').Value;
lixi:=benjin+benjin*rate*day;
if(lixi<=strtofloat(edit6.Text))then begin
showmessage('你的贷款额连同利息一起为:'+floattostr(lixi)+'你的还款额大于所贷款额');
exit;
end;
adoquery1.SQL.Clear;
str:='select max(payback_no) as s from payoff_pro where customer_id='''+Edit9.Text+''' and loan_pack_no='''+Edit5.Text+'''';
adoquery1.SQL.Add('select max(payback_no) as s from payoff_pro where customer_id=:a and loan_pack_no=:b');
adoquery1.Parameters[0].Value:=Edit9.Text;
adoquery1.Parameters[1].Value:=Edit5.Text;
adoquery1.Open;
//i:=adoquery1.fieldbyname('s').value;
if(adoquery1.fieldbyname('s').value=NUll)then begin
i:=1;
end;
if(adoquery1.fieldbyname('s').value<>NUll)then begin
i:=adoquery1.fieldbyname('s').value;
end;
if(adoquery1.fieldbyname('s').value<>NULL) then begin
i:=i+1;
end;
ADOStoredProc1.ProcedureName:='huandai1';
ADOStoredProc1.Parameters.Refresh;
adostoredProc1.Parameters.ParamByName('@id').Value:=Edit9.Text;
adostoredProc1.Parameters.ParamByName('@loan_no').Value:=Edit5.Text;
adostoredProc1.Parameters.ParamByName('@type').Value:=ComboBox2.Text;
adostoredProc1.Parameters.ParamByName('@mon').Value:=strtofloat(Edit6.Text);
adostoredProc1.Parameters.ParamByName('@date').Value:=now();
adostoredProc1.Parameters.ParamByName('@cishu').Value:=i;
adostoredProc1.ExecProc;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select rest_money as ss from loan_pack where (loan_pack_no=:a and card_type=:b)');
adoquery1.Parameters[0].Value:=Edit5.Text;
adoquery1.Parameters[1].Value:=ComboBox2.Text;
adoquery1.Open;
Edit8.Text:=floattostr(adoquery1.fieldbyname('ss').Value);
Panel1.Visible:=true;
end;
procedure TForm9.Button1Click(Sender: TObject);
var
str:string;
begin
adoquery1.SQL.Clear;
str:='select * from fund_bill where(card_type='''+ComboBox1.Text+''' and card_no='''+Edit1.Text+''' and keyword='+Edit2.Text+')';
adoquery1.SQL.Add(str);
//adoquery1.Parameters[0].Value:=ComboBox1.Text;
//adoquery1.Parameters[1].Value:=Edit1.Text;
//adoquery1.Parameters[2].Value:=Edit2.Text;
adoquery1.active:=true;
if(adoquery1.RecordCount>0)then
begin
Panel2.Visible:=true;
end;
if(adoquery1.RecordCount<=0)then
begin
showmessage('请确保你输入的信息正确');
Exit;
end;
end;
procedure TForm9.Button2Click(Sender: TObject);
begin
if(Edit3.Text<>Edit4.Text)then begin
showmessage('输入的密码不一致');
Edit3.SetFocus;
Exit;
end;
ADOStoredProc1.ProcedureName:='xiugai';
ADOStoredProc1.Parameters.Refresh;
adostoredProc1.Parameters.ParamByName('@key').Value:=Edit3.Text;
adostoredProc1.Parameters.ParamByName('@type').Value:=combobox1.Text;
adostoredProc1.Parameters.ParamByName('@number').Value:=Edit1.Text;
adostoredProc1.ExecProc;
showmessage('修改成功!');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -