//显示统计结果 stringgridCells[]:=是否平衡; stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); if (val<>val)or(val<>val)or(val<>val) then begin stringgridCells[]:=不平衡; stringgridFontColor:=clred; end else stringgridCells[]:=平衡; end; // //以下是帐户设置窗体的代码 implementation {$R *dfm} uses sumaccountform; procedure TAccountSettingFormClose(Sender: TObject; var Action: TCloseAction); begin action:=cafree; end; //设置表格 procedure TAccountSettingDataSourceDataChange(Sender: TObject; Field: TField); begin //设置帐簿初始化表列宽 dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; end; procedure TAccountSettingDataSourceDataChange(Sender: TObjectField: TField); begin //设置系统参数表列宽 dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; end; //初始化帐户 procedure TAccountSettingBitBtnClick(Sender: TObject); begin //执行储存过程初始化帐户 adocommandCommandText:=EXEC sf_初始化帐户; if applicationMessageBox(是否清除原帐簿信息并初始化新帐簿?确认 MB_OKCANCEL)=IDOK then adocommandExecute; //刷新数据表 adotableActive:=false; adotableActive:=true; adotableActive:=false; adotableActive:=true; end; //启用新帐户 procedure TAccountSettingBitBtnClick(Sender: TObject); begin //判断是否试算平衡 adoqueryClose; adoquerySQLClear; adoquerySQLAdd(select sum(累计借方) 借方sum(累计贷方) 贷方 from 帐簿初始化表); adoqueryOpen; if adoqueryFieldByName(借方)AsString<>adoqueryFieldByName(贷方)AsString then begin showmessage(新帐簿初始化不平衡请检查试算平衡表后重新输入); exit; end; [] [] [] [] [] |