Сурет Есеп шығару алгоритмінің бейнеленуі. 8 Іі-бөлім «несиелерді рәсімдеу» абж қҰру 9



бет8/11
Дата01.04.2024
өлшемі0.92 Mb.
#497131
1   2   3   4   5   6   7   8   9   10   11
диплом

Интернет ресурстар:

  1. Г.А. Титоренко Информационные системы в экономике [Электронный учебник].- Москва. – 2008. – С. 463

  2. Сайт: http://depositfiles.com/files/oqsura4rj

  3. сайт: http://www.booksgid.com/business/323-.html

Қосымша


«НЕСИЕ ҚҰЖАТТАРЫН ДАЙЫНДАУ» АБЖ-дың


ПРОГРАММАЛЫҚ КОДЫ


uCreditsMain - негізгі жұмыс формасының прогаммалық коды
unit uCreditsMain;

var
frmCreditsMain: TfrmCreditsMain;

implementation


uses DateUtils, uDMCredits, uCAsel, uSpravEdit, uCr_stat, Math;


{$R *.dfm}


procedure TfrmCreditsMain.dtpWorkDayChange(Sender: TObject);


begin
edtYear.Text:=IntToStr(YearOf((Sender as TDateTimePicker).DateTime));
edtMonth.Text:=IntToStr(MonthOf((Sender as TDateTimePicker).DateTime));
end;

procedure TfrmCreditsMain.btnEditClientClick(Sender: TObject);


begin
frmCaProp:=TfrmCaProp.Create(self);
if frmCaProp.ShowModal=mrOK then
begin
with dmCreditsMain do
begin
tblContragents.Refresh;
tblAcredits.Edit;
tblAcredits.FieldByName('cr_ca').AsInteger:=tblContragents.FieldByName('ca_id').AsInteger;
tblAcredits.Post;
tblAcredits.Refresh;
end;
gridCredits.Refresh;
end;
end;

procedure TfrmCreditsMain.btnNewZavClick(Sender: TObject);


begin
with dmCreditsMain do
begin
tblAcredits.Append;
edtCr_num.SetFocus;
// tblAcredits.Post;
end;
end;

procedure TfrmCreditsMain.btnEditZvClick(Sender: TObject);


begin
with dmCreditsMain do
begin
tblAcredits.Edit;
tblAcredits.Post;
tblAcredits.Refresh;
gridCredits.Refresh;
end
end;

procedure TfrmCreditsMain.gridCreditsCellClick(Column: TColumn);


begin
edtMCName.Refresh;
if dmCreditsMain.tblAcredits.FieldByName('cr_pay').AsBoolean then
begin
btnPayList.Visible:=true;
miMonitor.Enabled:=true;
end
else
begin
miMonitor.Enabled:=false;
btnPayList.Visible:=false;
end;
end;

procedure TfrmCreditsMain.miSpravCrStatusClick(Sender: TObject);


begin
betShowSprav(dmCreditsMain.dsCr_status, 'crs_name');
end;

procedure TfrmCreditsMain.btnZvClick(Sender: TObject);


var
sName:string;
begin
sName:=dmCreditsMain.tblAcredits.FieldByName('caname').AsString;
if MessageDlg('Сіздер мәлімдемені нақты жоюды қаладыңыздар ма? '+sName+'?', mtConfirmation, [mbYes, mbNo], 0)=mrYes then
with dmCreditsMain do
begin
tblAcredits.Edit;
tblAcredits.Delete;
// tblAcredits.Post;
end;
end;

procedure TfrmCreditsMain.betShowSprav(tbl: TDataSource; sFieldName: string);


begin
frmSpravEdit:=TfrmSpravEdit.Create(self);
frmSpravEdit.gridSpravView.DataSource:=tbl;
frmSpravEdit.edtRName.DataSource:=tbl;
frmSpravEdit.edtRName.DataField:=sFieldName;
frmSpravEdit.lblRName.Caption:=frmSpravEdit.edtRName.DataSource.DataSet.FieldByName(sFieldName).DisplayLabel;
frmSpravEdit.ShowModal;
end;

procedure TfrmCreditsMain.miQuitClick(Sender: TObject);


begin
Close;
end;

procedure TfrmCreditsMain.FormCloseQuery(Sender: TObject;


var CanClose: Boolean);
begin
if MessageDlg('Сіз нақты шығуды қаладыңыз ба?', mtConfirmation, [mbYes, mbNo], 0)=mrYes then
CanClose:=true
else
CanClose:=false;
end;

procedure TfrmCreditsMain.miHelp_AboutClick(Sender: TObject);


begin
MessageDlg('Дипломдық жұмыс "Несиелерді қүрі және моторингтеу"', mtInformation, [mbOK], 0);
end;

procedure TfrmCreditsMain.miSpravCurClick(Sender: TObject);


begin
betShowSprav(dmCreditsMain.dsCurrensy, 'crcur_name');
end;

procedure TfrmCreditsMain.N1Click(Sender: TObject);


begin
betShowSprav(dmCreditsMain.dsCr_type, 'crt_name');
end;

procedure TfrmCreditsMain.N2Click(Sender: TObject);


begin
betShowSprav(dmCreditsMain.dsCr_vid, 'crv_name');
end;

procedure TfrmCreditsMain.N3Click(Sender: TObject);


begin
betShowSprav(dmCreditsMain.dsCr_dest, 'crd_name');
end;

procedure TfrmCreditsMain.btnZStatClick(Sender: TObject);


begin
frmCred_stat:=TfrmCred_stat.Create(self);
frmCred_stat.ShowModal;
if dmCreditsMain.tblAcredits.FieldByName('cr_pay').AsBoolean then
btnPayList.Visible:=true;
end;

procedure TfrmCreditsMain.N6Click(Sender: TObject);


begin
betShowSprav(dmCreditsMain.dsCd_type, 'cdt_name');
end;

procedure TfrmCreditsMain.FormCreate(Sender: TObject);


begin
dtpWorkDayChange(dtpOperDay);
nbMain.ActivePage:='Prop';
end;

procedure TfrmCreditsMain.btnDocsClick(Sender: TObject);


begin
nbMain.ActivePage:='Docs';
end;

procedure TfrmCreditsMain.btnDocAddClick(Sender: TObject);


begin
with dmCreditsMain do
begin
tblCa_docs.Append;
tblCa_docs.FieldByName('ca_id').AsInteger:=tblAcredits.FieldByName('cr_ca').AsInteger;
end;
end;

procedure TfrmCreditsMain.btnDocDelClick(Sender: TObject);


begin
with dmCreditsMain do
begin
tblCa_docs.Edit;
tblCa_docs.Delete;
// tblCa_docs.Post;
end;
end;

procedure TfrmCreditsMain.btnReturnClick(Sender: TObject);


begin
nbMain.ActivePage:='Prop';
end;

procedure TfrmCreditsMain.btnPayListClick(Sender: TObject);


var
i, iMonthCount, iDayCount:integer;
dProcent, dPen, dDayCount:Double;
dateP:TDateTime;
begin
if ((edtCr_bdate.Text<>'') and (lookupCa_pls.Text<>'') and (lookupCr_procent.Text<>'') and (lookupCr_penp.Text<>'')) then
begin
with dmCreditsMain do
begin
if tblCa_pls.Locate('cps_id', integer(lookupCa_pls.KeyValue), [loCaseInsensitive]) then
begin
iMonthCount:=tblCa_pls.FieldByName('cps_mkol').AsInteger;
dProcent:=tblCr_procent.FieldByName('crp_value').AsFloat/100;
if tblCa_paylist.RecordCount<> iMonthCount then
begin
dateP:=tblAcredits.FieldByName('cr_bdate').AsDateTime;
for i:=1 to iMonthCount do
begin
tblCa_paylist.Append;
tblCa_paylist.FieldByName('cpl_pdate').AsDateTime:=dateP;
tblCa_paylist.FieldByName('cpl_psum').AsFloat:=(StrToInt(edtCr_sum.Text)+(StrToInt(edtCr_sum.Text)*dProcent))/iMonthCount;
tblCa_paylist.FieldByName('ca_id').AsInteger:=tblAcredits.FieldByName('cr_ca').AsInteger;
dateP:=IncMonth(dateP);
tblCa_paylist.Post;
end;
end;
tblCa_paylist.First;
while not tblCa_paylist.Eof do
begin

if CompareDateTime(tblCa_paylist.FieldByName('cpl_pdate').AsDateTime, dtpOperDay.DateTime)=-1 then


if not tblCa_paylist.FieldByName('cpl_pclosed').AsBoolean then
begin
iDayCount:=DaysBetween(dtpOperDay.DateTime,tblCa_paylist.FieldByName('cpl_pdate').AsDateTime);
dDayCount:=iDayCount;
dPen:=tblCr_penp.FieldByName('cpp_value').AsFloat/100;
tblCa_paylist.Edit;
tblCa_paylist.FieldByName('cpl_added').AsFloat:=tblCa_paylist.FieldByName('cpl_psum').AsFloat*dPen*dDayCount;
tblCa_paylist.Post;
end;
gridPayLost.Refresh;
tblCa_paylist.Next;
end;
end;
end;
nbMain.ActivePage:='PayList';
end
else
MessageDlg('Несие сома толтыру дұрыстығын тексеріңіз,'+#13#10+'Өшіру мезгілі, Пайызды ұтыс тігулер және пайызының өсімі!', mtWarning, [mbOk], 0);

end;

procedure TfrmCreditsMain.btnPLBackClick(Sender: TObject);
begin
nbMain.ActivePage:='Prop';
end;

procedure TfrmCreditsMain.miZvShowDeletedClick(Sender: TObject);


begin
miZvShowDeleted.Checked:=not miZvShowDeleted.Checked;
if miZvShowDeleted.Checked then
begin
dmCreditsMain.tblAcredits.Filtered:=false;
gridCredits.Refresh;
end
else
begin
dmCreditsMain.tblAcredits.Filtered:=true;
gridCredits.Refresh;
end;
end;

procedure TfrmCreditsMain.btnHistoryBackClick(Sender: TObject);


begin
nbMain.ActivePage:='Prop';
end;

procedure TfrmCreditsMain.btnCaHistoryClick(Sender: TObject);


begin
nbMain.ActivePage:='History';
end;

procedure TfrmCreditsMain.btnPropClick(Sender: TObject);


begin
nbMain.ActivePage:='Imush';
end;

procedure TfrmCreditsMain.N4Click(Sender: TObject);


begin
betShowSprav(dmCreditsMain.dsCr_im_type, 'cit_name');
end;

procedure TfrmCreditsMain.btnImBackClick(Sender: TObject);


begin
nbMain.ActivePage:='Prop';
end;

procedure TfrmCreditsMain.btnImAddClick(Sender: TObject);


begin
with dmCreditsMain do
begin
tblCr_imush.Append;
tblCr_imush.FieldByName('ca_id').AsInteger:=tblAcredits.FieldByName('cr_ca').AsInteger;
edtCi_pnum.SetFocus;
end;
end;

procedure TfrmCreditsMain.btnImDelClick(Sender: TObject);


begin
with dmCreditsMain do
begin
tblCr_imush.Delete;
end;
end;

procedure TfrmCreditsMain.lookupCa_plsExit(Sender: TObject);


begin
if dmCreditsMain.tblAcredits.Modified then
dmCreditsMain.tblAcredits.Post;
end;

procedure TfrmCreditsMain.edtCr_sumExit(Sender: TObject);


begin
if dmCreditsMain.tblAcredits.Modified then
dmCreditsMain.tblAcredits.Post;

end;

procedure TfrmCreditsMain.lookupCurrensyClick(Sender: TObject);
begin
if dmCreditsMain.tblAcredits.Modified then
dmCreditsMain.tblAcredits.Post;

end;

procedure TfrmCreditsMain.lookupCr_procentExit(Sender: TObject);
begin
if dmCreditsMain.tblAcredits.Modified then
dmCreditsMain.tblAcredits.Post;

end;

procedure TfrmCreditsMain.edtCr_bdateExit(Sender: TObject);
begin
if dmCreditsMain.tblAcredits.Modified then
dmCreditsMain.tblAcredits.Post;

end;

procedure TfrmCreditsMain.lookupCr_penpExit(Sender: TObject);
begin
if dmCreditsMain.tblAcredits.Modified then
dmCreditsMain.tblAcredits.Post;
end;

procedure TfrmCreditsMain.miFilePrintClick(Sender: TObject);


begin
with dmCreditsMain do
begin
tblPrint.First;
tblPrint.Edit;
tblPrint.FieldByName('pr_value').AsString:=edtMCName.Text;
tblPrint.Next;
tblPrint.Edit;
tblPrint.FieldByName('pr_value').AsString:=lookupCr_dest.Text;
tblPrint.Next;
tblPrint.Edit;
tblPrint.FieldByName('pr_value').AsString:=edtCr_sum.Text;
tblPrint.Next;
tblPrint.Edit;
tblPrint.FieldByName('pr_value').AsString:=lookupCa_pls.Text;
tblPrint.Next;
tblPrint.Edit;
tblPrint.FieldByName('pr_value').AsString:=lookupCurrensy.Text;
tblPrint.Post;
end;
PrintDBGridEh1.Preview;
end;

procedure TfrmCreditsMain.btnZokClick(Sender: TObject);


begin
if dmCreditsMain.tblAcredits.Modified then
dmCreditsMain.tblAcredits.Post;
end;

procedure TfrmCreditsMain.btnSearchClick(Sender: TObject);


begin
dmCreditsMain.qrySearch.Active:=false;
nbMain.ActivePage:='Search';
end;

procedure TfrmCreditsMain.btnSrcBackClick(Sender: TObject);


begin
nbMain.ActivePage:='Prop';
end;

procedure TfrmCreditsMain.btnSrcFindClick(Sender: TObject);


var
sCondString:string;
begin
with dmCreditsMain do
begin
sCondString:='';
if chboxSrcNum.Checked then
sCondString:=sCondString+' (cr_num='+edtSrcNum.Text+')';
if chboxSrcClient.Checked then
if sCondString<>'' then
sCondString:=sCondString+' AND (cr_ca='+string(lookupSrcClient.KeyValue)+')'
else
sCondString:=sCondString+'(cr_ca='+string(lookupSrcClient.KeyValue)+')';

if chboxSrcSum.Checked then


if sCondString<>'' then
sCondString:=sCondString+' AND (cr_sum='+edtSrcSum.Text+')'
else
sCondString:=sCondString+' (cr_sum='+edtSrcSum.Text+')';
qrySearch.Active:=false;
qrySearch.SQL.Clear;
qrySearch.SQL.Add('SELECT * FROM acredits WHERE');
qrySearch.SQL.Add(sCondString);
try
qrySearch.Active:=true;
except
MessageDlg('Сауалда қате!'+#13#10+'Деректерді еңгізу дұрыстығын тексеріңіз!', mtError, [mbOK], 0);
end;
end;
end;

procedure TfrmCreditsMain.gridSearchCellClick(Column: TColumn);


begin
with dmCreditsMain do
begin
tblAcredits.Locate('cr_id', qrySearch.FieldByName('cr_id').AsInteger, []);
end;
end;

end.



Достарыңызбен бөлісу:
1   2   3   4   5   6   7   8   9   10   11




©dereksiz.org 2024
әкімшілігінің қараңыз

    Басты бет