,
 

: .

4:

Pay_Supplier

.

,

2.2

Journal_Plist

FIO_driver: String

FIO_cond: String

marsh: Byte

data: Byte

Plist: Byte

Plist (marsh, data, Plist, FIO_driver, FIO_cond)

Journal_Ychet

data: Byte

colvo_t 1: Byte

colvo_t 2: Byte

marsh: Byte

sum: Byte

Beginwork_day (data, colvo_t 1, marsh)

Endwork_day (data, colvo_t 1, colvo_t 2, sum, marsh)

Journal_ZP

pribul: Byte

sumZP: Byte

zp: Byte

zp_account: Byte

zp_driv: Byte

zp_disp: Byte

zp_cond: Byte

Podschet_ZP (pribul, sumZP)

Pay_ZP (zp, zp_account, zp_driv, zp_disp, zp_cond)

Journal_transport register

data: Byte

marsh: Byte

timeA: Byte

timeB: Byte

Begin_marsh (data, marsh, timeA)

End_marsh (data, marsh, timeB)

Journal_sh

marsh: Byte

sum_sh: Byte

data: Byte

FIO: String

Shtraff (sum_sh, data, FIO, marsh)

Journal_Tax

pribul: Byte

sumTax: Byte

data: Byte

Podschet_Tax (pribul, sumTax)

Pay_ZP (sumTax, data)

Journal_break

marsh: Byte

data: Byte

Polomka (data, marsh)

Journal_Elect

data: Byte

sum_el: Byte

El_oplata (data, sum_el)

System

FIO_driver: String

FIO_cond: String

marsh: Byte

data: Byte

Plist: Byte

colvo_t 1: Byte

colvo_t 2: Byte

sum: Byte

pribul: Byte

sumZP: Byte

zp: Byte

zp_account: Byte

zp_driv: Byte

zp_disp: Byte

zp_cond: Byte

data: Byte

timeA: Byte

timeB: Byte

sum_sh: Byte

FIO: String

pribul: Byte

sumTax: Byte

sum_el: Byte

time_now: Byte

marsh_old: Byte

marsh_new: Byte

sum_pay: Byte

all_prible: Byte

Plist (marsh, data, Plist, FIO_driver, FIO_cond), Beginwork_day (data, colvo_t 1, marsh), Endwork_day (data, colvo_t 1, colvo_t 2, sum, marsh),

Podschet_ZP (pribul, sumZP), Pay_ZP (zp, zp_account, zp_driv, zp_disp, zp_cond),

Begin_marsh (data, marsh, timeA), End_marsh (data, marsh, timeB), Shtraff (sum_sh, data, FIO, marsh), Podschet_Tax (pribul, sumTax), Pay_ZP (sumTax, data), Polomka (data, marsh), El_oplata (data, sum_el), Otsyts_tr (FIO_driver, FIO_cond, data, time_now, marsh), Zamena (marsh_old, marsh_new), Pay_break (sum_pay, data), Salary (all_prible, data)

3.

, . .

, , - File -> Action.

, , .

(Path List). . .

, 1- .

(Uchet). . .

.

. , .

.

.

.

(Polomka), , .

.

, Browse, .

, .

- About -> Show.

. ( ) , . , , , , . . .
1. . Visual C++ 6. , BHV, , 2000 .-1048 .
2.  .., ..  ++ ( ). , , 2003 .-1150 .
3. . UML . .  . 2002.-624 .
4. . - . , , 2000. -560 .
5.  ..  . .: , 2002. -464 .
Add class
#include add1.h
#include path.h
#include uch.h
#include bre.h
#include elec.h
void add: OnChoose()
{
UpdateData(TRUE);
if (m_radio==0) {
path dlg;
dlg. DoModal();
}
if (m_radio==1) {
uch dlg;
dlg. DoModal();
}
if (m_radio==2) {
add1 dlg;
dlg. DoModal();
}
if (m_radio==3) {
elec dlg;
dlg. DoModal();
}
if (m_radio==4) {
bre dlg;
dlg. DoModal();
}
}
Add1 class
 // add1.cpp: implementation file
 //
#include stdafx.h
#include MasKurs.h
#include add1.h
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
 /////////////////////////////////////////////////////////////////////////////
 // add1 dialog
add1:add1 (CWnd* pParent /*=NULL*/)
: CDialog (add1:IDD, pParent)
{
 // {{AFX_DATA_INIT(add1)
m_date = _T();
m_numberofout = _T();
m_numberofleft = _T();
m_number = _T();
m_profit = 0;
m_zarplata = 0;
m_zarpl = _T();
m_nalog1 = _T();
m_profit1 = 0;
m_nalog = 0;
m_shtraf = _T();
 // }} AFX_DATA_INIT
}
void add1: DoDataExchange (CDataExchange* pDX)
{
CDialog: DoDataExchange(pDX);
 // {{AFX_DATA_MAP(add1)
DDX_Control (pDX, IDC_COMBO1, m_combo1);
DDX_Text (pDX, IDC_EDIT1, m_date);
DDX_Text (pDX, IDC_EDIT2, m_numberofout);
DDX_Text (pDX, IDC_EDIT3, m_numberofleft);
DDX_Text (pDX, IDC_EDIT11, m_number);
DDX_Text (pDX, IDC_EDIT4, m_profit);
DDX_Text (pDX, IDC_EDIT5, m_zarplata);
DDX_Text (pDX, IDC_EDIT8, m_zarpl);
DDX_Text (pDX, IDC_EDIT9, m_nalog1);
DDX_Text (pDX, IDC_EDIT6, m_profit1);
DDX_Text (pDX, IDC_EDIT7, m_nalog);
DDX_Text (pDX, IDC_EDIT10, m_shtraf);
 // }} AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP (add1, CDialog)
 // {{AFX_MSG_MAP(add1)
ON_WM_SHOWWINDOW()
ON_BN_CLICKED (IDC_BUTTON5, OnSaveToUchetZarplataNalogi)
ON_BN_CLICKED (IDC_BUTTON1, OnCount1)
ON_BN_CLICKED (IDC_BUTTON2, OnSaveToZarp)
ON_BN_CLICKED (IDC_BUTTON3, OnCount2)
ON_BN_CLICKED (IDC_BUTTON4, OnSaveToNalog)
ON_BN_CLICKED (IDC_BUTTON6, OnSaveToshtraf)
 // }} AFX_MSG_MAP
END_MESSAGE_MAP()
 /////////////////////////////////////////////////////////////////////////////
 // add1 message handlers
CString str0;
void add1: OnShowWindow (BOOL bShow, UINT nStatus)
{
CDialog: OnShowWindow (bShow, nStatus);
UpdateData(TRUE);
 // CStdioFile fOpen (d:\\MasKurs\\driver.txt, CFile:modeRead);
CStdioFile fOpen1 (d:\\MasKurs\\konductor.txt, CFile:modeRead);
CString str;
 // CString str1;
 // while (fOpen. ReadString(str)!=0) {
 // m_combo. AddString(str);
 // }
while (fOpen1. ReadString(str0)!=0) {
m_combo1. AddString(str0);
}
}
void add1: OnSaveToUchetZarplataNalogi()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\uchetzarplatnalogi.txt, CFile:modeWrite);
CString str;
 // int index=m_combo. GetCurSel();
int index1=m_combo1. GetCurSel();
 // m_combo. GetLBText (index, str1);
m_combo1. GetLBText (index1, str0);
if (m_date== || m_number== || m_numberofout== || m_numberofleft== || str0==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
 // fOpen. WriteString (FIO driver +str1+\n);
fOpen. WriteString (FIO konductor +str0+\n);
fOpen. WriteString (Date +m_date+\n);
fOpen. WriteString (Number of vudanih +m_numberofout+\n);
fOpen. WriteString (Number of ostavshihsa +m_numberofleft+\n);
fOpen. WriteString (Number +m_number+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to uchetzarplatnalogi.txt, MB_OK);
}
void add1: OnCount1 ()
{
UpdateData(TRUE);
int result=m_profit*m_zarplata/100;
CString str;
str. Format (%d, result);
GetDlgItem (IDC_EDIT8)->SetWindowText(str);
 // UpdateData(FALSE);
}
void add1: OnSaveToZarp()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\zarplata.txt, CFile:modeWrite);
CString str;
 // int index=m_combo. GetCurSel();
int index1=m_combo1. GetCurSel();
 // m_combo. GetLBText (index, str1);
m_combo1. GetLBText (index1, str0);
if (m_profit==0 || m_zarplata==0 || str0==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
 // fOpen. WriteString (FIO driver +str1+\n);
fOpen. WriteString (FIO konductor +str0+\n);
fOpen. WriteString (Zarplata +m_zarpl+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to zarplata.txt, MB_OK);
}
void add1: OnCount2 ()
{
UpdateData(TRUE);
int result=m_profit1*m_nalog/100;
CString str;
str. Format (%d, result);
 // GetDlgItem (IDC_EDIT9)->SetWindowText(str);
m_nalog1=str;
UpdateData(FALSE);
}
void add1: OnSaveToNalog()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\nalog.txt, CFile:modeWrite);
CString str;
 // int index=m_combo. GetCurSel();
 // int index1=m_combo1. GetCurSel();
 // m_combo. GetLBText (index, str1);
 // m_combo1. GetLBText (index1, str0);
if (m_profit1==0 || m_nalog==0) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
str. Format (%d, m_profit1);
 // fOpen. WriteString (FIO driver +str1+\n);
fOpen. WriteString (Profit +str+\n);
fOpen. WriteString (Nalog +m_nalog1+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to nalog.txt, MB_OK);
}
void add1: OnSaveToshtraf()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\shtraf.txt, CFile:modeWrite);
CString str;
 // int index=m_combo. GetCurSel();
int index1=m_combo1. GetCurSel();
 // m_combo. GetLBText (index, str1);
m_combo1. GetLBText (index1, str0);
if (m_shtraf== || str0==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
 // fOpen. WriteString (FIO driver +str1+\n);
fOpen. WriteString (FIO konductor +str0+\n);
fOpen. WriteString (Shtraf +m_shtraf+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to shtraf.txt, MB_OK);
}
Bre class
void bre: OnSaveToBreak()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\bre.txt, CFile:modeWrite);
CString str;
if (m_date== || m_number==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
fOpen. WriteString (Date +m_date+\n);
fOpen. WriteString (Number +m_number+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to bre.txt, MB_OK);
}
void bre: OnSaveToZamena()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\zamena.txt, CFile:modeWrite);
CString str;
if (m_date1== || m_number1== || m_number2==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
fOpen. WriteString (Number marsh old +m_number1+\n);
fOpen. WriteString (Number marsh new +m_number2+\n);
fOpen. WriteString (Date +m_date1+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to zamena.txt, MB_OK);
}
void bre: OnSaveToPay()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\pay.txt, CFile:modeWrite);
CString str;
if (m_date2== || m_sum==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
fOpen. WriteString (Sum +m_sum+\n);
fOpen. WriteString (Date +m_date2+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to pay.txt, MB_OK);
}
Elec class
void elec: OnSaveToElectro()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\elec.txt, CFile:modeWrite);
CString str;
 // m_combo. GetLBText (index, str1);
 // m_combo1. GetLBText (index1, str0);
if (m_ammount== || m_sum==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
 // fOpen. WriteString (FIO driver +str1+\n);
fOpen. WriteString (Ammount +m_ammount+\n);
fOpen. WriteString (Number +m_sum+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to elec.txt, MB_OK);
}
MasKursDlg class
 // MasKursDlg.cpp: implementation file
 //
#include stdafx.h
#include MasKurs.h
#include MasKursDlg.h
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
 /////////////////////////////////////////////////////////////////////////////
 // CAboutDlg dialog used for App About
class CAboutDlg: public CDialog
{
public:
CAboutDlg();
 // Dialog Data
 // {{AFX_DATA(CAboutDlg)
enum {IDD = IDD_ABOUTBOX};
 // }} AFX_DATA
 // ClassWizard generated virtual function overrides
 // {{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange (CDataExchange* pDX); // DDX/DDV support
 // }} AFX_VIRTUAL
 // Implementation
protected:
 // {{AFX_MSG(CAboutDlg)
 // }} AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg:CAboutDlg(): CDialog (CAboutDlg:IDD)
{
 // {{AFX_DATA_INIT(CAboutDlg)
 // }} AFX_DATA_INIT
}
void CAboutDlg: DoDataExchange (CDataExchange* pDX)
{
CDialog: DoDataExchange(pDX);
 // {{AFX_DATA_MAP(CAboutDlg)
 // }} AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP (CAboutDlg, CDialog)
 // {{AFX_MSG_MAP(CAboutDlg)
 // No message handlers
 // }} AFX_MSG_MAP
END_MESSAGE_MAP()
 /////////////////////////////////////////////////////////////////////////////
 // CMasKursDlg dialog
CMasKursDlg:CMasKursDlg (CWnd* pParent /*=NULL*/)
: CDialog (CMasKursDlg:IDD, pParent)
{
 // {{AFX_DATA_INIT(CMasKursDlg)
 // NOTE: the ClassWizard will add member initialization here
 // }} AFX_DATA_INIT
 // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon (IDR_MAINFRAME);
}
void CMasKursDlg: DoDataExchange (CDataExchange* pDX)
{
CDialog: DoDataExchange(pDX);
 // {{AFX_DATA_MAP(CMasKursDlg)
DDX_Control (pDX, IDC_LIST1, m_list);
 // }} AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP (CMasKursDlg, CDialog)
 // {{AFX_MSG_MAP(CMasKursDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_COMMAND (ID_FILE_ACTION, OnFileAction)
ON_BN_CLICKED (IDC_BUTTON3, OnBrowse)
ON_BN_CLICKED (IDC_BUTTON1, OnButton1)
ON_BN_CLICKED (IDC_BUTTON2, OnButton2)
ON_COMMAND (ID_FILE_EXIT, OnFileExit)
ON_COMMAND (ID_ABOUT_SHOW, OnAboutShow)
 // }} AFX_MSG_MAP
END_MESSAGE_MAP()
 /////////////////////////////////////////////////////////////////////////////
 // CMasKursDlg message handlers
#include login.h
BOOL CMasKursDlg: OnInitDialog()
{
CDialog: OnInitDialog();
 // Add About menu item to system menu.
 // IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT (IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu!= NULL)
{
CString strAboutMenu;
strAboutMenu. LoadString (IDS_ABOUTBOX);
if (! strAboutMenu. IsEmpty())
{
pSysMenu->AppendMenu (MF_SEPARATOR);
pSysMenu->AppendMenu (MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
login dlg;
dlg.m_login= buhgalter;
if (dlg. DoModal()==IDOK) {
if (dlg.m_pass== 111 && dlg.m_login== buhgalter) {
return TRUE;
}
else {
MessageBox (Incorrect!!!);
EndDialog(0);
}
}
 // Set the icon for this dialog. The framework does this automatically
 // when the application's main window is not a dialog
SetIcon (m_hIcon, TRUE); // Set big icon
SetIcon (m_hIcon, FALSE); // Set small icon
 // TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CMasKursDlg: OnSysCommand (UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout. DoModal();
}
else
{
CDialog: OnSysCommand (nID, lParam);
}
}
 // If you add a minimize button to your dialog, you will need the code below
 // to draw the icon. For MFC applications using the document/view model,
 // this is automatically done for you by the framework.
void CMasKursDlg: OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage (WM_ICONERASEBKGND, (WPARAM) dc. GetSafeHdc(), 0);
 // Center icon in client rectangle
int cxIcon = GetSystemMetrics (SM_CXICON);
int cyIcon = GetSystemMetrics (SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect. Width() - cxIcon + 1) / 2;
int y = (rect. Height() - cyIcon + 1) / 2;
 // Draw the icon
dc. DrawIcon (x, y, m_hIcon);
}
else
{
CDialog: OnPaint();
}
}
 // The system calls this to obtain the cursor to display while the user drags
 // the minimized window.
HCURSOR CMasKursDlg: OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
#include add.h
void CMasKursDlg: OnFileAction()
{
add dlg;
dlg. DoModal();
}
void CMasKursDlg: OnBrowse()
{
CString str;
CString str1;
CFileDialog OpenFileDialog (true, txt, NULL, OFN_FILEMUSTEXIST|OFN_HIDEREADONLY, Text files (*.txt)|*.txt||);
if (OpenFileDialog. DoModal()==IDOK) {
str=OpenFileDialog. GetPathName();
GetDlgItem (IDC_EDIT1)->SetWindowText(str);
CStdioFile fOpen (str, CFile:modeRead);
while (fOpen. ReadString(str)!=0) {
m_list. AddString(str);
}
}
}
void CMasKursDlg: OnButton1 ()
{
add dlg;
dlg. DoModal();
}
void CMasKursDlg: OnButton2 ()
{
EndDialog(0);
}
void CMasKursDlg: OnFileExit()
{
EndDialog(0);
}
void CMasKursDlg: OnAboutShow()
{
CAboutDlg dlg;
dlg. DoModal();
}
Path class
void path: OnShowWindow (BOOL bShow, UINT nStatus)
{
CDialog: OnShowWindow (bShow, nStatus);
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\driver.txt, CFile:modeRead);
CStdioFile fOpen1 (d:\\MasKurs\\konductor.txt, CFile:modeRead);
CString str;
CString str1;
while (fOpen. ReadString(str)!=0) {
m_combo. AddString(str);
}
while (fOpen1. ReadString(str1)!=0) {
m_combo1. AddString(str1);
}
 // fOpen. SeekToEnd();
 // fOpen. WriteString (m_date+\n);
 // fOpen. WriteString (m_number+\n);
 // fOpen. WriteString (m_marsh+\n);
 // fOpen. WriteString (*****"+\n);
}
CString str1;
CString str2;
void path: OnSaveToPath()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\path.txt, CFile:modeWrite);
CString str;
int index=m_combo. GetCurSel();
int index1=m_combo1. GetCurSel();
if (m_date== || m_number==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
m_combo. GetLBText (index, str1);
m_combo1. GetLBText (index1, str2);
fOpen. SeekToEnd();
fOpen. WriteString (FIO driver +str1+\n);
fOpen. WriteString (FIO konductor +str2+\n);
fOpen. WriteString (Date +m_date+\n);
fOpen. WriteString (Number +m_number+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to path.txt, MB_OK);
}
void path: OnBeginMarshrute()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\marshrutebegin.txt, CFile:modeWrite);
CString str;
if (m_date1== || m_number1== || m_time==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
fOpen. WriteString (Date +m_date1+\n);
fOpen. WriteString (Number +m_number1+\n);
fOpen. WriteString (Time +m_time+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to marshrutebegin.txt, MB_OK);
}
void path: OnSaveToMarshruteOkonchanie()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\marshruteokonchanie.txt, CFile:modeWrite);
CString str;
if (m_date2= || m_number2== || m_time1==) {
MessageBox (Please fill all fields, Info, MB_OK);
return;
}
fOpen. SeekToEnd();
fOpen. WriteString (Date +m_date2+\n);
fOpen. WriteString (Number +m_number2+\n);
fOpen. WriteString (Time +m_time1+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to marshruteokonchanie.txt, MB_OK);
}
Uch class
void uch: OnSaveToUchet()
{
UpdateData(TRUE);
CStdioFile fOpen (d:\\MasKurs\\uchet.txt, CFile:modeWrite);
CString str;
fOpen. SeekToEnd();
fOpen. WriteString (Date +m_date+\n);
fOpen. WriteString (Number of tickets +m_number+\n);
fOpen. WriteString (Nomer +m_marsh+\n);
fOpen. WriteString (*****\n);
MessageBox (Saved to uchet.txt, MB_OK);
}

: 1, 2




2009 .