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

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

?? roomdestine.cpp

?? 一個比較完整的酒店管理系統
?? 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一区二区三区免费野_久草精品视频
在线观看成人小视频| 色综合中文字幕| 性做久久久久久久免费看| 亚洲色图一区二区三区| 国产精品国产三级国产普通话蜜臀| 久久欧美一区二区| 国产色一区二区| 亚洲国产高清aⅴ视频| 国产精品久久久久久久久久免费看| 中文字幕二三区不卡| 亚洲免费在线观看视频| 一区二区三区 在线观看视频| 国产精品美女久久久久久久久| 国产精品久久久久三级| 日韩美女主播在线视频一区二区三区| 欧美一级二级三级蜜桃| 日韩精品一区二区在线观看| 久久久99精品久久| 最新不卡av在线| 亚洲国产精品天堂| 麻豆成人91精品二区三区| 国产成人免费视频| 91麻豆免费看| 日韩精品中文字幕一区| 国产精品乱人伦中文| 亚洲大型综合色站| 久久99精品国产91久久来源| 成人在线综合网站| 欧美日韩在线不卡| 精品国产一区二区三区不卡| 亚洲图片另类小说| 日本在线播放一区二区三区| 国产福利一区二区三区视频在线 | 欧美成人三级在线| 久久蜜桃av一区二区天堂| 亚洲男帅同性gay1069| 日韩黄色一级片| 不卡的电影网站| 日韩欧美国产三级| 亚洲一区在线观看视频| 国产成人综合在线播放| 欧美日韩一区小说| 中文av一区特黄| 蜜乳av一区二区| 91猫先生在线| 国产女同性恋一区二区| 日产精品久久久久久久性色| 91免费看片在线观看| 精品三级av在线| 亚洲成国产人片在线观看| av一区二区三区在线| 精品国精品国产| 日韩不卡一二三区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 久久综合久久综合亚洲| 午夜成人免费视频| 欧美亚洲图片小说| 成人免费在线播放视频| 国产一区二区视频在线| 91麻豆精品国产自产在线| 最新日韩在线视频| 成人高清免费观看| 国产精品色呦呦| 国产另类ts人妖一区二区| 欧美不卡在线视频| 理论片日本一区| 日韩精品一区二区三区老鸭窝| 香蕉久久夜色精品国产使用方法 | 日韩欧美在线综合网| 一区二区免费在线播放| 色综合久久久久综合体| 亚洲精品大片www| 欧洲精品中文字幕| 亚洲第一精品在线| 欧美另类久久久品| 日韩黄色小视频| 欧美电影免费提供在线观看| 九九精品一区二区| 久久久久久久久久电影| 成熟亚洲日本毛茸茸凸凹| 亚洲国产成人私人影院tom| 成人性色生活片免费看爆迷你毛片| 日本一区二区三区免费乱视频| 国产麻豆欧美日韩一区| 国产日韩欧美综合在线| 成人精品在线视频观看| 亚洲欧美怡红院| 91福利国产精品| 日韩精品三区四区| 2023国产一二三区日本精品2022| 国产一区二区三区电影在线观看 | 日本一区二区久久| 色婷婷亚洲综合| 日日欢夜夜爽一区| 国产三级一区二区三区| 91美女在线看| 美女被吸乳得到大胸91| 中文一区一区三区高中清不卡| 91免费看视频| 久久99精品网久久| 最近日韩中文字幕| 欧美草草影院在线视频| av一本久道久久综合久久鬼色| 亚洲愉拍自拍另类高清精品| 精品国产一区二区精华| 一本到不卡免费一区二区| 午夜电影久久久| 中文乱码免费一区二区| 欧美丰满一区二区免费视频| 国产美女娇喘av呻吟久久| 一区二区三区中文字幕精品精品| 欧美一区二区三区男人的天堂| 丰满放荡岳乱妇91ww| 亚洲444eee在线观看| 中文字幕欧美三区| 日韩一区二区在线免费观看| 99久久婷婷国产| 奇米777欧美一区二区| 国产精品你懂的| 日韩视频免费直播| 在线一区二区观看| 国产一区二区主播在线| 亚洲国产精品一区二区www在线 | 蜜臀av性久久久久蜜臀aⅴ四虎| 国产午夜精品久久久久久久| 欧美日韩国产综合久久| 99视频精品全部免费在线| 麻豆国产精品一区二区三区| 夜夜嗨av一区二区三区| 国产精品高潮久久久久无| 欧美精品一区二区蜜臀亚洲| 在线播放日韩导航| 色综合久久久久| 成人av第一页| 国产精品影视天天线| 经典三级在线一区| 久久国产精品免费| 免费在线观看日韩欧美| 日韩精品成人一区二区在线| 亚洲综合一区二区精品导航| 亚洲色图19p| 国产精品毛片a∨一区二区三区| 久久伊人中文字幕| 精品久久国产字幕高潮| 精品国产91乱码一区二区三区 | av中文字幕一区| 成人黄色大片在线观看| 成人激情校园春色| 成人精品国产一区二区4080| 国产风韵犹存在线视精品| 国产一区不卡视频| 国产乱色国产精品免费视频| 国产一区二区视频在线| 国产精品一线二线三线精华| 国产精品亚洲专一区二区三区 | 国产成人精品亚洲777人妖| 久久精品国产澳门| 激情综合五月天| 国产福利91精品一区二区三区| 国产一区二区三区香蕉 | 亚洲丶国产丶欧美一区二区三区| 亚洲精品免费在线观看| 亚洲aaa精品| 久久机这里只有精品| 国产精品中文欧美| av不卡在线播放| 欧美日韩三级在线| 精品毛片乱码1区2区3区| 国产亚洲精品免费| 亚洲视频狠狠干| 日韩激情在线观看| 国产成人午夜99999| 91麻豆视频网站| 日韩欧美国产精品| 国产精品久线在线观看| 午夜精品免费在线观看| 狠狠网亚洲精品| 91免费版pro下载短视频| 欧美一区二区福利在线| 国产精品美日韩| 日韩精品福利网| www.亚洲人| 日韩写真欧美这视频| 欧美国产成人精品| 日韩不卡在线观看日韩不卡视频| 国产成人一区二区精品非洲| 欧美亚洲国产怡红院影院| 日韩精品一区二区三区视频在线观看| 国产精品无码永久免费888| 五月天中文字幕一区二区| 国产成人精品www牛牛影视| 欧美亚洲国产一区二区三区| 久久久久久97三级| 亚洲国产乱码最新视频 | 日本不卡一区二区三区 | 亚洲一区二区视频在线观看| 日韩国产欧美视频| 色8久久人人97超碰香蕉987| 欧美精品一区二区三区在线| 亚洲自拍欧美精品|