CheckOut.cpp
上传用户:czfddz
上传日期:2013-03-20
资源大小:1517k
文件大小:17k
源码类别:

酒店行业

开发平台:

C/C++

  1. // CheckOut.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "qq.h"
  5. #include "CheckOut.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CCheckOut dialog
  13. int CCheckOut::year=0;
  14. int CCheckOut::month=0;
  15. int CCheckOut::day=0;
  16. int CCheckOut::hour=0;
  17. int CCheckOut::minute=0;
  18. int CCheckOut::second=0;
  19. CString CCheckOut::STRINGS[100]={""};
  20. CCheckOut::CCheckOut(CWnd* pParent /*=NULL*/)
  21. : CDialog(CCheckOut::IDD, pParent)
  22. {
  23. //{{AFX_DATA_INIT(CCheckOut)
  24. //}}AFX_DATA_INIT
  25. }
  26. void CCheckOut::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CDialog::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CCheckOut)
  30. DDX_Control(pDX, IDC_CHECKOUT_BILLCODE, BillCode);
  31. DDX_Control(pDX, IDC_CHECKOUT_HANDCODE, HandCode);
  32. DDX_Control(pDX, IDC_CHECKOUT_CURTIME, CurTime);
  33. DDX_Control(pDX, IDC_CHECKOUT_TIMES, Times);
  34. DDX_Control(pDX, IDC_CHECKOUT_SUM, Sum);
  35. DDX_Control(pDX, IDC_CHECKOUT_SUBMONEY, SubMoney);
  36. DDX_Control(pDX, IDC_CHECKOUT_STARTTIME, StartTime);
  37. DDX_Control(pDX, IDC_CHECKOUT_PAID, Paid);
  38. //}}AFX_DATA_MAP
  39. }
  40. BEGIN_MESSAGE_MAP(CCheckOut, CDialog)
  41. //{{AFX_MSG_MAP(CCheckOut)
  42. ON_CBN_EDITCHANGE(IDC_CHECKOUT_HANDCODE, OnEditchangeCheckoutHandcode)
  43. ON_EN_CHANGE(IDC_CHECKOUT_PAID, OnChangeCheckoutPaid)
  44. ON_CBN_SELCHANGE(IDC_CHECKOUT_HANDCODE, OnSelchangeCheckoutHandcode)
  45. //}}AFX_MSG_MAP
  46. END_MESSAGE_MAP()
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CCheckOut message handlers
  49. BOOL CCheckOut::OnInitDialog() 
  50. {
  51. CDialog::OnInitDialog();
  52. HICON m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME2);
  53. this->SetIcon(m_hIcon,true);//设置对话框图标
  54. // TODO: Add extra initialization here
  55. ///安装匹配字符串
  56. InitDate();//初始化数组 
  57. m_acCombo.Init(GetDlgItem(IDC_CHECKOUT_HANDCODE));
  58. if(!m_GuestInfoSet.Open(AFX_DB_USE_DEFAULT_TYPE))
  59. {
  60. MessageBox("查询数据库失败或者数据库没有连接!",
  61.        "数据库错误",
  62.    MB_OK
  63.    );
  64. return false;
  65. }
  66. m_GuestInfoSet.MoveFirst();//move to the first record
  67. int i=0;
  68.     while(!m_GuestInfoSet.IsEOF())
  69. {
  70.         STRINGS[i]=m_GuestInfoSet.m_HandCode;
  71.         m_GuestInfoSet.MoveNext();
  72. i++;
  73. }
  74.     m_GuestInfoSet.Close();//关闭数据库
  75.     for (int j=0; (!STRINGS[j].IsEmpty()); j++)
  76. {
  77. m_acCombo.GetStringList().Add(STRINGS[j].GetBuffer(STRINGS[j].GetLength()));
  78. }
  79. //产生帐单号码
  80. CCreateBillCode billcode;
  81. BillCode.SetWindowText(billcode.GenereBillCodeForCheckOut());
  82.     Sum.SetWindowText("0");
  83. Paid.SetWindowText("0");
  84. SubMoney.SetWindowText("0");
  85.     Times.SetWindowText("0");
  86. //设置当前时间
  87.     CTime time=CTime::GetCurrentTime();//构造时间对象
  88.     CTime tm(time);
  89.     year=tm.GetYear();
  90.     month=tm.GetMonth();
  91. day=tm.GetDay();
  92. hour=tm.GetHour();
  93. minute=tm.GetMinute();
  94. second=tm.GetSecond();
  95. CString strYear,strMonth,strDay,strHour,strMinute,strSecond;
  96. strYear.Format("%d",year);
  97. strMonth.Format("%d",month);
  98. strDay.Format("%d",day);
  99. strHour.Format("%d",hour);
  100. strMinute.Format("%d",minute);
  101. strSecond.Format("%d",second);
  102. CString strShowText;
  103. strShowText=strYear+"-"+strMonth+"-"+strDay;
  104.     strShowText=strShowText+" "+strHour+":"+strMinute+":"+strSecond;
  105.     CurTime.SetWindowText(strShowText);
  106. return TRUE;  // return TRUE unless you set the focus to a control
  107.               // EXCEPTION: OCX Property Pages should return FALSE
  108. }
  109. void CCheckOut::OnSelchangeCheckoutHandcode() 
  110. {
  111. // TODO: Add your control notification handler code here
  112.     Sum.SetWindowText("0");
  113. Paid.SetWindowText("0");
  114. SubMoney.SetWindowText("0");
  115.         CString strHandCode="";
  116. HandCode.GetLBText(HandCode.GetCurSel(),strHandCode);
  117. //到数据库中查找是否存在这个记录
  118. int Startyear=0;  //得到年份
  119. int Startmonth=0; 
  120. int Startday=0;
  121. int Starthour=0;
  122. int Startmini=0;
  123. int Startsecond=0;
  124. float nRoomPrice=0.00f;//房间的价格(total)
  125. //////////////////////////////////////////////////////////////////////////
  126. /*############### 显示开始入住时间的查询过程 ##################*/
  127. if(!m_BillCheckoutInfoSet.Open())
  128. {
  129. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  130. return;
  131. }
  132. m_BillCheckoutInfoSet.MoveFirst();//移动到第一条记录
  133. while (!m_BillCheckoutInfoSet.IsEOF())
  134. {
  135. if(strHandCode==m_BillCheckoutInfoSet.m_HandCode)
  136. {//找到了这个手牌号码,将这个记录中的开始时间写道对话框中
  137. CTime strTime=m_BillCheckoutInfoSet.m_StartTime;
  138.             CString strTimeShow,strYear,strMonth,strDay,strHour,strMinute,strSecond;
  139. Startyear=strTime.GetYear();  //得到年份
  140.     Startmonth=strTime.GetMonth();
  141. Startday=strTime.GetDay();
  142. Starthour=strTime.GetHour();
  143. Startmini=strTime.GetMinute();
  144. Startsecond=strTime.GetSecond();
  145. strYear.Format("%d",Startyear);//格式化年份
  146. strMonth.Format("%d",Startmonth);
  147. strDay.Format("%d",Startday);
  148. strHour.Format("%d",Starthour);
  149. strMinute.Format("%d",Startmini);
  150. strSecond.Format("%d",Startsecond);//格式化秒
  151. strTimeShow=strYear+"-"+strMonth+"-"+strDay+" "+strHour
  152. +":"+strMinute+":"+strSecond;
  153. StartTime.SetWindowText(strTimeShow);
  154. /////////////////////////////////////////////////////////////////
  155.         //计算入住的总时间
  156.         CString strStartTime,strEndTime;
  157.         long nHours=0,nMinutes=0;
  158.         StartTime.GetWindowText(strStartTime); //得到开始入住的时间
  159.         CurTime.GetWindowText(strEndTime);//得到当前的时间
  160.         if(strStartTime=="")
  161. {
  162.                  Times.SetWindowText("");
  163. }
  164.             int dYears=0,dMonths=0,dDays=0,dMinutes=0,dHours=0,dSeconds=0;
  165.         dYears=year-Startyear;//得到年份的差值
  166.         dMonths=month-Startmonth;
  167.         dDays=day-Startday;
  168.         dHours=hour-Starthour;
  169.         dMinutes=minute-Startmini;
  170.         dSeconds=second-Startsecond;
  171.         //计算总的时间差
  172. nHours=dYears*365*24+dMonths*30*24+dDays*24+dHours;
  173.         nMinutes=dMinutes+(int)dSeconds/60;
  174.         if(nMinutes<0)
  175. {
  176.         nHours=nHours-1;
  177.         nMinutes=nMinutes+60;
  178. }
  179.         CString strHours,strMinutes;
  180.         strHours.Format("%d",nHours);
  181.         strMinutes.Format("%d",nMinutes);
  182.         CString strTimes;
  183.         strTimes=strHours+":"+strMinutes;
  184.         Times.SetWindowText(strTimes);
  185.             /*      通过手牌号码查找房间的号码      */
  186. if(!m_GuestInfoSet.Open())
  187. {
  188. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  189. return;
  190. }
  191. m_GuestInfoSet.MoveFirst();//移动到第一条记录
  192. while (!m_GuestInfoSet.IsEOF())
  193. {
  194. if(strHandCode==m_GuestInfoSet.m_HandCode)
  195. {//查找到相应的手牌号码
  196.                     CString strRoomCode;
  197. strRoomCode=m_GuestInfoSet.m_RoomCode;//得到房间号码
  198. char* s=strRoomCode.GetBuffer(strRoomCode.GetLength());
  199. char* strTokText=strtok(s,",");
  200.                     
  201. /*   通过查找得到的房间号码查看房间的价格   */
  202. while(strTokText!=NULL)
  203. {
  204.     CString strRoomCodeTok=strTokText;//得到房间号码
  205. if(!m_RoomInfoSet.Open())
  206. {//打开房间表
  207. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  208. return;
  209. }
  210. m_RoomInfoSet.MoveFirst();//移动第一条记录
  211. while(!m_RoomInfoSet.IsEOF())
  212. {
  213. if(m_RoomInfoSet.m_RoomCode==strRoomCode)
  214. {//找到了房间查看房间的价格
  215. //将当前查找到的房间价格加入到总和中
  216. nRoomPrice=nRoomPrice+m_RoomInfoSet.m_Price;
  217. }
  218. m_RoomInfoSet.MoveNext();//移动到下一条记录
  219. }
  220. m_RoomInfoSet.Close();//查询完毕关闭数据库
  221. //得到下一个房间号码
  222. strTokText=strtok(NULL,",");
  223. }
  224. }
  225. m_GuestInfoSet.MoveNext();//移动到客人的下一条记录
  226. }
  227. m_GuestInfoSet.Close();//关闭客人信息表
  228. /////////计算住房间的费用
  229. ////计算方法为:房间费用=房间的价格*住的时间
  230. float nRoomTotalPrice=0.00f;
  231. /*        
  232.           计算客人住房所用的总费用
  233. */
  234. nRoomTotalPrice=(float)(nHours+(float)nMinutes/60)*nRoomPrice;
  235. /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */
  236.  /*
  237.                    开始计算客人在酒店期间各种消费总数目
  238.  */
  239.              /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  240.              通过查找帐单来计算总的消费费用
  241.    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  242. long nSumInCast=0;//消费的总费用
  243.             if(!m_BillInfoSet.Open())
  244. {
  245. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  246. return;
  247. }
  248. m_BillInfoSet.MoveFirst();//first
  249. while (!m_BillInfoSet.IsEOF())
  250. {
  251. if(strHandCode==m_BillInfoSet.m_HandCode)
  252. {
  253. nSumInCast=nSumInCast+m_BillInfoSet.m_Sum-m_BillInfoSet.m_Paid;
  254. }
  255. m_BillInfoSet.MoveNext();//移动到下一条记录
  256. }
  257. m_BillInfoSet.Close();//关闭数据库
  258.   /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  259.   计算客人总的费用包括房间的钱和消费的钱
  260.   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  261.             CString strSum;
  262. strSum.Format("%6.00f",nSumInCast+nRoomTotalPrice);
  263. Sum.SetWindowText(strSum);
  264. /*
  265. //更新找钱窗口的数据
  266. */
  267. OnChangeCheckoutPaid();
  268. break;
  269. }
  270. else
  271. {
  272.              StartTime.SetWindowText("");
  273.              Times.SetWindowText("0");
  274.  Sum.SetWindowText("0");
  275. }
  276. m_BillCheckoutInfoSet.MoveNext();//移动到下一条记录
  277. }
  278. m_BillCheckoutInfoSet.Close();//关闭数据库
  279. /*######################    END    ############################*/
  280. }
  281. void CCheckOut::OnEditchangeCheckoutHandcode() 
  282. {
  283. // TODO: Add your control notification handler code here
  284. //清除前面的记录,重新进行计算
  285. CString strHandCode="";
  286. HandCode.GetWindowText(strHandCode);//得到当前的手牌号码
  287. //到数据库中查找是否存在这个记录
  288. int Startyear=0;  //得到年份
  289. int Startmonth=0; 
  290. int Startday=0;
  291. int Starthour=0;
  292. int Startmini=0;
  293. int Startsecond=0;
  294. float nRoomPrice=0.00f;//房间的价格(total)
  295. //////////////////////////////////////////////////////////////////////////
  296. /*############### 显示开始入住时间的查询过程 ##################*/
  297. if(!m_BillCheckoutInfoSet.Open())
  298. {
  299. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  300. return;
  301. }
  302. m_BillCheckoutInfoSet.MoveFirst();//移动到第一条记录
  303. while (!m_BillCheckoutInfoSet.IsEOF())
  304. {
  305. if(strHandCode==m_BillCheckoutInfoSet.m_HandCode)
  306. {//找到了这个手牌号码,将这个记录中的开始时间写道对话框中
  307. CTime strTime=m_BillCheckoutInfoSet.m_StartTime;
  308.             CString strTimeShow,strYear,strMonth,strDay,strHour,strMinute,strSecond;
  309. Startyear=strTime.GetYear();  //得到年份
  310.     Startmonth=strTime.GetMonth();
  311. Startday=strTime.GetDay();
  312. Starthour=strTime.GetHour();
  313. Startmini=strTime.GetMinute();
  314. Startsecond=strTime.GetSecond();
  315. strYear.Format("%d",Startyear);//格式化年份
  316. strMonth.Format("%d",Startmonth);
  317. strDay.Format("%d",Startday);
  318. strHour.Format("%d",Starthour);
  319. strMinute.Format("%d",Startmini);
  320. strSecond.Format("%d",Startsecond);//格式化秒
  321. strTimeShow=strYear+"-"+strMonth+"-"+strDay+" "+strHour
  322. +":"+strMinute+":"+strSecond;
  323. StartTime.SetWindowText(strTimeShow);
  324. /////////////////////////////////////////////////////////////////
  325.         //计算入住的总时间
  326.         CString strStartTime,strEndTime;
  327.         long nHours=0,nMinutes=0;
  328.         StartTime.GetWindowText(strStartTime); //得到开始入住的时间
  329.         CurTime.GetWindowText(strEndTime);//得到当前的时间
  330.         if(strStartTime=="")
  331. {
  332.                  Times.SetWindowText("");
  333. }
  334.             int dYears=0,dMonths=0,dDays=0,dMinutes=0,dHours=0,dSeconds=0;
  335.         dYears=year-Startyear;//得到年份的差值
  336.         dMonths=month-Startmonth;
  337.         dDays=day-Startday;
  338.         dHours=hour-Starthour;
  339.         dMinutes=minute-Startmini;
  340.         dSeconds=second-Startsecond;
  341.         //计算总的时间差
  342. nHours=dYears*365*24+dMonths*30*24+dDays*24+dHours;
  343.         nMinutes=dMinutes+(int)dSeconds/60;
  344.         if(nMinutes<0)
  345. {
  346.         nHours=nHours-1;
  347.         nMinutes=nMinutes+60;
  348. }
  349.         CString strHours,strMinutes;
  350.         strHours.Format("%d",nHours);
  351.         strMinutes.Format("%d",nMinutes);
  352.         CString strTimes;
  353.         strTimes=strHours+":"+strMinutes;
  354.         Times.SetWindowText(strTimes);
  355.             /*      通过手牌号码查找房间的号码      */
  356. if(!m_GuestInfoSet.Open())
  357. {
  358. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  359. return;
  360. }
  361. m_GuestInfoSet.MoveFirst();//移动到第一条记录
  362. while (!m_GuestInfoSet.IsEOF())
  363. {
  364. if(strHandCode==m_GuestInfoSet.m_HandCode)
  365. {//查找到相应的手牌号码
  366.                     CString strRoomCode;
  367. strRoomCode=m_GuestInfoSet.m_RoomCode;//得到房间号码
  368. char* s=strRoomCode.GetBuffer(strRoomCode.GetLength());
  369. char* strTokText=strtok(s,",");
  370.                     
  371. /*   通过查找得到的房间号码查看房间的价格   */
  372. while(strTokText!=NULL)
  373. {
  374.     CString strRoomCodeTok=strTokText;//得到房间号码
  375. if(!m_RoomInfoSet.Open())
  376. {//打开房间表
  377. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  378. return;
  379. }
  380. m_RoomInfoSet.MoveFirst();//移动第一条记录
  381. while(!m_RoomInfoSet.IsEOF())
  382. {
  383. if(m_RoomInfoSet.m_RoomCode==strRoomCode)
  384. {//找到了房间查看房间的价格
  385. //将当前查找到的房间价格加入到总和中
  386. nRoomPrice=nRoomPrice+m_RoomInfoSet.m_Price;
  387. }
  388. m_RoomInfoSet.MoveNext();//移动到下一条记录
  389. }
  390. m_RoomInfoSet.Close();//查询完毕关闭数据库
  391. //得到下一个房间号码
  392. strTokText=strtok(NULL,",");
  393. }
  394. }
  395. m_GuestInfoSet.MoveNext();//移动到客人的下一条记录
  396. }
  397. m_GuestInfoSet.Close();//关闭客人信息表
  398. /////////计算住房间的费用
  399. ////计算方法为:房间费用=房间的价格*住的时间
  400. float nRoomTotalPrice=0.00f;
  401. /*        
  402.           计算客人住房所用的总费用
  403. */
  404. nRoomTotalPrice=(float)(nHours+(float)nMinutes/60)*nRoomPrice;
  405. /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */
  406.  /*
  407.                    开始计算客人在酒店期间各种消费总数目
  408.  */
  409.              /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  410.              通过查找帐单来计算总的消费费用
  411.    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  412. long nSumInCast=0;//消费的总费用
  413.             if(!m_BillInfoSet.Open())
  414. {
  415. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  416. return;
  417. }
  418. m_BillInfoSet.MoveFirst();//first
  419. while (!m_BillInfoSet.IsEOF())
  420. {
  421. if(strHandCode==m_BillInfoSet.m_HandCode)
  422. {
  423. nSumInCast=nSumInCast+m_BillInfoSet.m_Sum-m_BillInfoSet.m_Paid;
  424. }
  425. m_BillInfoSet.MoveNext();//移动到下一条记录
  426. }
  427. m_BillInfoSet.Close();//关闭数据库
  428.   /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  429.   计算客人总的费用包括房间的钱和消费的钱
  430.   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  431.             CString strSum;
  432. strSum.Format("%6.00f",nSumInCast+nRoomTotalPrice);
  433. Sum.SetWindowText(strSum);
  434. /*
  435. //更新找钱窗口的数据
  436. */
  437. OnChangeCheckoutPaid();
  438. break;
  439. }
  440. else
  441. {
  442.              StartTime.SetWindowText("");
  443.              Times.SetWindowText("0");
  444.  Sum.SetWindowText("0");
  445. }
  446. m_BillCheckoutInfoSet.MoveNext();//移动到下一条记录
  447. }
  448. m_BillCheckoutInfoSet.Close();//关闭数据库
  449. /*######################    END    ############################*/
  450. }
  451. void CCheckOut::OnChangeCheckoutPaid() 
  452. {
  453. // TODO: If this is a RICHEDIT control, the control will not
  454. // send this notification unless you override the CDialog::OnInitDialog()
  455. // function and call CRichEditCtrl().SetEventMask()
  456. // with the ENM_CHANGE flag ORed into the mask.
  457. // TODO: Add your control notification handler code here
  458. CString strSum,strPaid;
  459. Sum.GetWindowText(strSum);
  460. Paid.GetWindowText(strPaid);
  461.     long nSum=0,nPaid=0,nSub=0;
  462. char* sSum,*sPaid;
  463. sSum=strSum.GetBuffer(strSum.GetLength());
  464. sPaid=strPaid.GetBuffer(strPaid.GetLength());
  465. nSum=atol(sSum);
  466. nPaid=atol(sPaid);
  467. nSub=nPaid-nSum;
  468. CString strSub;
  469.   strSub.Format("%ld",nSub);
  470.     SubMoney.SetWindowText(strSub);
  471. }
  472. void CCheckOut::OnOK() 
  473. {
  474. // TODO: Add extra validation here
  475. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  476.                       保存数据到数据库中
  477. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  478. CString strEndTime,strSum,strHandCode;
  479. HandCode.GetWindowText(strHandCode);//手牌号码
  480.     CurTime.GetWindowText(strEndTime);//得到当前时间,也就是结束时间
  481. Sum.GetWindowText(strSum);
  482.     
  483.     ///////将结束实际写到数据库中
  484. if(!m_BillCheckoutInfoSet.Open())
  485. {
  486. MessageBox("打开数据库失败!","数据库错误",MB_OK);
  487. return;
  488. }
  489. m_BillCheckoutInfoSet.MoveFirst();
  490. while (!m_BillCheckoutInfoSet.IsEOF())
  491. {
  492. if(strHandCode==m_BillCheckoutInfoSet.m_HandCode)
  493. {
  494. if(!m_BillCheckoutInfoSet.m_Sum.IsEmpty())
  495. {//已经写了这个记录
  496. MessageBox("该客户已经结帐了!","结帐错误",MB_OK);
  497. m_BillCheckoutInfoSet.Close();//关闭数据库停止查找
  498. return;
  499. }
  500. else
  501. {
  502. CTime tm(year,month,day,hour,minute,second);
  503. m_BillCheckoutInfoSet.Edit();
  504. m_BillCheckoutInfoSet.m_EndTime=tm;
  505. m_BillCheckoutInfoSet.m_Sum=strSum;
  506.     m_BillCheckoutInfoSet.Update();
  507. }
  508. }
  509. m_BillCheckoutInfoSet.MoveNext();
  510. }
  511. m_BillCheckoutInfoSet.Close();
  512. InitDate();//初始化数组
  513. CDialog::OnOK();
  514. }
  515. void CCheckOut::InitDate()
  516. {
  517. for(int i=0;i<100;i++)
  518. {
  519. STRINGS[i]="";
  520. }
  521. }
  522. void CCheckOut::OnCancel() 
  523. {
  524. // TODO: Add extra cleanup here
  525. CDialog::OnCancel();
  526. }