📄 queryview.cpp
字号:
UINT m_sjdata[3] = {0,0,0};
UINT m_data[3] = {0,0,0};
UINT m_sjCount[2] = {0,0};
UINT m_Count[2] = {0,0};
CStringArray m_strsjarry;
CStringArray m_strarry;
CByteArray m_bsjarry,m_barry;
///////////////////////////////////////////////////////////////
fjstrParam(myotherstate.strsjhan,' ',m_strsjarry);
for(int i=0;i<m_strsjarry.GetSize();i++)
m_sjdata[i] = atoi(m_strsjarry.GetAt(i));
fjstrParam(myotherstate.strhan,' ',m_strarry);
for(i=0;i<m_strarry.GetSize();i++)
m_data[i] = atoi(m_strarry.GetAt(i));
//所含号码个数nCount
int nsjCount = m_strsjarry.GetSize();
int nCount = m_strarry.GetSize();
/////////////////////////////////////////////////////////
//号码和值
int ncountsjvalue = 0;
int ncountvalue = 0;
////////////////////////////////////////////////////////////
fjstrParam(myotherstate.strsjCount ,' ' ,m_strsjarry);
if(m_strsjarry.GetSize()<2)
m_sjCount[0] = m_sjCount[1] = atoi(m_strsjarry[0]);
else
{
m_sjCount[0] = atoi(m_strsjarry[0]);
m_sjCount[1] = atoi(m_strsjarry[1]);
}
fjstrParam(myotherstate.strCount ,' ' ,m_strarry);
if(m_strarry.GetSize()<2)
m_Count[0] = m_Count[1] = atoi(m_strarry[0]);
else
{
m_Count[0] = atoi(m_strarry[0]);
m_Count[1] = atoi(m_strarry[1]);
}
/////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
L3DDATAOTHER myl3Ddataother;
bool bstate = 0;
CString strtmp = "";
//////////////////////////////////////////////////////////////////////////////////
//以下开始判定具体的条件
while(!m_visit.m_p3dotherSet->IsEOF())
{
bstate = (myotherstate.bstartno == 0) && (myotherstate.bJiNo == 0) && (myotherstate.bQiuNo == 0) && (myotherstate.bsjhan == 0) && \
(myotherstate.bhan == 0) && (myotherstate.bsjCount == 0) &&(myotherstate.bCount == 0) && \
(myotherstate.bsjsametail == 0) && (myotherstate.bsametail == 0) && (myotherstate.bsj[0] == 0) && (myotherstate.bsj[1] == 0)\
&& (myotherstate.bsj[2] == 0) && (myotherstate.bsjds == 0) && (myotherstate.b[0] == 0) && (myotherstate.b[1] == 0 ) && \
(myotherstate.b[2] == 0) && (myotherstate.bds == 0);
if(bstate) //所有条件全部不选择
{
myl3Ddataother.uItemNo = m_visit.m_p3dotherSet->m_ItemNo;
myl3Ddataother.uJNo = m_visit.m_p3dotherSet->m_iJiNo;
myl3Ddataother.uQNo = m_visit.m_p3dotherSet->m_iQiuNo;
myl3Ddataother.strsjbsg = m_visit.m_p3dotherSet->m_iSJHAO;
myl3Ddataother.strbsg = m_visit.m_p3dotherSet->m_iSCHAO;
myl3Ddataother.uSJBNo = m_visit.m_p3dotherSet->m_iSJBNo;
myl3Ddataother.uSJSNo = m_visit.m_p3dotherSet->m_iSJSNo;
myl3Ddataother.uSJGNo = m_visit.m_p3dotherSet->m_iSJGNo;
myl3Ddataother.uBNo = m_visit.m_p3dotherSet->m_iBNo;
myl3Ddataother.uSNo = m_visit.m_p3dotherSet->m_iSNo;
myl3Ddataother.uGNo = m_visit.m_p3dotherSet->m_iGNo;
myl3Ddataother.uSJCount = m_visit.m_p3dotherSet->m_iSJCount;;
myl3Ddataother.uCountValue = m_visit.m_p3dotherSet->m_iCount;;
my3dotherarray.Add(myl3Ddataother);
}
bstate = (myotherstate.bstartno == 0) && (myotherstate.bJiNo == 1) && (myotherstate.bQiuNo == 1) && (myotherstate.bsjhan == 0) && \
(myotherstate.bhan == 0) && (myotherstate.bsjCount == 0) &&(myotherstate.bCount == 0) && \
(myotherstate.bsjsametail == 0) && (myotherstate.bsametail == 0) && (myotherstate.bsj[0] == 0) && (myotherstate.bsj[1] == 0)\
&& (myotherstate.bsj[2] == 0) && (myotherstate.bsjds == 0) && (myotherstate.b[0] == 0) && (myotherstate.b[1] == 0 ) && \
(myotherstate.b[2] == 0) && (myotherstate.bds == 0);
if(bstate) //仅选择机号和球号
{
strtmp = "";
UINT uj=0,uq=0;
((CEdit*)GetDlgItem(IDC_EDIT11))->GetWindowText(strtmp);
uj = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDIT12))->GetWindowText(strtmp);
uq = atoi(strtmp);
if((m_visit.m_p3dotherSet->m_iJiNo == uj) && (m_visit.m_p3dotherSet->m_iQiuNo == uq)) //找到符合机号和球号的记录
{
myl3Ddataother.uItemNo = m_visit.m_p3dotherSet->m_ItemNo;
myl3Ddataother.uJNo = m_visit.m_p3dotherSet->m_iJiNo;
myl3Ddataother.uQNo = m_visit.m_p3dotherSet->m_iQiuNo;
myl3Ddataother.strsjbsg = m_visit.m_p3dotherSet->m_iSJHAO;
myl3Ddataother.strbsg = m_visit.m_p3dotherSet->m_iSCHAO;
myl3Ddataother.uSJBNo = m_visit.m_p3dotherSet->m_iSJBNo;
myl3Ddataother.uSJSNo = m_visit.m_p3dotherSet->m_iSJSNo;
myl3Ddataother.uSJGNo = m_visit.m_p3dotherSet->m_iSJGNo;
myl3Ddataother.uBNo = m_visit.m_p3dotherSet->m_iBNo;
myl3Ddataother.uSNo = m_visit.m_p3dotherSet->m_iSNo;
myl3Ddataother.uGNo = m_visit.m_p3dotherSet->m_iGNo;
myl3Ddataother.uSJCount = m_visit.m_p3dotherSet->m_iSJCount;
myl3Ddataother.uCountValue = m_visit.m_p3dotherSet->m_iCount;
my3dotherarray.Add(myl3Ddataother);
}
}
bstate = (myotherstate.bstartno == 0) && (myotherstate.bJiNo == 1) && (myotherstate.bQiuNo == 1) && (myotherstate.bsjhan == 1) && \
(myotherstate.bhan == 0) && (myotherstate.bsjCount == 0) &&(myotherstate.bCount == 0) && \
(myotherstate.bsjsametail == 0) && (myotherstate.bsametail == 0) && (myotherstate.bsj[0] == 0) && (myotherstate.bsj[1] == 0)\
&& (myotherstate.bsj[2] == 0) && (myotherstate.bsjds == 0) && (myotherstate.b[0] == 0) && (myotherstate.b[1] == 0 ) && \
(myotherstate.b[2] == 0) && (myotherstate.bds == 0);
if(bstate) //选择机号和球号,选择试机号所含号码,查询方式:直选
{
strtmp = "";
UINT uj=0,uq=0;
((CEdit*)GetDlgItem(IDC_EDIT11))->GetWindowText(strtmp);
uj = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDIT12))->GetWindowText(strtmp);
uq = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDIT13))->GetWindowText(myotherstate.strsjhan);
int nlen = fjstrtoUint(myotherstate.strsjhan,' ',m_bsjarry);
m_sjdata[0] = m_visit.m_p3dotherSet->m_iSJBNo;
m_sjdata[1] = m_visit.m_p3dotherSet->m_iSJSNo;
m_sjdata[2] = m_visit.m_p3dotherSet->m_iSJGNo;
if((FindSame(m_sjdata,m_bsjarry) == nlen) && (m_visit.m_p3dotherSet->m_iJiNo == uj) && (m_visit.m_p3dotherSet->m_iQiuNo == uq)) //找到符合机号和球号的记录
{
myl3Ddataother.uItemNo = m_visit.m_p3dotherSet->m_ItemNo;
myl3Ddataother.uJNo = m_visit.m_p3dotherSet->m_iJiNo;
myl3Ddataother.uQNo = m_visit.m_p3dotherSet->m_iQiuNo;
myl3Ddataother.strsjbsg = m_visit.m_p3dotherSet->m_iSJHAO;
myl3Ddataother.strbsg = m_visit.m_p3dotherSet->m_iSCHAO;
myl3Ddataother.uSJBNo = m_visit.m_p3dotherSet->m_iSJBNo;
myl3Ddataother.uSJSNo = m_visit.m_p3dotherSet->m_iSJSNo;
myl3Ddataother.uSJGNo = m_visit.m_p3dotherSet->m_iSJGNo;
myl3Ddataother.uBNo = m_visit.m_p3dotherSet->m_iBNo;
myl3Ddataother.uSNo = m_visit.m_p3dotherSet->m_iSNo;
myl3Ddataother.uGNo = m_visit.m_p3dotherSet->m_iGNo;
myl3Ddataother.uSJCount = m_visit.m_p3dotherSet->m_iSJCount;;
myl3Ddataother.uCountValue = m_visit.m_p3dotherSet->m_iCount;;
my3dotherarray.Add(myl3Ddataother);
}
}
bstate = (myotherstate.bstartno == 0) && (myotherstate.bJiNo == 1) && (myotherstate.bQiuNo == 1) && (myotherstate.bsjhan == 0) && \
(myotherstate.bhan == 0) && (myotherstate.bsjCount == 1) &&(myotherstate.bCount == 0) && \
(myotherstate.bsjsametail == 0) && (myotherstate.bsametail == 0) && (myotherstate.bsj[0] == 0) && (myotherstate.bsj[1] == 0)\
&& (myotherstate.bsj[2] == 0) && (myotherstate.bsjds == 0) && (myotherstate.b[0] == 0) && (myotherstate.b[1] == 0 ) && \
(myotherstate.b[2] == 0) && (myotherstate.bds == 0);
if(bstate) //选择机号和球号,选择试机号号码和值区域
{
strtmp = "";
UINT uj=0,uq=0;
((CEdit*)GetDlgItem(IDC_EDIT11))->GetWindowText(strtmp);
uj = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDIT12))->GetWindowText(strtmp);
uq = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDIT15))->GetWindowText(myotherstate.strsjCount);
fjstrParam(myotherstate.strsjCount ,' ' ,m_strsjarry);
if(m_strsjarry.GetSize()<2)
m_sjCount[0] = m_sjCount[1] = atoi(m_strsjarry[0]);
else
{
m_sjCount[0] = atoi(m_strsjarry[0]);
m_sjCount[1] = atoi(m_strsjarry[1]);
}
if((m_visit.m_p3dotherSet->m_iSJCount >= m_sjCount[0]) && (m_visit.m_p3dotherSet->m_iSJCount <= m_sjCount[1]) \
&& (m_visit.m_p3dotherSet->m_iJiNo == uj) && (m_visit.m_p3dotherSet->m_iQiuNo == uq)) //找到符合机号和球号,符合试机和值区域的记录
{
myl3Ddataother.uItemNo = m_visit.m_p3dotherSet->m_ItemNo;
myl3Ddataother.uJNo = m_visit.m_p3dotherSet->m_iJiNo;
myl3Ddataother.uQNo = m_visit.m_p3dotherSet->m_iQiuNo;
myl3Ddataother.strsjbsg = m_visit.m_p3dotherSet->m_iSJHAO;
myl3Ddataother.strbsg = m_visit.m_p3dotherSet->m_iSCHAO;
myl3Ddataother.uSJBNo = m_visit.m_p3dotherSet->m_iSJBNo;
myl3Ddataother.uSJSNo = m_visit.m_p3dotherSet->m_iSJSNo;
myl3Ddataother.uSJGNo = m_visit.m_p3dotherSet->m_iSJGNo;
myl3Ddataother.uBNo = m_visit.m_p3dotherSet->m_iBNo;
myl3Ddataother.uSNo = m_visit.m_p3dotherSet->m_iSNo;
myl3Ddataother.uGNo = m_visit.m_p3dotherSet->m_iGNo;
myl3Ddataother.uSJCount = m_visit.m_p3dotherSet->m_iSJCount;;
myl3Ddataother.uCountValue = m_visit.m_p3dotherSet->m_iCount;;
my3dotherarray.Add(myl3Ddataother);
}
}
bstate = (myotherstate.bstartno == 0) && (myotherstate.bJiNo == 1) && (myotherstate.bQiuNo == 1) && (myotherstate.bsjhan == 0) && \
(myotherstate.bhan == 1) && (myotherstate.bsjCount == 0) &&(myotherstate.bCount == 0) && \
(myotherstate.bsjsametail == 0) && (myotherstate.bsametail == 0) && (myotherstate.bsj[0] == 0) && (myotherstate.bsj[1] == 0)\
&& (myotherstate.bsj[2] == 0) && (myotherstate.bsjds == 0) && (myotherstate.b[0] == 0) && (myotherstate.b[1] == 0 ) && \
(myotherstate.b[2] == 0) && (myotherstate.bds == 0);
if(bstate) //选择机号和球号,选择实际号所含号码
{
strtmp = "";
UINT uj=0,uq=0;
((CEdit*)GetDlgItem(IDC_EDIT11))->GetWindowText(strtmp);
uj = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDIT12))->GetWindowText(strtmp);
uq = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDIT14))->GetWindowText(myotherstate.strhan);
int nlen = fjstrtoUint(myotherstate.strhan,' ',m_barry);
m_data[0] = m_visit.m_p3dotherSet->m_iBNo;
m_data[1] = m_visit.m_p3dotherSet->m_iSNo;
m_data[2] = m_visit.m_p3dotherSet->m_iGNo;
if((FindSame(m_data,m_barry) == nlen) && (m_visit.m_p3dotherSet->m_iJiNo == uj) && (m_visit.m_p3dotherSet->m_iQiuNo == uq)) //找到符合机号和球号的记录
{
myl3Ddataother.uItemNo = m_visit.m_p3dotherSet->m_ItemNo;
myl3Ddataother.uJNo = m_visit.m_p3dotherSet->m_iJiNo;
myl3Ddataother.uQNo = m_visit.m_p3dotherSet->m_iQiuNo;
myl3Ddataother.strsjbsg = m_visit.m_p3dotherSet->m_iSJHAO;
myl3Ddataother.strbsg = m_visit.m_p3dotherSet->m_iSCHAO;
myl3Ddataother.uSJBNo = m_visit.m_p3dotherSet->m_iSJBNo;
myl3Ddataother.uSJSNo = m_visit.m_p3dotherSet->m_iSJSNo;
myl3Ddataother.uSJGNo = m_visit.m_p3dotherSet->m_iSJGNo;
myl3Ddataother.uBNo = m_visit.m_p3dotherSet->m_iBNo;
myl3Ddataother.uSNo = m_visit.m_p3dotherSet->m_iSNo;
myl3Ddataother.uGNo = m_visit.m_p3dotherSet->m_iGNo;
myl3Ddataother.uSJCount = m_visit.m_p3dotherSet->m_iSJCount;;
myl3Ddataother.uCountValue = m_visit.m_p3dotherSet->m_iCount;;
my3dotherarray.Add(myl3Ddataother);
}
}
//////////////////////////////////////////////////////
//其他还有一些条件暂时先不考虑
m_visit.m_p3dotherSet->MoveNext();
}
if(((CButton*)GetDlgItem(IDC_RADIO3))->GetCheck() == 1)
((CButton*)GetDlgItem(IDC_RADIO3))->SetCheck(1);
if(((CButton*)GetDlgItem(IDC_RADIO2))->GetCheck() == 1)
((CButton*)GetDlgItem(IDC_RADIO2))->SetCheck(1);
if(((CButton*)GetDlgItem(IDC_RADIO1))->GetCheck() == 1)
((CButton*)GetDlgItem(IDC_RADIO1))->SetCheck(1);
m_visit.OnClose3DOther();
}
//根据所给定的所有条件进行查询,最终结果存放在m_bqarray中
void CQueryView::QueryAllBq(BQSTATE mybqstate,L3DBQARRAY& m_bqarray)
{
m_bqarray.RemoveAll();
m_visit.OnInit3DBq();
UINT m_sjdata[3] = {0,0,0};
UINT m_data[3] = {0,0,0};
UINT m_sjCount[2] = {0,0};
UINT m_Count[2] = {0,0};
CStringArray m_strsjarry;
CStringArray m_strarry;
CByteArray m_bsjarry,m_barry;
///////////////////////////////////////////////////////////////
fjstrParam(myotherstate.strsjhan,' ',m_strsjarry);
for(int i=0;i<m_strsjarry.GetSize();i++)
m_sjdata[i] = atoi(m_strsjarry.GetAt(i));
fjstrParam(myotherstate.strhan,' ',m_strarry);
for(i=0;i<m_strarry.GetSize();i++)
m_data[i] = atoi(m_strarry.GetAt(i));
//所含号码个数nCount
int nsjCount = m_strsjarry.GetSize();
int nCount = m_strarry.GetSize();
/////////////////////////////////////////////////////////
//号码和值
int ncountsjvalue = 0;
int ncountvalue = 0;
L3DBQDATA my3dbqdata;
bool bstate = 0;
CString strtmp = "";
while(!m_visit.m_p3dbqSet->IsEOF())
{
bstate = (mybqstate.bstartno == 0) && (mybqstate.bJiNo == 0 ) && (mybqstate.bQiuNo == 0) && (mybqstate.bsjhan == 0) && \
(mybqstate.bhan == 0) && (mybqstate.bsjCount == 0) &&(mybqstate.bCount == 0) && \
(mybqstate.bsjsametail == 0) && (mybqstate.bsametail == 0) ;
if(bstate) //所有条件全部不选择
{
my3dbqdata.uItemNo = m_visit.m_p3dbqSet->m_ItemNo;
my3dbqdata.uJNo = m_visit.m_p3dbqSet->m_iJiNo;
my3dbqdata.uQNo = m_visit.m_p3dbqSet->m_iQiuNo;
my3dbqdata.strsjbsg = m_visit.m_p3dbqSet->m_iSJHAO;
my3dbqdata.strbsg = m_visit.m_p3dbqSet->m_iSCHAO;
///////////////////////////////////////////////
strtmp = m_visit.m_p3dbqSet->m_iSJHAO.GetAt(0);
my3dbqdata.usjB = atoi(strtmp);
strtmp = m_visit.m_p3dbqSet->m_iSJHAO.GetAt(1);
my3dbqdata.usjS = atoi(strtmp);
strtmp = m_visit.m_p3dbqSet->m_iSJHAO.GetAt(2);
my3dbqdata.usjG = atoi(strtmp);
strtmp = m_visit.m_p3dbqSet->m_iSCHAO.GetAt(0);
my3dbqdata.uB = atoi(strtmp);
strtmp = m_visit.m_p3dbqSet->m_iSCHAO.GetAt(1);
my3dbqdata.uS = atoi(strtmp);
strtmp = m_visit.m_p3dbqSet->m_iSCHAO.GetAt(2);
my3dbqdata.uG = atoi(strtmp);
for(int i=0;i<10;i++)
{
strtmp = m_visit.m_p3dbqSet->m_strsjB.GetAt(i);
my3dbqdata.uSJBNo[i] = atoi(strtmp);
strtmp = m_visit.m_p3dbqSet->m_strsjS.GetAt(i);
my3dbqdata.uSJSNo[i] = atoi(strtmp);
strtmp = m_visit.m_p3dbqSet->m_strsjG.GetAt(i);
my3dbqdata.uSJGNo[i] = atoi(strtmp);
}
my3dbqdata.uSJCount = my3dbqdata.usjB +my3dbqdata.usjS +my3dbqdata.usjG;
my3dbqdata.uCountValue = my3dbqdata.uB + my3dbqdata.uS + my3dbqdata.uG;;
m_bqarray.Add(my3dbqdata);
}
m_visit.m_p3dbqSet->MoveNext();
}
m_visit.OnClose3DBq();
}
void CQueryView::OnQuery3dbq()
{
// TODO: Add your control notification handler code here
//检查和获取各个选择项的状态及取值
mybqstate.bstartno = ((CButton*)GetDlgItem(IDC_CHECKBQ1))->GetState();
mybqstate.bJiNo = ((CButton*)GetDlgItem(IDC_EDITBQ1))->GetState();
mybqstate.bQiuNo = ((CButton*)GetDlgItem(IDC_EDITBQ2))->GetState();
mybqstate.bsjhan = ((CButton*)GetDlgItem(IDC_EDITBQ3))->GetState();
mybqstate.bhan = ((CButton*)GetDlgItem(IDC_EDITBQ4))->GetState();
mybqstate.bsjCount = ((CButton*)GetDlgItem(IDC_EDITBQ5))->GetState();
mybqstate.bCount = ((CButton*)GetDlgItem(IDC_EDITBQ6))->GetState();
mybqstate.bsjsametail = ((CButton*)GetDlgItem(IDC_EDITBQ7))->GetState();
mybqstate.bsametail = ((CButton*)GetDlgItem(IDC_EDITBQ8))->GetState();
CString strtmp = "";
// int index = ((CComboBox*)GetDlgItem(IDC_START))->GetCurSel();
// ((CComboBox*)GetDlgItem(IDC_START))->GetLBText( index, strtmp);
// mystate.ustartNo = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDITBQ1))->GetWindowText(strtmp);
mybqstate.uJiNo = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDITBQ1))->GetWindowText(strtmp);
mybqstate.uQiuNo = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDITBQ2))->GetWindowText(mybqstate.strsjhan);
((CEdit*)GetDlgItem(IDC_EDITBQ3))->GetWindowText(mybqstate.strhan);
((CEdit*)GetDlgItem(IDC_EDITBQ4))->GetWindowText(mybqstate.strsjCount);
((CEdit*)GetDlgItem(IDC_EDITBQ5))->GetWindowText(mybqstate.strCount);
((CEdit*)GetDlgItem(IDC_EDITBQ6))->GetWindowText(strtmp);
mybqstate.usjsametail = atoi(strtmp);
((CEdit*)GetDlgItem(IDC_EDITBQ7))->GetWindowText(strtmp);
mybqstate.usametail = atoi(strtmp);
QueryAllBq(mybqstate,my3dbqarray);
//将查询到的结果送到历史数据视
CMainFrame* pmain = (CMainFrame*)AfxGetMainWnd();
HWND m_hwnd;
m_hwnd = (pmain->m_Framework.Get(6))->GetSafeWnd()->m_hWnd;
::PostMessage(m_hwnd,WM_DISPDATA,(WPARAM)&my3dbqarray,0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -