-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddGroup.cpp
More file actions
76 lines (60 loc) · 1.6 KB
/
Copy pathAddGroup.cpp
File metadata and controls
76 lines (60 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// AddGroup.cpp : implementation file
//
#include "stdafx.h"
#include "derby1.h"
#include "AddGroup.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAddGroup dialog
CAddGroup::CAddGroup(CWnd* pParent /*=NULL*/)
: CDialog(CAddGroup::IDD, pParent)
{
//{{AFX_DATA_INIT(CAddGroup)
m_DenNumber = _T("");
m_Level = _T("");
m_PackNumber = _T("");
//}}AFX_DATA_INIT
}
void CAddGroup::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAddGroup)
DDX_Text(pDX, IDC_DENEDIT, m_DenNumber);
DDX_CBString(pDX, IDC_LEVELCOMBO, m_Level);
DDX_Text(pDX, IDC_PACKEDIT, m_PackNumber);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAddGroup, CDialog)
//{{AFX_MSG_MAP(CAddGroup)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddGroup message handlers
// Author: RLS Date: December 2002
void CAddGroup::OnOK()
{
CString GroupStr;
UpdateData (TRUE);
if ((m_PackNumber == "") ||
(m_Level == "") ||
(m_DenNumber == ""))
{
MessageBox ("All fields must be completed", "Missing info", MB_OK);
return;
}
GroupStr = m_PackNumber + " " + m_Level + " " + m_DenNumber;
CDerby1App* theApp = (CDerby1App*)AfxGetApp ();
if (theApp->m_GroupIndex < 99)
{
theApp->m_GroupList[theApp->m_GroupIndex] = GroupStr;
theApp->m_CurrentGroup = theApp->m_GroupIndex;
theApp->m_GroupIndex++;
}
else
MessageBox ("There are too many groups being used", "Too many groups", MB_OK);
CDialog::OnOK();
}