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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? roomdestine.cpp

?? C++開發完整酒店管理系統
?? CPP
字號:
// RoomDestine.cpp : implementation file
//

#include "stdafx.h"
#include "qq.h"
#include "RoomDestine.h"

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

/////////////////////////////////////////////////////////////////////////////
// CRoomDestine dialog


CRoomDestine::CRoomDestine(CWnd* pParent /*=NULL*/)
	: CDialog(CRoomDestine::IDD, pParent)
{
	//{{AFX_DATA_INIT(CRoomDestine)
	m_DestineCerityType = 0;
	m_SexType = 0;
	//}}AFX_DATA_INIT
	nDestineRoomSum=0;
}


void CRoomDestine::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CRoomDestine)
	DDX_Control(pDX, IDC_ROOMDESTINE_BILLCODE, m_BillCode);
	DDX_Control(pDX, IDC_ROOMDES_CERTIFYCODE, CerifyCode);
	DDX_Control(pDX, IDC_ROOMNUM, m_DestineRoomSum);
	DDX_Control(pDX, IDC_ROOMDESTINE_TYPE, m_RoomType);
	DDX_Control(pDX, IDC_ROOMDESTINE_TIME, m_DestineTime);
	DDX_Control(pDX, IDC_ROOMDESTINE_ROOMCODE, m_RoomCodeList);
	DDX_Control(pDX, IDC_ROOMDESTINE_PRICE, m_RoomPrice);
	DDX_Control(pDX, IDC_ROOMDESTINE_NAME, m_DestinerName);
	DDX_Control(pDX, IDC_ROOMDESTINE_MONEY, m_DestineMoney);
	DDX_Control(pDX, IDC_ROOMDESTINE_DESTINEBILL, m_DestineBill);
	DDX_Radio(pDX, IDC_RADIO1, m_DestineCerityType);
	DDX_Radio(pDX, IDC_RADIO4, m_SexType);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CRoomDestine, CDialog)
	//{{AFX_MSG_MAP(CRoomDestine)
	ON_CBN_SELCHANGE(IDC_ROOMDESTINE_TYPE, OnSelchangeRoomdestineType)
	ON_BN_CLICKED(IDC_ADD, OnAdd)
	ON_BN_CLICKED(IDC_DELETE, OnDelete)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio)
	ON_BN_CLICKED(IDC_RADIO2, OnRadio)
	ON_BN_CLICKED(IDC_RADIO3, OnRadio)
	ON_BN_CLICKED(IDC_RADIO4, OnRadio)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRoomDestine message handlers

BOOL CRoomDestine::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_RoomType.SetWindowText("標準單人房");
	m_RoomType.AddString("標準單人房");//index==0
	m_RoomType.AddString("標準雙人房");
	m_RoomType.AddString("貴族單人房");
	m_RoomType.AddString("貴族雙人房");//index==3

	//產生帳單號碼
	CCreateBillCode billcode;
	m_BillCode.SetWindowText(billcode.GenereBillCode());
	//////////////////////////////////////////////////////////////////////////
	CTime time=CTime::GetCurrentTime();//構造時間對象
    CTime tm(time);
	int year,month,day,hour,minute,second;
    year=tm.GetYear();
    month=tm.GetMonth();
	day=tm.GetDay();
	hour=tm.GetHour();
	minute=tm.GetMinute();
	second=tm.GetSecond();
	CString strYear,strMonth,strDay,strHour,strMinute,strSecond;
	strYear.Format("%d",year);
	strMonth.Format("%d",month);
	strDay.Format("%d",day);
	strHour.Format("%d",hour);
	strMinute.Format("%d",minute);
	strSecond.Format("%d",second);
	CString strShowText;
	strShowText=strYear+"-"+strMonth+"-"+strDay;
    strShowText=strShowText+" "+strHour+":"+strMinute+":"+strSecond;
    m_DestineTime.SetWindowText(strShowText);
	//設置預定額為0
	m_DestineMoney.SetWindowText("0");
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CRoomDestine::OnSelchangeRoomdestineType() 
{
	// TODO: Add your control notification handler code here
	m_RoomCodeList.ResetContent();//清除所有的項目
	CString strComboText;//combobox中的文本
    m_RoomType.GetLBText(m_RoomType.GetCurSel(),strComboText);//獲得選擇的文本
    /////////////////////////////////////////////////////////////////
    //	進行數據庫的查詢
    //roomprice fill
	CString SQLstr;
	SQLstr="SELECT * FROM RoomInfo where RoomType='" ;
    SQLstr=SQLstr+strComboText;
    SQLstr=SQLstr+"'";
	if(!m_RoomInfoSet.Open(AFX_DB_USE_DEFAULT_TYPE,SQLstr))
	{//查詢數據庫得到數據集合
		AfxMessageBox("打開數據庫失敗!");
		return ;
	}
	CString str;
	str.Format("%5.00f",m_RoomInfoSet.m_Price);
	m_RoomPrice.SetWindowText(str);
	m_RoomInfoSet.Close(); //關閉數據庫 
	/////////////////////////////////////////////////////////////
	if(!m_RoomInfoSet.Open())
	{
		MessageBox("打開數據庫失敗!","數據庫錯誤",MB_OK);
		return;
	}
	m_RoomInfoSet.MoveFirst();
	while(!m_RoomInfoSet.IsEOF())
	{
		if(m_RoomInfoSet.m_RoomType==strComboText)
		{
			if(m_RoomInfoSet.m_RoomStatus=="空")
			{
                m_RoomCodeList.AddString(m_RoomInfoSet.m_RoomCode);
			}
		}
		m_RoomInfoSet.MoveNext();
	}
	m_RoomInfoSet.Close();
	////////////////////////////////////////////////////////
	
	/////////////////////////////////////////////////////////////////////
}

void CRoomDestine::OnAdd() 
{
	// TODO: Add your control notification handler code here
	CString strRoomCode;
	if(m_RoomCodeList.GetCount()==0)
	{
		return;
	}
	else
	{
		if(m_RoomCodeList.GetCurSel()!=-1)
		{
           	m_RoomCodeList.GetText(m_RoomCodeList.GetCurSel(),strRoomCode);
		}
	}
	if(m_RoomCodeList.GetCurSel()==-1)
	{
		MessageBox("你至少要選擇一項!","選擇項為空",MB_OK);
		return;
	}
    if(m_RoomCodeList.GetCurSel()!=-1)
	{
		int n=m_DestineBill.GetCount();
		CString strTemp=" ";
		bool bSame=false;
		if(n!=0)
		{ 
			for(int i=0;i<n;i++)
			{
				m_DestineBill.GetText(i,strTemp);
				char* s=strTemp.GetBuffer(strTemp.GetLength());//there is a bug!
				char* str=strtok(s," ");
				str=strtok(NULL," ");
				strTemp=str;
				if(strTemp==strRoomCode)
				{
					MessageBox("你已經添加了這個房間!","選擇錯誤",MB_OK);
					bSame=true;
					return;
				}
			}
		}

		CString BillinfoText;
		if(!bSame)
		{
			m_RoomType.GetWindowText(BillinfoText);
			BillinfoText=BillinfoText+" "+strRoomCode;
			m_DestineBill.AddString(BillinfoText);
			nDestineRoomSum++;
			CString strSum;
			strSum.Format("%d",nDestineRoomSum);
			m_DestineRoomSum.SetWindowText(strSum);
			
		}
	}

	
	////////////////////////////////////////////////////////////////////

}

void CRoomDestine::OnDelete() 
{
	// TODO: Add your control notification handler code here
	int nCurSel=m_DestineBill.GetCurSel();
	if(nCurSel==-1)
	{
		MessageBox("請選擇一個要刪除的房間號","數據為空錯誤",MB_OK);
		return;
	}
	m_DestineBill.DeleteString(nCurSel);
    /////////更新顯示
	nDestineRoomSum--;
	CString strSum;
	strSum.Format("%d",nDestineRoomSum);
	m_DestineRoomSum.SetWindowText(strSum);
}

void CRoomDestine::OnOK() 
{//  [7/1/2003-11:21]
	// TODO: Add extra validation here
	/*
	 *	將下面的一些代碼放在OnOK()函數中是為了放在寫入到數據庫中時,證件類型或者
	    性別為空的情況的發生
		若在OnRaido()函數中寫入這些代碼,如果使用者沒有點擊Radio按鈕的話,就不會進行
		賦值的操作,從而導致寫入到數據庫中的為空
	 */
	UpdateData(TRUE);//狀態更新
	if(m_DestineCerityType==0)
	{
		m_CerityTypeName="身份證";
	}
	if(m_DestineCerityType==1)
	{
		m_CerityTypeName="軍人證";
	}
	if(m_DestineCerityType==2)
	{
		m_CerityTypeName="學生證";
	}
	if(m_SexType==0)
	{
		m_DestinerSexType="男";
	}
	if(m_SexType==1)
	{
		m_DestinerSexType="女";
	}
	/*
	 *	先進行檢查,看是否有些項目為空
	 */
	CString strDestinerName,strDestinerMoney,strCerityCode,strBillCode,strDestinetime;
	m_DestinerName.GetWindowText(strDestinerName);
	m_DestineMoney.GetWindowText(strDestinerMoney);
    CerifyCode.GetWindowText(strCerityCode);
    m_BillCode.GetWindowText(strBillCode);
    m_DestineTime.GetWindowText(strDestinetime);
	if(atof(strDestinerMoney)<0)
	{
		MessageBox("必須要繳納預定金","預定金錯誤",MB_OK);
		return;
	}
	if(m_DestineBill.GetCount()==0)
	{
		MessageBox("帳單為空","錯誤",MB_OK);
		return;
	}
	if(strDestinerName==""||strDestinerMoney==""||strCerityCode=="")
	{
		MessageBox("請填寫完整","為空錯誤",MB_OK);
		return;
	}
	////保存數據到數據庫中
	if(!m_DestineRoomSet.Open())
	{
		MessageBox("數據庫打開失敗!","數據庫錯誤",MB_OK);
		return;
	}
	bool bHadSameRecordSet=false;//是否已經有了這條記錄
	m_DestineRoomSet.MoveFirst();
	while (!m_DestineRoomSet.IsEOF())
	{
		if(strCerityCode==m_DestineRoomSet.m_CeritifyCode)
		{
			bHadSameRecordSet=true;
			break;
		}
		m_DestineRoomSet.MoveNext();
	}
    m_DestineRoomSet.Close();//數據庫關閉
	if(bHadSameRecordSet)
	{
		MessageBox("該客人已經預定了房間!","錯誤",MB_OK);
		return;
	}
	else
	{
		//寫入到數據庫的表中
		if(!m_DestineRoomSet.Open())
		{
			MessageBox("數據庫打開失敗!","數據庫錯誤",MB_OK);
			return;
		}
		m_DestineRoomSet.AddNew();//添加一條新的記錄
        m_DestineRoomSet.m_BillCode=strBillCode;//帳單號碼
		m_DestineRoomSet.m_CeritifyCode=strCerityCode;
        m_DestineRoomSet.m_Certificate=m_CerityTypeName;
		m_DestineRoomSet.m_DestineMoney=strDestinerMoney;
		m_DestineRoomSet.m_DestinerName=strDestinerName;
		m_DestineRoomSet.m_DestinerSex=m_DestinerSexType;
		m_DestineRoomSet.m_DestineTime=strDestinetime;
		//寫入預定了哪些房間
		CString strRoomCodes,strTemp;
		for(int i=0;i<m_DestineBill.GetCount();i++)
		{
			m_DestineBill.GetText(i,strTemp);
			char* s=strTemp.GetBuffer(strTemp.GetLength());//there is a bug!
			char* str=strtok(s," ");
			str=strtok(NULL," ");
			strRoomCodes=strRoomCodes+str+",";
		}
		m_DestineRoomSet.m_DestineRoomCode=strRoomCodes;
		m_DestineRoomSet.Update();//更新記錄
		m_DestineRoomSet.Close();//關閉數據庫,寫入了一條新的記錄
		//改寫CRoomInfoSet表中的信息
		//將預定的房間的狀態改為“預定”
		for(i=0;i<m_DestineBill.GetCount();i++)
		{
			CString strRoomCode;
			m_DestineBill.GetText(i,strTemp);
			char* s=strTemp.GetBuffer(strTemp.GetLength());//there is a bug!
			char* str=strtok(s," ");
			str=strtok(NULL," ");
            strRoomCode=str;
            if(!m_RoomInfoSet.Open())
			{
			    MessageBox("數據庫打開失敗!","數據庫錯誤",MB_OK);
			    return;
			}
		    m_RoomInfoSet.MoveFirst();
		    while (!m_RoomInfoSet.IsEOF())
			{
			    if(strRoomCode==m_RoomInfoSet.m_RoomCode)
				{
					m_RoomInfoSet.Edit();
					m_RoomInfoSet.m_RoomStatus="預定";
					m_RoomInfoSet.Update();
				}
				m_RoomInfoSet.MoveNext();
			}
			m_RoomInfoSet.Close();
		}
	}
	CDialog::OnOK();
}

void CRoomDestine::OnRadio() 
{
	// TODO: Add your control notification handler code here

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜在线视频| 国内外成人在线| 欧美成人官网二区| 337p亚洲精品色噜噜噜| 欧美性生交片4| 欧美日免费三级在线| 欧美在线观看禁18| 91精品国模一区二区三区| 91精品在线免费| 欧美zozozo| 国产精品美女久久久久久久网站| 日本一二三四高清不卡| 国产精品丝袜黑色高跟| 亚洲精品乱码久久久久| 亚洲不卡一区二区三区| 久久国产麻豆精品| 国产成人日日夜夜| 色狠狠av一区二区三区| 欧美男人的天堂一二区| 欧美成人免费网站| 中文字幕一区二区三区乱码在线| 亚洲欧美另类久久久精品2019| 一区二区三区中文字幕精品精品| 性做久久久久久免费观看欧美| 日本不卡的三区四区五区| 国产一区二区中文字幕| 99国产精品久久久久久久久久 | 91麻豆精品国产91久久久久久 | 婷婷久久综合九色国产成人| 日韩精品91亚洲二区在线观看| 麻豆91免费观看| 国产.精品.日韩.另类.中文.在线.播放| 成人激情动漫在线观看| 欧美日韩国产免费一区二区| 精品国产精品网麻豆系列| 日韩美女视频一区| 九色|91porny| 欧美性videosxxxxx| 久久综合色婷婷| 一区二区三区毛片| 国产制服丝袜一区| 欧美日韩高清不卡| 亚洲视频在线一区观看| 免费成人av资源网| 色婷婷久久一区二区三区麻豆| 精品福利av导航| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产成人自拍高清视频在线免费播放| 色综合中文字幕国产 | 色综合视频一区二区三区高清| 欧美一区二区三区四区久久| 国产精品不卡在线| 国产成人久久精品77777最新版本| 欧美日韩性生活| 樱花草国产18久久久久| 国产成人小视频| 精品国产1区二区| 青娱乐精品视频在线| 91啪九色porn原创视频在线观看| 26uuu国产日韩综合| 天天综合日日夜夜精品| 在线免费观看日本欧美| 亚洲欧美日韩国产综合| 国产91精品入口| 久久精品视频一区二区| 精品一区二区三区香蕉蜜桃| 91麻豆精品国产综合久久久久久| 一区二区三区av电影| 99久久久精品| 亚洲欧洲美洲综合色网| 成人动漫视频在线| 亚洲欧洲精品成人久久奇米网| 国产精品亚洲第一| 久久精品一区二区| 成人国产免费视频| 1024成人网色www| 91蜜桃免费观看视频| 有码一区二区三区| 在线观看免费成人| 视频一区欧美精品| 日韩三级视频中文字幕| 美国欧美日韩国产在线播放| 91精品国产综合久久精品| 免费一级片91| 久久综合色鬼综合色| 国产精品99久久久久久久女警| 国产精品视频一二三区| 99re成人精品视频| 亚洲国产精品一区二区www在线 | 91精品欧美综合在线观看最新| 人人爽香蕉精品| 久久久久久久久久久久久久久99| 国产精品一卡二卡| 一区二区欧美精品| 日韩欧美一级特黄在线播放| 国产一区二区在线影院| 1区2区3区欧美| 欧美一区二区国产| 91成人免费在线视频| 石原莉奈一区二区三区在线观看| 日韩三级伦理片妻子的秘密按摩| 国产福利一区二区| 亚洲高清视频的网址| 欧美精品一区二区三| 99re这里只有精品视频首页| 日本中文在线一区| 亚洲国产高清在线| 4438x亚洲最大成人网| 国产成人av电影在线播放| 亚洲国产综合91精品麻豆| 精品女同一区二区| 99久久99久久精品免费观看| 日韩精品一二三四| 国产欧美日韩精品在线| 欧美老肥妇做.爰bbww| 国产成人在线视频免费播放| 性欧美大战久久久久久久久| 国产视频一区不卡| 成人午夜电影久久影院| 秋霞成人午夜伦在线观看| 中文天堂在线一区| 日韩一区国产二区欧美三区| 色综合网色综合| 国产曰批免费观看久久久| 亚洲妇女屁股眼交7| 一区免费观看视频| 国产日韩一级二级三级| 日韩欧美的一区| 777xxx欧美| 91成人免费网站| av色综合久久天堂av综合| 国产又粗又猛又爽又黄91精品| 夜夜精品视频一区二区| 欧美高清在线精品一区| 欧美精品一区视频| 日韩欧美一区中文| 91精品在线免费观看| 欧美精品久久天天躁| 欧美性色综合网| 91蝌蚪porny九色| av亚洲精华国产精华精华| 国产成人a级片| 国产成人免费高清| 国产成人精品亚洲日本在线桃色| 久久97超碰国产精品超碰| 免费观看在线综合| 日本人妖一区二区| 久久超碰97中文字幕| 美女视频免费一区| 蜜臀国产一区二区三区在线播放| 午夜久久电影网| 丝袜美腿亚洲综合| 男女男精品视频| 另类小说视频一区二区| 精品亚洲成a人| 国产白丝精品91爽爽久久| 国产一区二区在线看| 国产乱色国产精品免费视频| 国产在线播放一区三区四| 国产成人免费在线| 99re这里只有精品首页| 91麻豆成人久久精品二区三区| 91久久香蕉国产日韩欧美9色| 欧美亚洲国产bt| 欧美一区二区久久久| 2022国产精品视频| 中文字幕不卡在线播放| 亚洲视频资源在线| 日日摸夜夜添夜夜添精品视频 | 色8久久精品久久久久久蜜| 91成人网在线| 日韩视频免费观看高清在线视频| 久久综合久久久久88| 国产精品久久久久精k8| 亚洲精品欧美在线| 久久国产日韩欧美精品| 成人黄色小视频在线观看| 在线中文字幕一区二区| 精品国产欧美一区二区| 17c精品麻豆一区二区免费| 日韩国产一二三区| 国产69精品久久久久毛片| 欧美伊人精品成人久久综合97 | 日韩精品一级二级 | 91成人网在线| 久久久亚洲高清| 亚洲精品欧美综合四区| 蜜桃91丨九色丨蝌蚪91桃色| aaa亚洲精品| 日韩三级伦理片妻子的秘密按摩| 中文字幕 久热精品 视频在线| 亚洲电影一级片| 成人av在线资源网站| 欧美精品少妇一区二区三区 | 亚洲免费av在线| 精品一区二区三区免费| 欧美午夜理伦三级在线观看| 欧美精品一区二区三区视频 | 日韩精品免费专区| 成人小视频在线观看|