⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toursign.cpp

📁 该系统为花店销售管理系统
💻 CPP
字号:
// toursign.cpp : implementation file
//

#include "stdafx.h"
#include "flowerSaleSystem.h"
#include "toursign.h"
#include "guset.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// toursign dialog


toursign::toursign(CWnd* pParent /*=NULL*/)
	: CDialog(toursign::IDD, pParent)
{
	//{{AFX_DATA_INIT(toursign)
	m_id = _T("");
	m_name = _T("");
	m_phn = _T("");
	m_psw = _T("");
	m_year = 0;
	m_city = _T("");
	//}}AFX_DATA_INIT
}


void toursign::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(toursign)
	DDX_Text(pDX, IDC_STATICid, m_id);
	DDX_Text(pDX, IDC_EDITname, m_name);
	DDX_Text(pDX, IDC_EDITphn, m_phn);
	DDX_Text(pDX, IDC_EDITpsw, m_psw);
	DDX_Text(pDX, IDC_EDITyear, m_year);
	DDX_Text(pDX, IDC_EDITcity, m_city);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(toursign, CDialog)
	//{{AFX_MSG_MAP(toursign)
	ON_BN_CLICKED(IDC_BUTTONchange, OnBUTTONchange)
	ON_BN_CLICKED(IDC_BUTTONsubmit, OnBUTTONsubmit)
	ON_BN_CLICKED(IDC_BUTTONcancel, OnBUTTONcancel)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// toursign message handlers

BOOL toursign::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	int r=0;
    time_t t;
	guset de;
	de.Open();
	
	srand((unsigned) time(&t));
	while(r<1000)		
		r=rand() %10000;
	m_id.Format("%d",r);
	
	while(!de.IsEOF())
	{
		if(de.m_gid!=r)
			de.MoveNext();
		else
		{
			while(r<1000)
				r=rand() %10000;
			m_id.Format("%d",r);
			de.MoveFirst();
		}
	}
	
	m_id.Format("%d",r);
    de.Close();
    
    ((CButton*)GetDlgItem(IDC_RADIO))->SetCheck(1);
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void toursign::OnBUTTONchange() 
{
	// TODO: Add your control notification handler code here
	int r=0;
    time_t t;
	guset de;
	de.Open();
	
	srand((unsigned) time(&t));
	while(r<1000)		
		r=rand() %10000;
	m_id.Format("%d",r);
	
	while(!de.IsEOF())
	{
		if(de.m_gid!=r)
			de.MoveNext();
		else
		{
			while(r<1000)
				r=rand() %10000;
			m_id.Format("%d",r);
			de.MoveFirst();
		}
	}
	
	m_id.Format("%d",r);
    de.Close();	
	UpdateData(FALSE);
}

void toursign::OnBUTTONsubmit() 
{
	// TODO: Add your control notification handler code here
	UpdateData();
	guset de;
	int n=GetCheckedRadioButton(IDC_RADIO,IDC_RADIO3);
	
    de.Open();
	de.AddNew();
	de.m_gid=m_id;
	de.m_gname=m_name;
	de.m_gyear=m_year;
	de.m_gpassword=m_psw;
	de.m_gphone=m_phn;
	de.m_gcity=m_city;
    if(n==IDC_RADIO)de.m_gsex="男";
	else
		de.m_gsex="女";
	de.Update();
	de.Requery();
    de.MoveLast();
	
	de.Close();
	OnOK();
}

void toursign::OnBUTTONcancel() 
{
	// TODO: Add your control notification handler code here
	OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -