📄 双星台球厅计时收费系统view.cpp
字号:
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserNumer");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,1,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserPeopel");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,2,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserTime_1");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,4,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserTime_2");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,5,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserTimeLength");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,6,str_2);
CString str_2_1=str_2;
int m_Mark=str_2_1.Find(":",0);
CString str_2_2=str_2_1.Mid(0,m_Mark);
int m_Mark_1=atoi(str_2_2);
CString str_2_3=str_2_1.Mid(m_Mark+2,2);
int m_Mark_2=atoi(str_2_3);
CString str_2_4=str_2_1.Mid(m_Mark+1+5,2);
int m_Mark_3=atoi(str_2_4);
int m_Mark_4=(m_Mark_1*60*60)+(m_Mark_2*60)+m_Mark_3;
m_TongJiMarkCount[1]=m_TongJiMarkCount[1]+m_Mark_4;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserJiSuanFeiYong");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,7,str_2);
str_2.Replace(" 元","");
double m_k=atof(str_2);
m_TongJiMarkCount[2]=m_TongJiMarkCount[2]+m_k;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserYouHuiTime");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,8,str_2+" 分钟");
double m_200_1=atof(str_2);
m_TongJiMarkCount[5]=m_TongJiMarkCount[5]+m_200_1;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserYouHuiFeiYong");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,9,str_2+" 元");
str_2.Replace(" 元","");
double m_k=atof(str_2);
m_TongJiMarkCount[4]=m_TongJiMarkCount[4]+m_k;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserYouHuiHouFeiYong");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,10,str_2+" 元");
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserShiJiFeiYong");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,11,str_2+" 元");
str_2.Replace(" 元","");
double m_k=atof(str_2);
m_TongJiMarkCount[3]=m_TongJiMarkCount[3]+m_k;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserJiaGe");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_RecordCount,12,str_2);
}
}
}
pFrame->f_MyApp->m_pRecordset->Close();
}
catch(_com_error &e)
{
AfxMessageBox(e.ErrorMessage());
return;
}
}
if(Mark==1)
{
m_TongJiInformation.DeleteAllItems();
CString str_2;
_variant_t var;
int m_markCount=0;
for(int i=1;i<=5;i++)
{
m_TongJiMarkCount[i]=0;
}
try
{
pFrame->f_MyApp->m_pRecordset->Open("SELECT *FROM UserInformationRecondList",
pFrame->f_MyApp->m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
if(!pFrame->f_MyApp->m_pRecordset->BOF)
{
pFrame->f_MyApp->m_pRecordset->MoveFirst();
}
while(!pFrame->f_MyApp->m_pRecordset->adoEOF)
{
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserData");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
CString str_Data_1=str_2;
int m_Data_1=str_Data_1.Find("-",0);
CString str_Data_2=str_Data_1.Mid(0,m_Data_1);
CString str_Data_3=str_Data_1.Mid(m_Data_1+2,2);
CString str_Data_4=str_Data_1.Mid(m_Data_1+2+2+2,2);
CString str_Data_10[4];
m_ShowYear.GetWindowText(str_Data_10[0]);
m_ShowMonth.GetWindowText(str_Data_10[1]);
m_ShowData.GetWindowText(str_Data_10[2]);
if(str_Data_10[1]=="")
{
str_Data_10[1]=str_Data_3;
}
if(str_Data_10[2]=="")
{
str_Data_10[2]=str_Data_4;
}
BOOL m_Mark_B=FALSE;
int m_Mark_A=m_ShowYear.GetCount();
for(int i=0;i<m_Mark_A;i++)
{
m_ShowYear.SetCurSel(i);
m_ShowYear.GetWindowText(str_Data_10[3]);
if(str_Data_10[3]==str_Data_2)
{
m_Mark_B=TRUE;
}
}
if(m_Mark_B==FALSE)
{
m_ShowYear.AddString(str_Data_2);
}
m_Mark_A=m_ShowYear.GetCount();
for(i=0;i<m_Mark_A;i++)
{
m_ShowYear.SetCurSel(i);
m_ShowYear.GetWindowText(str_Data_10[3]);
if(str_Data_10[3]==str_Data_10[0])
{
break;
}
}
if((str_Data_10[0]==str_Data_2)&&(str_Data_10[1]==str_Data_3)&&(str_Data_10[2]==str_Data_4))
{
var=pFrame->f_MyApp->m_pRecordset->GetCollect("ID");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.InsertItem(m_markCount,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserData");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,3,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserNumer");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
str_2.Replace("第 ","");
str_2.Replace(" 台球桌","");
m_TongJiInformation.SetItemText(m_markCount,1,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserPeopel");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,2,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserTime_1");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,4,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserTime_2");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,5,str_2);
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserTimeLength");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,6,str_2);
CString str_2_1=str_2;
int m_Mark=str_2_1.Find(":",0);
CString str_2_2=str_2_1.Mid(0,m_Mark);
int m_Mark_1=atoi(str_2_2);
CString str_2_3=str_2_1.Mid(m_Mark+2,2);
int m_Mark_2=atoi(str_2_3);
CString str_2_4=str_2_1.Mid(m_Mark+1+5,2);
int m_Mark_3=atoi(str_2_4);
int m_Mark_4=(m_Mark_1*60*60)+(m_Mark_2*60)+m_Mark_3;
m_TongJiMarkCount[1]=m_TongJiMarkCount[1]+m_Mark_4;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserJiSuanFeiYong");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,7,str_2);
str_2.Replace(" 元","");
double m_k=atof(str_2);
m_TongJiMarkCount[2]=m_TongJiMarkCount[2]+m_k;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserYouHuiTime");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,8,str_2+" 分钟");
double m_200_1=atof(str_2);
m_TongJiMarkCount[5]=m_TongJiMarkCount[5]+m_200_1;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserYouHuiFeiYong");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,9,str_2+" 元");
str_2.Replace(" 元","");
double m_k=atof(str_2);
m_TongJiMarkCount[4]=m_TongJiMarkCount[4]+m_k;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserYouHuiHouFeiYong");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,10,str_2+" 元");
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserShiJiFeiYong");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,11,str_2+" 元");
str_2.Replace(" 元","");
double m_k=atof(str_2);
m_TongJiMarkCount[3]=m_TongJiMarkCount[3]+m_k;
}
var=pFrame->f_MyApp->m_pRecordset->GetCollect("UserJiaGe");
if(var.vt!=VT_NULL)
{
str_2=(LPCSTR)_bstr_t(var);
m_TongJiInformation.SetItemText(m_markCount,12,str_2);
}
m_markCount++;
}
}
pFrame->f_MyApp->m_pRecordset->MoveNext();
}
pFrame->f_MyApp->m_pRecordset->Close();
}
catch(_com_error &e)
{
AfxMessageBox(e.ErrorMessage());
return;
}
m_TongJiMarkCount[0]=m_markCount;
}
CString str_100;
str_100.Format("%0.0f",m_TongJiMarkCount[0]);
m_TongJi_Number.SetWindowText(str_100);
int m_Mark_100=(int)(m_TongJiMarkCount[1]);
int m_Mark_100_1=m_Mark_100/(60*60);
int m_Mark_100_2=(m_Mark_100%(60*60))/60;
int m_Mark_100_3=(m_Mark_100%(60*60))%60;
CString str_100_1,str_100_2,str_100_3;
str_100_1.Format("%d",m_Mark_100_1);
str_100_2.Format("%d",m_Mark_100_2);
str_100_3.Format("%d",m_Mark_100_3);
if(str_100_2.GetLength()==1)
{
str_100_2="0"+str_100_2;
}
if(str_100_3.GetLength()==1)
{
str_100_3="0"+str_100_3;
}
str_100=str_100_1+":"+str_100_2+":"+str_100_3;
m_TongJi_TimeLength.SetWindowText(str_100);
str_100.Format("%0.2f",m_TongJiMarkCount[2]);
m_TongJi_FeiYong.SetWindowText(str_100+" 元");
str_100.Format("%0.2f",m_TongJiMarkCount[3]);
m_TongJi_ShiJiFeiYong.SetWindowText(str_100+" 元");
str_100.Format("%0.2f",m_TongJiMarkCount[4]);
m_TongJi_YouHuiFeiYong.SetWindowText(str_100+" 元");
double m_Mark_200=m_TongJiMarkCount[5]*60;
int m_Mark_200_1=(int)m_Mark_200;
m_Mark_100_1=m_Mark_200_1/(60*60);
m_Mark_100_2=(m_Mark_200_1%(60*60))/60;
m_Mark_100_3=(m_Mark_200_1%(60*60))%60;
str_100_1.Format("%d",m_Mark_100_1);
str_100_2.Format("%d",m_Mark_100_2);
str_100_3.Format("%d",m_Mark_100_3);
if(str_100_1.GetLength()==1)
{
str_100_1="0"+str_100_1;
}
if(str_100_2.GetLength()==1)
{
str_100_2="0"+str_100_2;
}
if(str_100_3.GetLength()==1)
{
str_100_3="0"+str_100_3;
}
str_100=str_100_1+":"+str_100_2+":"+str_100_3;
m_TongJi_YouHuiTimeLength.SetWindowText(str_100);
}
void CMyView::OnSelchangeCombo_ShowYear()
{
CString str;
m_ShowYear.GetWindowText(str);
m_ShowMonth.SetCurSel(-1);
m_ShowData.SetCurSel(-1);
On_AddOldDataToListShow(1);
}
void CMyView::OnSelchangeCombo_ShowMonth()
{
m_ShowData.SetCurSel(-1);
On_AddOldDataToListShow(1);
}
void CMyView::OnSelchangeCombo_ShowData()
{
On_AddOldDataToListShow(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -