void CItemCommerceSearchView::OnBnClickedButtonPrintconfigure() { // TODO: 在此添加控件通知处理程序代码 UpdateData(TRUE); CDisplayConfigureDlg m_dlg; m_iCheck = 2; m_dlg.m_iCheck = m_iCheck; int InitRet; InitRet = m_dlg.DoModal(); switch(InitRet) { case -1: MessageBox("对话框创建失败!","Client Error:", MB_OK); return; break; case IDCANCEL: return; break; case IDOK: LoadDisplay(); if(m_bSearch) OnBnClickedOk(); break; default: break; } UpdateData(FALSE); }
void OutCntCanMonExt(void) { SaveDisplay(); sprintf(szHi,"—четчики: %02u-%02u",bInBuff6+1,bInBuff7+1); Clear(); if ((bInBuff6 < bCANALS) && (bInBuff7 < 12)) { InitPushPtr(); if (GetDigitalPhone(bInBuff6) != 0) { PushChar(3); PushChar(0xFF); PushChar(0xFF); PushChar(0xFF); PushChar(0xFF); } else if (mpboEnblCan[bInBuff6] == false) { PushChar(2); PushChar(0xFF); PushChar(0xFF); PushChar(0xFF); PushChar(0xFF); } else { uchar p = ibPort; double2 db2 = ReadCntMonCan(bInBuff7,bInBuff6); ibPort = p; if (db2.fValid == false) { PushChar(1); PushChar(0xFF); PushChar(0xFF); PushChar(0xFF); PushChar(0xFF); } else { PushChar(0); PushFloat(db2.dbValue); } } OutptrOutBuff(1+sizeof(float)); } else Result(bRES_BADADDRESS); LoadDisplay(); NextPause(); // внимание ! }
void CItemCommerceSearchView::OnBnClickedCancel() { // TODO: 在此添加控件通知处理程序代码 UpdateData(TRUE); LoadData(); LoadDisplay(); m_iTotalCount = 0; m_bSearch = FALSE; if(m_pResult->State == adStateOpen) m_pResult->Close(); UpdateData(FALSE); }
// требует установки diCurr bool SafeDisconnect(void) { #ifdef FLOW CloseFlow(); #endif SaveDisplay(); bool fAlt = Disconnect(); LoadDisplay(); // QueResult(bRES_DISCONNECT, (uchar)fAlt); // ResetAllSerial(); return(fAlt); }
BOOL CSchemaMember::LoadDescriptor(CXMLElement* pXML) { CString strSearch = pXML->GetAttributeValue( _T("search") ); if ( strSearch.CompareNoCase( _T("generic") ) == 0 ) { m_bIndexed = TRUE; m_bSearched = TRUE; } else if ( strSearch.CompareNoCase( _T("indexed") ) == 0 ) { m_bIndexed = TRUE; } CString strTitle = m_sTitle; m_sTitle.Empty(); for ( POSITION pos = pXML->GetElementIterator() ; pos ; ) { CXMLElement* pElement = pXML->GetNextElement( pos ); if ( pElement->IsNamed( _T("display") ) ) { LoadDisplay( pElement ); } else if ( pElement->IsNamed( _T("title") ) ) { if ( pElement->GetAttributeValue( _T("language") ). CompareNoCase( Settings.General.Language ) == 0 ) { m_sTitle = pElement->GetValue(); } else if ( m_sTitle.IsEmpty() ) { m_sTitle = pElement->GetValue(); } } else if ( pElement->IsNamed( _T("link") ) ) { m_sLinkURI = pElement->GetAttributeValue( _T("location") ); m_sLinkName = pElement->GetAttributeValue( _T("remote") ); } } if ( m_sTitle.IsEmpty() ) m_sTitle = strTitle; return TRUE; }
// требует установки diCurr bool BreakConnect(void) { bool fAlt = ((diLast.ibPort != diCurr.ibPort) || (diLast.ibPhone != diCurr.ibPhone)); if (fAlt == 1) { SaveDisplay(); ShowPort(diCurr.ibPort); ShowLo(szBreakConnect); DelayInf(); LoadDisplay(); } // QueResult(bRES_BREAKCONNECT, (uchar)fAlt); return(fAlt); }
void CItemCommerceSearchView::OnInitialUpdate() { CFormView::OnInitialUpdate(); // TODO: 在此添加专用代码和/或调用基类 GetParentFrame()->RecalcLayout(); // ResizeParentToFit(); ResizeParentToFit(FALSE); ResizeParentToFit(TRUE); // TODO: 在此添加专用代码和/或调用基类 CString strTitle ; strTitle = "商务查询"; GetParentFrame()->SetWindowText(strTitle); UpdateData(TRUE); try { m_pTempSet.CreateInstance(__uuidof(Recordset)); m_pResult.CreateInstance(__uuidof(Recordset)); } catch(_com_error &e)///捕捉异常 { CString errormessage; errormessage.Format("连接数据库失败!\r\n错误信息:%s",e.ErrorMessage()); AfxMessageBox(errormessage);///显示错误信息 return; } catch(...) { AfxMessageBox("未知错误..."); return; } m_cSearchCase.SetEditable(m_bEdit); m_cSearchCase.GetDefaultCell(FALSE, FALSE)->SetBackClr(RGB(0xFF, 0xFF, 0xE0)); m_cDisplay.SetEditable(m_bEdit); m_cDisplay.GetDefaultCell(FALSE,FALSE)->SetBackClr(RGB(0xFF, 0xFF, 0xE0)); try { m_cSearchCase.SetColumnCount(6); m_cSearchCase.SetRowCount(1); m_cSearchCase.SetFixedRowCount(1); m_cSearchCase.SetFixedColumnCount(1); } catch (CMemoryException* e) { e->ReportError(); e->Delete(); return; } GV_ITEM Item; // Item.mask = GVIF_TEXT; Item.mask = GVIF_TEXT|GVIF_FORMAT|GVL_BOTH|GVL_VERT ; Item.row = 0; Item.col =0; Item.nFormat = DT_CENTER|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS; m_cSearchCase.SetAutoSizeStyle(); m_cSearchCase.SetRowHeight(0,30); m_cSearchCase.SetColumnWidth(0,40); m_cSearchCase.SetColumnWidth(5,40); for (int i=0;i<6;i++) { if(i>1&& i!=5) m_cSearchCase.SetColumnWidth(i,100); Item.row=0; Item.col=i; switch(i) { case 0: Item.strText.Format(_T("序号")); break; case 1: Item.strText.Format(_T("查询条件")); break; case 2: Item.strText.Format(_T(">=")); break; case 3: Item.strText.Format(_T("<=")); break; case 4: Item.strText.Format(_T("=")); break; case 5: Item.strText.Format(_T("判断")); break; default: break; } m_cSearchCase.SetItem(&Item); } LoadData(); LoadDisplay(); ((CButton*)GetDlgItem(IDC_RADIO_INNER))->SetCheck(TRUE); ((CButton*)GetDlgItem(IDC_RADIO_OUTER))->SetCheck(FALSE); UpdateData(FALSE); }
bool ResetFlash(void) { uint i; ShowHi(szFlashErase); wPage = 0; ibSoftDay = 0; ibSoftMon = 0; // TODO uint m; for (m=0; m<bMINUTES; m++) { if (FreeImpMnt(m) == false) return false; ShowFlashErase(); } uint wPageOut; for (wPageOut=IMPHOUCAN; wPageOut<(IMPHOUCAN+IMPHOUCAN_PAGES); wPageOut++) { if (SafePageErase(wPageOut) == false) return false; if (GetFlashStatus() != 0) return false; ShowFlashErase(); } memset(&mpimDayCan, 0, sizeof(mpimDayCan)); for (i=0; i<bDAYS; i++) { if (SaveImpDay(0,i,ibSoftDay) == false) return false; if (GetFlashStatus() != 0) return false; ShowFlashErase(); } memset(&mpimMonCan, 0, sizeof(mpimMonCan)); for (i=0; i<bMONTHS; i++) { if (SaveImpMon(0,i,ibSoftMon) == false) return false; if (GetFlashStatus() != 0) return false; ShowFlashErase(); } memset(&mppoDayGrp, 0, sizeof(mppoDayGrp)); for (i=0; i<bDAYS; i++) { if (SavePowDay(0,i,ibSoftDay) == false) return false; if (GetFlashStatus() != 0) return false; ShowFlashErase(); } memset(&mppoMonGrp, 0, sizeof(mppoMonGrp)); for (i=0; i<bMONTHS; i++) { if (SavePowMon(0,i,ibSoftMon) == false) return false; if (GetFlashStatus() != 0) return false; ShowFlashErase(); } memset(&mpdbCntMonCan, 0, sizeof(mpdbCntMonCan)); for (i=0; i<bMONTHS; i++) { if (SaveCntMon(0,i,ibSoftMon) == false) return false; if (GetFlashStatus() != 0) return false; ShowFlashErase(); } for (wPageOut=PARAMS_VALUES; wPageOut<(PARAMS_VALUES+PARAMS_PAGES*wTIMES); wPageOut++) { if (SafePageErase(wPageOut) == false) return false; if (GetFlashStatus() != 0) return false; ShowFlashErase(); } for (wPageOut=KEY_RECORD; wPageOut<(KEY_RECORD+bRECORD_PAGES*6+wRECORD2_PAGES*1); wPageOut++) { if (SafePageErase(wPageOut) == false) return false; if (GetFlashStatus() != 0) return false; ShowFlashErase(); } if (CleanImpHouBuff() == false) return false; if (CleanImpDayBuff() == false) return false; if (CleanImpMonBuff() == false) return false; if (CleanImpAbsBuff() == false) return false; if (CleanPowDayBuff() == false) return false; if (CleanPowMonBuff() == false) return false; if (CleanCntMonBuff() == false) return false; if (ClearDiagram() == false) return false; ShowHi(szFlashRead); wPage = 0; bool f = true; uint wPageIn; for (wPageIn=FLASH_BEGIN; wPageIn<FLASH_END; wPageIn++) { if (SafePageRead(wPageIn) == false) return false; if (GetFlashChecksum() == 0) { SaveDisplay(); ShowHi(szErrorCrc); Clear(); sprintf(szLo+1,"страница: %u",wPageIn); Beep(); DelayMsg(); LoadDisplay(); f = false; } ShowFlashRead(); } return f; }