Материал: Разработка автоматизированной системы оптимизации отслеживания отчетности предприятий

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам

}

//---------------------------------------------------------------------------

__fastcall TMainForm::N5Click(TObject *Sender)

{>Close();

}

//---------------------------------------------------------------------------

__fastcall TMainForm::N6Click(TObject *Sender)

{>Show();

}

//---------------------------------------------------------------------------

__fastcall TMainForm::N7Click(TObject *Sender)

{>DictionariesDataSource->DataSet=Data->Sub_Rep_Table ;>Label1->Caption="Виды сдачи отчетности";>Show();

}

//---------------------------------------------------------------------------

__fastcall TMainForm::Button1Click(TObject *Sender)

{>Show();

}

//---------------------------------------------------------------------------

__fastcall TMainForm::FormCreate(TObject *Sender)

{CurrentDate;=Now();short Year;short Month;short Day;quarter=0;i=0;>FundsTable->First();->Items->Clear();(!Data->FundsTable->Eof)

{->Items->Add(Data->FundsTable->FieldByName("NAMEFUND")->AsString);_mas[i]=Data->FundsTable->FieldByName("ID_DECL")->AsInteger;++;>FundsTable->Next();

}.DecodeDate(&Year, &Month, &Day);(( Month>=1)&&(Month<=3))=1;(( Month>=4)&&(Month<=6))=2;(( Month>=7)&&(Month<=9))=3;(( Month>=10)&&(Month<=12))=4;

>Label2->Caption="Квартал: " + IntToStr(quarter);>Label1->Caption="Год: " + IntToStr(Year);>DeadlinesTable->First();term="";->SQL->Clear();->SQL->Add("SELECT declaration.namedeclaration, deadlines.term from deadlines, declaration where (deadlines.iddeclaration=declaration.id_deadline) \(reportyear= " + IntToStr(Year) + ") \(quarter= " + IntToStr(quarter)+ ")") ;->Active=true;

}

//---------------------------------------------------------------------------

__fastcall TMainForm::DBGrid2DrawColumnCell(TObject *Sender,TRect &Rect, int DataCol, TColumn *Column,State)

{((Column->FieldName=="SENT")||(Column->FieldName=="DONE")||(Column->FieldName=="RECEIVED"))->Canvas->Font->Color= clWhite;

(Data->ProgressTable->FieldByName("DONE")->AsString == "1" && Column->FieldName=="DONE")

{->Canvas->Font->Color= clMoneyGreen;->Canvas->Brush->Color= clMoneyGreen;

}->DefaultDrawColumnCell(Rect, DataCol, Column, State);

(Data->ProgressTable->FieldByName("SENT")->AsString == "1" && Column->FieldName=="SENT")

{->Canvas->Font->Color= clGreen ;->Canvas->Brush->Color= clGreen;

}->DefaultDrawColumnCell(Rect, DataCol, Column, State);

(Data->ProgressTable->FieldByName("RECEIVED")->AsString == "1" && Column->FieldName=="RECEIVED")

{->Canvas->Font->Color= clLime ;->Canvas->Brush->Color= clLime;

}->DefaultDrawColumnCell(Rect, DataCol, Column, State);

}

//---------------------------------------------------------------------------

__fastcall TMainForm::RadioGroup1Click(TObject *Sender)

{

//if(RadioGroup1->ItemIndex==0)

{

>ProgressTable->Filter="";>ProgressTable->Filter="IDFUND = " + IntToStr(funds_mas[RadioGroup1->ItemIndex]);>ProgressTable->Filtered=true;

}

}

//---------------------------------------------------------------------------

__fastcall TMainForm::N9Click(TObject *Sender)

{>DictionariesDataSource->DataSet=Data->Responsible_Table ;>Label1->Caption="Исполнители";>Show();

}

//---------------------------------------------------------------------------

__fastcall TMainForm::N10Click(TObject *Sender)

{>DictionariesDataSource->DataSet=Data->Operation_Table ;>Label1->Caption="Операции";>Show();

}

//---------------------------------------------------------------------------

__fastcall TMainForm::N11Click(TObject *Sender)

{>Show();

}

//---------------------------------------------------------------------------

__fastcall TMainForm::DBGrid3DrawColumnCell(TObject *Sender,TRect &Rect, int DataCol, TColumn *Column,

State)

{CurrentDate;=Now();(IBQuery1->FieldByName("TERM")->AsDateTime <= (CurrentDate+10))

{->Canvas->Brush->Color= clRed;->DefaultDrawColumnCell(Rect, DataCol, Column, State);

}

}

//---------------------------------------------------------------------------

Файл Unit2.h

//---------------------------------------------------------------------------

#ifndef Unit2H

#define Unit2H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <DB.hpp>

#include <DBCtrls.hpp>

#include <DBGrids.hpp>

#include <ExtCtrls.hpp>

#include <Grids.hpp>

#include <IBCustomDataSet.hpp>

#include <IBTable.hpp>

//---------------------------------------------------------------------------TDictionaries : public TForm

{

__published:        // IDE-managed Components*IBTable1;*DataSource1;*IBTable1IDCLIENT;

*IBTable1NAMECLIENT;*IBTable1INN;*IBTable1ADDRESS;*IBTable1IDTAXATIONSYSTEM;*DBNavigator1;

*DictionariesDataSource;*Label1;*DictGrid;:    // User declarations

:                  // User declarations

__fastcall TDictionaries(TComponent* Owner);

};

//---------------------------------------------------------------------------PACKAGE TDictionaries *Dictionaries;

//---------------------------------------------------------------------------

#endif

Файл Unit2.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit2.h"

#include "Unit1.h"

#include "datamodule.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"*Dictionaries;

//---------------------------------------------------------------------------

__fastcall TDictionaries::TDictionaries(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

Файл Unit3.h

//---------------------------------------------------------------------------

#ifndef Unit3H

#define Unit3H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <DB.hpp>

#include <DBGrids.hpp>

#include <Grids.hpp>

#include <IBCustomDataSet.hpp>

#include <IBTable.hpp>

#include <IBQuery.hpp>

#include <DBCtrls.hpp>

#include <ExtCtrls.hpp>

#include "sLabel.hpp"

//---------------------------------------------------------------------------TInternalReportsForm : public TForm

{

__published:        // IDE-managed Components*InternalOperationGrid;*DBNavigator1;*DBCheckBox1;*ComboBox1;*ComboBox2;*ComboBox3;*sLabel1;*sLabel2;*sLabel3;*Button1;__fastcall InternalOperationGridDrawColumnCell(*Sender, const TRect &Rect, int DataCol, TColumn *Column,State);__fastcall ComboBox3Change(TObject *Sender);__fastcall FormCreate(TObject *Sender);__fastcall ComboBox1Change(TObject *Sender);__fastcall Button1Click(TObject *Sender);__fastcall ComboBox2Change(TObject *Sender);

:        // User declarations:                // User declarations

__fastcall TInternalReportsForm(TComponent* Owner);

};

//---------------------------------------------------------------------------PACKAGE TInternalReportsForm *InternalReportsForm;

//---------------------------------------------------------------------------

#endif

Файл Unit3.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit3.h"

#include "datamodule.h"

#include "Unit1.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma link "sLabel"

#pragma resource "*.dfm"*InternalReportsForm;

//---------------------------------------------------------------------------

__fastcall TInternalReportsForm::TInternalReportsForm(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

__fastcall TInternalReportsForm::InternalOperationGridDrawColumnCell(*Sender, const TRect &Rect, int DataCol, TColumn *Column,State)

{( Data->Int_Reports_Table->FieldByName("DONE")->AsString == "1" )

{>InternalOperationGrid->Canvas->Brush->Color = clMoneyGreen ;>InternalOperationGrid->DefaultDrawColumnCell(Rect, DataCol, Column, State);

}

}

//---------------------------------------------------------------------------__fastcall TInternalReportsForm::ComboBox3Change(TObject *Sender)

{tlo;<< loPartialKey,loCaseInsensitive;>Int_Reports_Table->Filtered=false;>IBQuery1->Locate ("NAMECLIENT", ComboBox3->Text, tlo );n3=Data->IBQuery1->Fields->FieldByName("IDCLIENT")->AsInteger;>Int_Reports_Table->Filter="CLIENT_NAME = " + IntToStr(n3) ;

>Int_Reports_Table->Filtered=true;

}

//---------------------------------------------------------------------------

__fastcall TInternalReportsForm::FormCreate(TObject *Sender)

{->Clear();

>ClientTable->First();(!Data->ClientTable->Eof)

{->Items->Add(Data->ClientTable->Fields->FieldByName("NAMECLIENT")->AsString);>ClientTable->Next();

}->Clear();>Responsible_Table->First();(!Data->Responsible_Table->Eof)

{->Items->Add(Data->Responsible_Table->Fields->FieldByName("Responsible_NAME")->AsString);>Responsible_Table->Next();

}->Clear();>Operation_Table->First();(!Data->Operation_Table->Eof)

{->Items->Add(Data->Operation_Table->Fields->FieldByName("OPERATION_NAME")->AsString);>Operation_Table->Next();

}

}

//---------------------------------------------------------------------------

__fastcall TInternalReportsForm::ComboBox1Change(TObject *Sender)

{tlo;<< loPartialKey,loCaseInsensitive;>Int_Reports_Table->Filtered=false;>IBQuery5->Locate ("OPERATION_NAME", ComboBox1->Text, tlo );n3=Data->IBQuery5->Fields->FieldByName("ID_OPERATION")->AsInteger;>Int_Reports_Table->Filter="OPERETION_DICT_ID = " + IntToStr(n3) ;>Int_Reports_Table->Filtered=true;

}

//---------------------------------------------------------------------------

__fastcall TInternalReportsForm::Button1Click(TObject *Sender)

{>Int_Reports_Table->Filtered=false;

}

//---------------------------------------------------------------------------

__fastcall TInternalReportsForm::ComboBox2Change(TObject *Sender)

{tlo;<< loPartialKey,loCaseInsensitive;>Int_Reports_Table->Filtered=false;>IBQuery6->Locate ("RESPONSIBLE_NAME", ComboBox2->Text, tlo );n3=Data->IBQuery6->Fields->FieldByName("RESPONSIBLE_ID")->AsInteger;>Int_Reports_Table->Filter="ID_RESPONSIBLE = " + IntToStr(n3) ;>Int_Reports_Table->Filtered=true;

}

//---------------------------------------------------------------------------

Файл Unit4.h

//---------------------------------------------------------------------------

#ifndef Unit4H

#define Unit4H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <DB.hpp>

#include <DBGrids.hpp>

#include <Grids.hpp>

#include <IBCustomDataSet.hpp>

#include <IBTable.hpp>

#include <DBCtrls.hpp>

#include <ExtCtrls.hpp>

//---------------------------------------------------------------------------TDeadlineDictionaryForm : public TForm

{

__published:        // IDE-managed Components*DictGrid;*DataSource1;*Label1;*DBGrid1;*DeclarationDataSource;*Declaration_table;*Declaration_tableIDDECLARATION;

*Declaration_tableNAMEDECLARATION;*Declaration_tableIDFUND;*Declaration_tableID_DEADLINE;*DeadlinesTable;*DeadlinesTableIDDECLARATION;*DeadlinesTableIDTERM;*DeadlinesTableTERM;*DeadlinesTableQUARTER;*DeadlinesTableREPORTYEAR;*DeadlinesDataSource;*DBNavigator1;*DBNavigator2;:  // User declarations:                   // User declarations

__fastcall TDeadlineDictionaryForm(TComponent* Owner);

};

//---------------------------------------------------------------------------PACKAGE TDeadlineDictionaryForm *DeadlineDictionaryForm;

//---------------------------------------------------------------------------

#endif

Файл Unit4.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit4.h"

#include "datamodule.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"*DeadlineDictionaryForm;

//---------------------------------------------------------------------------

__fastcall TDeadlineDictionaryForm::TDeadlineDictionaryForm(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

Файл Unit5.h

//---------------------------------------------------------------------------

#ifndef Unit5H

#define Unit5H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <DB.hpp>

#include <DBCtrls.hpp>

#include <DBGrids.hpp>

#include <ExtCtrls.hpp>

//---------------------------------------------------------------------------TFundsDeclForm : public TForm

{

__published:        // IDE-managed Components*Label1;

*DictGrid;*DBGrid1;*DBNavigator1;*DBNavigator2;:       // User declarations:               // User declarations

__fastcall TFundsDeclForm(TComponent* Owner);

};

//---------------------------------------------------------------------------PACKAGE TFundsDeclForm *FundsDeclForm;

//---------------------------------------------------------------------------

#endif

Файл Unit5.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit5.h"

#include "datamodule.h"

#include "Unit1.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"*FundsDeclForm;

//---------------------------------------------------------------------------

__fastcall TFundsDeclForm::TFundsDeclForm(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------