亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 飛機票定票和退票系統(tǒng)dlg.cpp

?? 一個可用于機場的定票和退票的系統(tǒng)
?? CPP
字號:
// 飛機票定票和退票系統(tǒng)Dlg.cpp : implementation file
//

#include "stdafx.h"
#include "飛機票定票和退票系統(tǒng).h"
#include "飛機票定票和退票系統(tǒng)Dlg.h"
#include "string.h"
#include "stdlib.h"
#include "compare.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()

/////////////////////////////////////////////////////////////////////////////
// CMyDlg dialog

CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CMyDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMyDlg)
	m_remain = _T("");
	m_passenger = _T("");
	m_pt = _T("");
	m_destinenum = _T("");
	m_ticketnum = 0;
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMyDlg)
	DDX_Control(pDX, IDC_COMBO_fly, m_fly);
	DDX_Control(pDX, IDC_EDIT_information, m_information);
	DDX_Control(pDX, IDC_EDIT_p_information, m_p_information);
	DDX_Control(pDX, IDC_EDIT_name, m_name);
	DDX_Control(pDX, IDC_EDIT_destination, m_destination);
	DDX_Text(pDX, IDC_EDIT_remain, m_remain);
	DDX_Text(pDX, IDC_EDIT_passenger, m_passenger);
	DDX_Text(pDX, IDC_EDIT_pt, m_pt);
	DDX_Text(pDX, IDC_EDIT__destinenum, m_destinenum);
	DDX_Text(pDX, IDC_EDIT_ticketnum, m_ticketnum);
	DDV_MinMaxInt(pDX, m_ticketnum, 0, 100);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
	//{{AFX_MSG_MAP(CMyDlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_BUTTON_OK, OnButtonOk)
	ON_BN_CLICKED(IDC_BUTTON_CANCEL, OnButtonCancel)
	ON_CBN_SELCHANGE(IDC_COMBO_fly, OnSelchangeCOMBOfly)
	ON_EN_CHANGE(IDC_EDIT_ticketnum, OnChangeEDITticketnum)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyDlg message handlers

BOOL CMyDlg::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);
		}
	}

	// 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
	totlep=0;
	destinenum=0;
	m_ticketnum=1;
	totle[0]=100;totle[1]=100;totle[2]=100;
	remain[0]=100;remain[1]=100;remain[2]=100;
	now[0]=0;now[1]=0;now[2]=0;
	m_fly.AddString("CF_101");
	m_fly.AddString("CF_108");
	m_fly.AddString("CF_134");
	m_fly.SelectString(-1,"CF_101");
	fly=0;
	m_remain.Format("%d",remain[0]);
	m_passenger.Format("%d",now[1]);
	m_pt.Format("%d",totlep);
	m_destinenum.Format("%d",destinenum);
	m_destination.SetSel(0,-1);
	m_destination.ReplaceSel("武漢");
	UpdateData(0);
	return TRUE;  // return TRUE  unless you set the focus to a control
}

void CMyDlg::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 CMyDlg::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 CMyDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void CMyDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

void CMyDlg::OnButtonOk() 
{
	// TODO: Add your control notification handler code here
	m_destination.GetWindowText(p[destinenum].destination,20);
	m_name.GetWindowText(p[destinenum].name,20);
	m_fly.GetWindowText(p[destinenum].fly,20);
	p[destinenum].ticketnum=m_ticketnum;
	int RADIO;
	RADIO=GetCheckedRadioButton(IDC_RADIO_man,IDC_RADIO_woman);
	p[destinenum].sex=RADIO;
	if(remain[fly]>=m_ticketnum&&m_name.GetWindowText(p[totlep].name,20)&&m_destination.GetWindowText(p[totlep].destination,20)&&(RADIO==IDC_RADIO_man||RADIO==IDC_RADIO_woman))
	{
		totlep+=m_ticketnum;
		destinenum++;
		now[fly]+=m_ticketnum;
		remain[fly]-=m_ticketnum;
		m_passenger.Format("%d",(now[fly]));
		m_remain.Format("%d",(remain[fly]));
		m_pt.Format("%d",totlep);
		m_destinenum.Format("%d",destinenum);
		//m_p_information.SetSel(0,-1);
		//m_p_information.ReplaceSel(p[now].destination);
		//m_p_information.ReplaceSel("   ");
		//if (RADIO==IDC_RADIO_man) m_p_information.ReplaceSel("男   ");
		//else if (RADIO==IDC_RADIO_woman) m_p_information.ReplaceSel("女   ");
		//m_p_information.ReplaceSel(p[now].name);
		m_information.SetSel(0,-1);
		m_information.ReplaceSel("定票成功");
		UpdateData(0);
	}
	else if (remain[fly]<m_ticketnum)
	{
		m_information.SetSel(0,-1);
		if (fly==1)
		{
			m_information.ReplaceSel("當(dāng)前航線的票數(shù)已不能滿足,定票失敗");
		}
		else if (fly==0)
		{
			if (remain[2]>=m_ticketnum)
				m_information.ReplaceSel("當(dāng)前航線的票數(shù)已不能滿足,訂票失敗CF_134次航班能滿足您的要求,請訂CF_134次航班");
			else m_information.ReplaceSel("當(dāng)前航線的票數(shù)已不能滿足,定票失敗");
		}
		else if (fly==2)
		{
			if (remain[0]>=m_ticketnum)
				m_information.ReplaceSel("當(dāng)前航線的票數(shù)已不能滿足,訂票失敗CF_101次航班能滿足您的要求,請訂CF_101次航班");
			else m_information.ReplaceSel("當(dāng)前航線的票數(shù)已不能滿足,定票失敗");
		}
		UpdateData(0);
	}
	else
	{
		m_information.SetSel(0,-1);
		m_information.ReplaceSel("乘客信息填寫不完整,定票失敗");
		UpdateData(0);
	}
	if (now[fly]>100)
	{
		m_information.SetSel(0,-1);
		m_information.ReplaceSel("機票已售完,請選擇其他航線");
		now[fly]=100;
		remain[fly]=100;
	}
	m_p_information.SetSel(0,-1);
	m_p_information.ReplaceSel("");
	qsort( (void *)p,destinenum,sizeof(p[1]),compare);
	for (int i=0;i<destinenum;i++)
	{
		m_p_information.SetSel(-1,0);
		m_p_information.ReplaceSel(p[i].name);
		m_p_information.ReplaceSel("   ");
		if (p[i].sex==IDC_RADIO_man) m_p_information.ReplaceSel("男   ");
		else if (p[i].sex==IDC_RADIO_woman) m_p_information.ReplaceSel("女   ");
		m_p_information.ReplaceSel(p[i].destination);
		m_p_information.ReplaceSel("   ");
		m_p_information.ReplaceSel(p[i].fly);
		m_p_information.ReplaceSel("   ");
		char temp[10];
		_gcvt(p[i].ticketnum,10,temp);
		m_p_information.ReplaceSel(temp);
		m_p_information.ReplaceSel("\n");
		//m_p_information.FmtLines(NULL);
	}
	UpdateData(0);
}

void CMyDlg::OnButtonCancel() 
{
	// TODO: Add your control notification handler code here
	char temp_name[20];
	int temp_sex;
	char temp_destination[20];
	m_destination.GetWindowText(temp_destination,20);
	m_name.GetWindowText(temp_name,20);
	temp_sex=GetCheckedRadioButton(IDC_RADIO_man,IDC_RADIO_woman);
	if (now[fly]==0)
	{
		m_information.SetSel(0,-1);
		m_information.ReplaceSel("當(dāng)前無人定票,退票失敗");
	}
	else
{
	for (int i=0;i<destinenum;i++)
	{
		if (strcmp(p[i].destination,temp_destination)==0)
		{
			if (strcmp(p[i].name,temp_name)==0)
			{
				if (p[i].sex==temp_sex&&p[i].ticketnum==m_ticketnum)
				{
					//add your code here
					for (int j=i;j<destinenum-1;j++)
					{
						p[j]=p[j+1];
					}
					now[fly]-=m_ticketnum;
					remain[fly]+=m_ticketnum;
					totlep-=m_ticketnum;
					destinenum--;
					m_passenger.Format("%d",(now[fly]));
					m_remain.Format("%d",(remain[fly]));
					m_destinenum.Format("%d",destinenum);
					m_pt.Format("%d",totlep);
					m_information.SetSel(0,-1);
					m_information.ReplaceSel("退票成功");
					break;
				}
				else if(p[i].sex!=temp_sex)
				{
					m_information.SetSel(0,-1);
					m_information.ReplaceSel("查無此記錄,退票失敗");
				}
				else if (p[i].ticketnum>m_ticketnum)
				{
					now[fly]-=m_ticketnum;
					remain[fly]+=m_ticketnum;
					totlep-=m_ticketnum;
					p[i].ticketnum-=m_ticketnum;
					m_passenger.Format("%d",(now[fly]));
					m_remain.Format("%d",(remain[fly]));
					m_pt.Format("%d",totlep);
					m_information.SetSel(0,-1);
					m_information.ReplaceSel("退票成功");
				}
				else if (p[i].ticketnum<m_ticketnum)
				{
					m_information.SetSel(0,-1);
					m_information.ReplaceSel("此乘客所定票數(shù)少于所輸入的票數(shù),退票失敗");
				}
			}
			else
			{
				m_information.SetSel(0,-1);
				m_information.ReplaceSel("查無此記錄,退票失敗");
			}
		}
		else
		{
			m_information.SetSel(0,-1);
			m_information.ReplaceSel("查無此記錄,退票失敗");
		}
	}
	m_p_information.SetSel(0,-1);
	m_p_information.ReplaceSel("");
	for (int k=0;k<destinenum;k++)
	{
		m_p_information.SetSel(-1,0);
		m_p_information.ReplaceSel(p[k].name);
		m_p_information.ReplaceSel("   ");
		if (p[k].sex==IDC_RADIO_man) m_p_information.ReplaceSel("男   ");
		else if (p[k].sex==IDC_RADIO_woman) m_p_information.ReplaceSel("女   ");
		m_p_information.ReplaceSel(p[k].destination);
		m_p_information.ReplaceSel("   ");
		m_p_information.ReplaceSel(p[k].fly);
		m_p_information.ReplaceSel("   ");
		char temp[10];
		_gcvt(p[k].ticketnum,10,temp);
		m_p_information.ReplaceSel(temp);
		m_p_information.ReplaceSel("\n");
	}
	UpdateData(0);
}
}

void CMyDlg::OnSelchangeCOMBOfly() 
{
	// TODO: Add your control notification handler code here
	char tempstring[20];
	m_fly.GetWindowText(tempstring,20);
	if (strcmp(tempstring,"CF_101")==0) {fly=0;m_destination.SetSel(0,-1);m_destination.ReplaceSel("武漢");}
	else if (strcmp(tempstring,"CF_108")==0) {fly=1;m_destination.SetSel(0,-1);m_destination.ReplaceSel("長沙");}
	else if (strcmp(tempstring,"CF_134")==0) {fly=2;m_destination.SetSel(0,-1);m_destination.ReplaceSel("武漢");}
	m_passenger.Format("%d",(now[fly]));
	m_remain.Format("%d",(remain[fly]));
	UpdateData(0);
}

void CMyDlg::OnChangeEDITticketnum() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	char temp[20];
	(GetDlgItem(IDC_EDIT_ticketnum))->GetWindowText(temp,20);
	m_ticketnum=(int)atof((LPCTSTR)temp);
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久激情五月婷婷| 午夜精品一区在线观看| 日韩精品1区2区3区| 欧美三级乱人伦电影| 蜜桃精品视频在线观看| 国产精品初高中害羞小美女文| 欧美日韩成人在线一区| 99久久久精品| 一区二区三区高清| 久久色.com| 3atv一区二区三区| 色综合天天狠狠| 国产成人精品影视| 免费成人你懂的| 欧美激情一区二区三区四区| 欧美日本精品一区二区三区| www.亚洲色图.com| 亚洲第一av色| 亚洲婷婷国产精品电影人久久| 精品国产乱码久久久久久浪潮| 欧美日韩中字一区| 久久成人18免费观看| 香蕉影视欧美成人| 亚洲精品视频在线看| 国产精品女主播av| 精品999在线播放| 97精品久久久久中文字幕| 亚洲欧美日韩中文播放| 欧美日韩一区二区三区视频| kk眼镜猥琐国模调教系列一区二区 | 亚洲成人精品在线观看| 日韩欧美专区在线| 国产福利精品导航| 国产伦精品一区二区三区视频青涩 | 在线这里只有精品| 91色视频在线| 青青青伊人色综合久久| 天天亚洲美女在线视频| 亚洲不卡在线观看| 亚洲国产精品精华液2区45| 在线一区二区视频| 91福利区一区二区三区| 在线观看一区二区精品视频| 色88888久久久久久影院按摩| 99国产欧美另类久久久精品| 91在线观看下载| 99久久99久久久精品齐齐| 99re在线精品| 久久电影网站中文字幕| 伦理电影国产精品| 亚洲一本大道在线| 中文字幕免费观看一区| 国产精品视频一二三区| 国产精品国产三级国产aⅴ入口 | 欧美日韩国产在线播放网站| 欧洲亚洲精品在线| 欧美日韩视频在线第一区| 欧美一级二级三级蜜桃| 精品国产三级电影在线观看| 日本道色综合久久| 欧美精品一二三| 91精品欧美久久久久久动漫| 欧美一区二区三区在线看| 精品免费视频.| 欧美影院一区二区三区| a在线播放不卡| 色八戒一区二区三区| 欧美日韩在线一区二区| 日韩一级视频免费观看在线| 欧美性大战久久久| 99精品国产视频| 成人一区在线观看| 91免费视频大全| 欧美日韩亚洲国产综合| 欧美性猛片aaaaaaa做受| 91.com在线观看| 欧美亚洲高清一区| 色综合一个色综合亚洲| 欧美日韩在线不卡| 精品剧情在线观看| 中文字幕一区二区三区在线观看| 国产亚洲一区字幕| 亚洲精品五月天| 精品一二三四在线| 久久国产欧美日韩精品| 日本午夜精品视频在线观看| 东方欧美亚洲色图在线| 国产**成人网毛片九色| 国产成人午夜高潮毛片| 91精品福利视频| 精品日本一线二线三线不卡| 亚洲卡通欧美制服中文| 亚洲欧美日韩国产另类专区| 青椒成人免费视频| 全国精品久久少妇| 99视频精品在线| 99re热视频精品| 日韩视频免费观看高清完整版 | 欧美日本一区二区三区| 久久精品夜色噜噜亚洲a∨| 亚洲午夜精品17c| 亚洲电影激情视频网站| 国产91精品露脸国语对白| 欧美一区二区三区在线电影| 精品成人私密视频| 一区二区三区加勒比av| 日韩综合一区二区| 免费久久99精品国产| 99国产精品国产精品毛片| 欧美电影精品一区二区| 国产三级精品三级在线专区| 国产精品久线观看视频| 亚洲综合色视频| 丝袜国产日韩另类美女| 久久国内精品自在自线400部| 国产激情一区二区三区桃花岛亚洲| 国产·精品毛片| 精品蜜桃在线看| 日本中文字幕不卡| 欧美影院午夜播放| 亚洲三级在线看| 成人a免费在线看| 国产日韩综合av| 国产黑丝在线一区二区三区| 日韩欧美亚洲一区二区| 亚洲一区二区美女| 久久99热狠狠色一区二区| 国产91对白在线观看九色| 精品国产乱码久久久久久图片 | 国产精品1区2区| 久久久99精品免费观看| 久久av资源网| 99riav一区二区三区| 国产欧美精品在线观看| 亚洲在线视频网站| 色综合久久综合| 一区二区三区欧美久久| 九九视频精品免费| 日韩午夜在线影院| 国产精品日韩精品欧美在线| 视频一区欧美日韩| 91精品福利在线一区二区三区| 偷窥国产亚洲免费视频| 风流少妇一区二区| 欧美日韩精品免费观看视频| 亚洲大片一区二区三区| 欧美日韩视频在线第一区| 国产精品理论在线观看| 成人高清免费在线播放| 亚洲视频小说图片| 久久99久久99精品免视看婷婷| 色综合久久久久久久久| 亚洲一区二区三区自拍| 国产mv日韩mv欧美| 国产精品精品国产色婷婷| 精品一区二区三区免费观看| 久久久久久久久99精品| 成人丝袜18视频在线观看| 日韩理论在线观看| 国产毛片精品一区| 中文av字幕一区| 色婷婷香蕉在线一区二区| 亚洲妇女屁股眼交7| 99精品视频在线观看| 久久久精品国产免费观看同学| 国产99久久久精品| 一区二区三区国产豹纹内裤在线| av毛片久久久久**hd| 亚洲欧美综合网| 成人免费观看av| 中文字幕巨乱亚洲| 日本韩国欧美国产| 青青草97国产精品免费观看无弹窗版| 亚洲精品在线免费播放| av中文字幕不卡| 欧美激情一二三区| 欧美图区在线视频| 亚洲欧美区自拍先锋| 6080午夜不卡| 懂色av一区二区夜夜嗨| 天天综合天天做天天综合| 欧美亚洲国产一区二区三区 | 久久久久久久久久美女| 色哟哟亚洲精品| 亚洲欧洲综合另类| 日韩欧美一区二区在线视频| 午夜精品一区二区三区三上悠亚| 在线看日韩精品电影| 国产在线看一区| 亚洲一区二区三区四区中文字幕| 亚洲精品在线观看网站| 91国产福利在线| 夜夜操天天操亚洲| 欧美在线不卡一区| 国产一区二区三区久久久 | 欧美视频第二页| 国产91在线看| 中文字幕亚洲区| 日韩你懂的在线播放| 一本久道久久综合中文字幕|