AddDlg.cpp
资源名称:福利彩票号码统计.rar [点击查看]
上传用户:dinghaosmt
上传日期:2013-03-22
资源大小:110k
文件大小:4k
源码类别:
射击游戏
开发平台:
Visual C++
- // AddDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "福利彩票号码统计.h"
- #include "AddDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CAddDlg dialog
- CAddDlg::CAddDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CAddDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CAddDlg)
- m_Add_Num1 = 0;
- m_Add_Num2 = 0;
- m_Add_Num3 = 0;
- m_Add_Num4 = 0;
- m_Add_Num6 = 0;
- m_Add_Num5 = 0;
- m_Add_Num7 = 0;
- m_Add_Specious = 0;
- m_Add_ID = 0;
- //}}AFX_DATA_INIT
- }
- void CAddDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAddDlg)
- DDX_Text(pDX, IDC_EDIT2, m_Add_Num1);
- DDX_Text(pDX, IDC_EDIT3, m_Add_Num2);
- DDX_Text(pDX, IDC_EDIT4, m_Add_Num3);
- DDX_Text(pDX, IDC_EDIT5, m_Add_Num4);
- DDX_Text(pDX, IDC_EDIT7, m_Add_Num6);
- DDX_Text(pDX, IDC_EDIT6, m_Add_Num5);
- DDX_Text(pDX, IDC_EDIT8, m_Add_Num7);
- DDX_Text(pDX, IDC_EDIT9, m_Add_Specious);
- DDX_Text(pDX, IDC_EDIT1, m_Add_ID);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CAddDlg, CDialog)
- //{{AFX_MSG_MAP(CAddDlg)
- ON_BN_CLICKED(IDC_YES_BUTTON, OnYesButton)
- ON_BN_CLICKED(IDC_CANCEL_BUTTON, OnCancelButton)
- ON_WM_CTLCOLOR()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CAddDlg message handlers
- void CAddDlg::OnYesButton()
- {
- UpdateData(TRUE);
- if((m_Add_Num1>32)||(m_Add_Num1<1))
- {
- MessageBox("第1个号码输入错误!(1----32)!");
- return;
- }
- else if((m_Add_Num2>32)||(m_Add_Num2<1))
- {
- MessageBox("第2个号码输入错误!(1----32)!");
- return;
- }
- else if((m_Add_Num3>32)||(m_Add_Num3<1))
- {
- MessageBox("第3个号码输入错误!(1----32)!");
- return;
- }
- else if((m_Add_Num4>32)||(m_Add_Num4<1))
- {
- MessageBox("第4个号码输入错误!(1----32)!");
- return;
- }
- else if((m_Add_Num5>32)||(m_Add_Num5<1))
- {
- MessageBox("第5个号码输入错误!(1----32)!");
- return;
- }
- else if((m_Add_Num6>32)||(m_Add_Num6<1))
- {
- MessageBox("第6个号码输入错误!(1----32)!");
- return;
- }
- else if((m_Add_Num7>32)||(m_Add_Num7<1))
- {
- MessageBox("第7个号码输入错误!(1----32)!");
- return;
- }
- else if((m_Add_Specious>32)||(m_Add_Specious<1))
- {
- MessageBox("特殊号码输入错误!(1----32)!");
- return;
- }
- else if((m_Add_Num1>=m_Add_Num2)||(m_Add_Num1>=m_Add_Num3)||(m_Add_Num1>=m_Add_Num4)||(m_Add_Num1>=m_Add_Num5)||(m_Add_Num1>=m_Add_Num6)||(m_Add_Num1>=m_Add_Num7)||(m_Add_Num1==m_Add_Specious))
- {
- MessageBox("请不要输入重复的数字,除特殊号码外的7个数字从小到大排列!");
- return;
- }
- else if((m_Add_Num2>=m_Add_Num3)||(m_Add_Num2>=m_Add_Num4)||(m_Add_Num2>=m_Add_Num5)||(m_Add_Num2>=m_Add_Num6)||(m_Add_Num2>=m_Add_Num7)||(m_Add_Num2==m_Add_Specious))
- {
- MessageBox("请不要输入重复的数字,除特殊号码外的7个数字从小到大排列!");
- return;
- }
- else if((m_Add_Num3>=m_Add_Num4)||(m_Add_Num3>=m_Add_Num5)||(m_Add_Num3>=m_Add_Num6)||(m_Add_Num3>=m_Add_Num7)||(m_Add_Num3==m_Add_Specious))
- {
- MessageBox("请不要输入重复的数字,除特殊号码外的7个数字从小到大排列!");
- return;
- }
- else if((m_Add_Num4>=m_Add_Num5)||(m_Add_Num4>=m_Add_Num6)||(m_Add_Num4>=m_Add_Num7)||(m_Add_Num4==m_Add_Specious))
- {
- MessageBox("请不要输入重复的数字,除特殊号码外的7个数字从小到大排列!");
- return;
- }
- else if((m_Add_Num5>=m_Add_Num6)||(m_Add_Num5>=m_Add_Num7)||(m_Add_Num5==m_Add_Specious))
- {
- MessageBox("请不要输入重复的数字,除特殊号码外的7个数字从小到大排列!");
- return;
- }
- else if((m_Add_Num6>=m_Add_Num7)||(m_Add_Num6==m_Add_Specious))
- {
- MessageBox("请不要输入重复的数字,除特殊号码外的7个数字从小到大排列!");
- return;
- }
- else if((m_Add_Num7==m_Add_Specious))
- {
- MessageBox("特殊号码和第7个普通号码重复!!");
- return;
- }
- else
- OnOK();
- }
- void CAddDlg::OnCancelButton()
- {
- OnCancel();
- }
- HBRUSH CAddDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- pDC->SetBkMode(TRANSPARENT);
- pDC->SetTextColor(RGB(0,0,0));
- return m_hbrush;
- }
- BOOL CAddDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- m_hbrush=CreateSolidBrush(RGB(0,128,255));
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }