📄 pawnmodify.~pa
字号:
end;
end;
procedure TfrmPawnModify.cmbPawnLimitKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
if key=VK_RETURN then
begin
if CertiEnterTimes=0 then
begin
CertiEnterTimes:=CertiEnterTimes+1;
if SendMessage((Sender as TComBoBox).handle,CB_GetDroppedState,0,0)
=0 then
PostMessage((Sender as TComBoBox).handle,CB_SHOWDROPDOWN,1,0);
end
else
begin
CertiEnterTimes:=0;
dbgDetail.SetFocus ;
end;
end;
end;
procedure TfrmPawnModify.cmbPawnLimitExit(Sender: TObject);
var
LimitIndex:integer;
Year,Month,Day:word;
PawnEndDate:TDateTime;
BeginDate:TDateTime; //典当起始日期
DayObject:TDayClass; //自定义的类 in GlobalVar
BeginMonth:integer;
BeginDay:integer;
begin
//先判断是否已经超出
if PawnLimitMark=True then
begin
PawnLimitMark:=False;
exit;
end;
if (txtPawnBeginYear.Text='') or
(txtPawnBeginMonth.Text='')or
(txtPawnBeginDay.Text='') then
begin
messagedlg(Msg.MsgDateInfo,mtWarning,[mbYes],0);
exit;
end;
//未超出
BeginDate:=EncodeDate(txtPawnBeginYear.Value,
txtPawnBeginMonth.Value,
txtPawnBeginDay.Value);
//取出此月的天数
DayObject:=TDayClass.Create;
BeginMonth:=txtPawnBeginMonth.Value;
BeginDay:=txtPawnBeginDay.Value;
LimitIndex:=cmbPawnLimit.ItemIndex;
if LimitIndex=0 then
begin
PawnEndDate:=BeginDate+DayObject.GetDays(BeginMonth,BeginDay) div 2;
TimeLimit:=0.5;
end
else
begin
TimeLimit:=LimitIndex;
PawnEndDate:=BeginDate+DayObject.GetDays(BeginMonth,BeginDay)*LimitIndex;
end;
//判断典当期限是否超出规定的值
if TimeLimit>GlobalVar.PawnLimit then
begin
PawnLimitMark:=True;
messagedlg(Msg.MsgPawnLimit ,mtWarning,[mbYes],0);
txtPawnEndYear.Text:='';
txtPawnEndMonth.Text:='';
txtPawnEndDay.Text:='';
exit;
end;
DecodeDate(PawnEndDate,Year,Month,Day);
txtPawnEndYear.Value:=Year;
txtPawnEndMonth.Value:=Month;
txtPawnEndDay.Value:=Day;
//计算总额
GetTotalMoney;
//计算利息及综合费用
txtMonthRateExit(Sender);
txtFeeRateExit(Sender);
end;
procedure TfrmPawnModify.txtPawnNameKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
tempLineNumber:integer;
begin
if key=VK_RETURN then
begin
if ModifyTableOpenMark=False then
begin
cmbPawnCategory.SetFocus;
exit;
end;
//若是添加一新记录,则存入临时表并退出。
if AddMark=True then
begin
dmPawnFrm.tblModifyDetailPawnName.Value:=txtPawnName.Text;
cmbPawnCategory.SetFocus;
exit;
end;
//下面是修改记录
if tempName<>txtPawnName.Text then
begin
if DataModifyMark=False then
begin
DataModifyMark:=True;
end;
//记录下他的行号
tempLineNumber:=dmPawnFrm.tblModifyDetailPawnLineNum.AsInteger;
if ArrayIndex>MaxIndex-1 then
begin
messagedlg(Msg.MsgArrayError,mtWarning,[mbYes],0);
cmbPawnCategory.SetFocus;
exit;
end;
if LineNumberArray[ArrayIndex]<>tempLineNumber then
begin
if LineNumberArray[ArrayIndex]<>0 then
//只有此值为0时表示这是第一条被修改的记录(所有的行号不为0)
begin
ArrayIndex:=ArrayIndex+1;
end;
LineNumberArray[ArrayIndex]:=tempLineNumber;
end;
end;
cmbPawnCategory.SetFocus;
end;
end;
procedure TfrmPawnModify.cmbPawnCategoryKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var
//tempText:string;
tempLineNumber:integer;
begin
if key=VK_RETURN then
begin
if ModifyTableOpenMark=False then
begin
txtPawnSpec.SetFocus;
exit;
end;
if CertiEnterTimes=0 then
begin
CertiEnterTimes:=CertiEnterTimes+1;
if SendMessage((Sender as TDBComBoBox).handle,CB_GetDroppedState,0,0)
=0 then
PostMessage((Sender as TDBComBoBox).handle,CB_SHOWDROPDOWN,1,0);
end
else
begin
CertiEnterTimes:=0;
//若是添加一新记录,则存入临时表并退出。
if AddMark=True then
begin
dmPawnFrm.tblModifyDetailPawnCategory.Value:=cmbPawnCategory.Text;
txtPawnSpec.SetFocus;
exit;
end;
//下面是修改记录
//----判断新选择的值是否被改变
if tempCategory<>cmbPawnCategory.Text then
begin
if DataModifyMark=False then
begin
DataModifyMark:=True;
end;
//记录下他的行号
tempLineNumber:=dmPawnFrm.tblModifyDetailPawnLineNum.AsInteger;
if ArrayIndex>MaxIndex-1 then
begin
messagedlg(Msg.MsgArrayError,mtWarning,[mbYes],0);
txtPawnSpec.SetFocus;
exit;
end;
if LineNumberArray[ArrayIndex]<>tempLineNumber then
begin
if LineNumberArray[ArrayIndex]<>0 then
//只有此值为0时表示这是第一条被修改的记录(所有的行号不为0)
begin
ArrayIndex:=ArrayIndex+1;
end;
LineNumberArray[ArrayIndex]:=tempLineNumber;
end;
end;
txtPawnSpec.SetFocus;
end;
{tempText:=cmbPawnCategory.Text;
with dmPawnFrm do
begin
with tblCategory do
begin
Open;
SetKey;
FieldByName('Code').asstring:=tempText;//dbgDetail.SelectedField.DisplayText;
if GotoKey then
begin
cmbPawnCategory.Text:=FieldByName('Name').asstring;
end
else
begin
messagedlg(Msg.MsgCategoryNoExist,mtWarning,[mbYes],0);
txtPawnSpec.SetFocus;
end;
Close;
end;
end;}
end;
end;
procedure TfrmPawnModify.txtPawnSpecKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
tempLineNumber:integer;
begin
if key=VK_RETURN then
begin
if ModifyTableOpenMark=False then
begin
txtPawnNumber.SetFocus;
exit;
end;
//若是添加一新记录,则存入临时表并退出。
if AddMark=True then
begin
dmPawnFrm.tblModifyDetailPawnSpec.Value:=txtPawnSpec.Text;
txtPawnNumber.SetFocus;
exit;
end;
//下面是修改记录
if tempSpec<>txtPawnSpec.Text then
begin
if DataModifyMark=False then
begin
DataModifyMark:=True;
end;
//记录下他的行号
tempLineNumber:=dmPawnFrm.tblModifyDetailPawnLineNum.AsInteger;
if ArrayIndex>MaxIndex-1 then
begin
messagedlg(Msg.MsgArrayError,mtWarning,[mbYes],0);
txtPawnNumber.SetFocus;
exit;
end;
if LineNumberArray[ArrayIndex]<>tempLineNumber then
begin
if LineNumberArray[ArrayIndex]<>0 then
//只有此值为0时表示这是第一条被修改的记录(所有的行号不为0)
begin
ArrayIndex:=ArrayIndex+1;
end;
LineNumberArray[ArrayIndex]:=tempLineNumber;
end;
end;
txtPawnNumber.SetFocus;
end;
end;
procedure TfrmPawnModify.txtPawnNumberKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var
Number:integer;
tempLineNumber:integer;
begin
if key=VK_RETURN then
begin
if ModifyTableOpenMark=False then
begin
txtAppriseValue.SetFocus;
exit;
end;
if txtPawnNumber.Text='' then
begin
Number:=0;
end
else
begin
Number:=strtoint(txtPawnNumber.Text);
end;
//若是添加一新记录,则存入临时表并退出。
if AddMark=True then
begin
dmPawnFrm.tblModifyDetailPawnNumber.Value:=Number;
txtAppriseValue.SetFocus;
exit;
end;
//下面是修改记录
if tempNumber<>Number then
begin
if DataModifyMark=False then
begin
DataModifyMark:=True;
end;
//记录下他的行号
tempLineNumber:=dmPawnFrm.tblModifyDetailPawnLineNum.AsInteger;
if ArrayIndex>MaxIndex-1 then
begin
messagedlg(Msg.MsgArrayError,mtWarning,[mbYes],0);
txtAppriseValue.SetFocus;
exit;
end;
if LineNumberArray[ArrayIndex]<>tempLineNumber then
begin
if LineNumberArray[ArrayIndex]<>0 then
//只有此值为0时表示这是第一条被修改的记录(所有的行号不为0)
begin
ArrayIndex:=ArrayIndex+1;
end;
LineNumberArray[ArrayIndex]:=tempLineNumber;
end;
end;
txtAppriseValue.SetFocus;
end;
end;
procedure TfrmPawnModify.txtAppriseValueKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var
Value:Double;
tempLineNumber:integer;
begin
if key=VK_RETURN then
begin
if ModifyTableOpenMark=False then
begin
exit;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -