123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- // PayOutSet.cpp : implementation file
- //
- #include "stdafx.h"
- #include "LYFZIPManage.h"
- #include "PayOutSet.h"
- #include "mysqldata.h"
- #include "InputPsw.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // PayOutSet dialog
- PayOutSet::PayOutSet(CWnd* pParent /*=NULL*/)
- : CDialog(PayOutSet::IDD, pParent)
- {
- //{{AFX_DATA_INIT(PayOutSet)
- m_edit1 = _T("");
- //}}AFX_DATA_INIT
- }
- void PayOutSet::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(PayOutSet)
- DDX_Control(pDX, IDC_LIST1, m_List1);
- DDX_Text(pDX, IDC_EDIT1, m_edit1);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(PayOutSet, CDialog)
- //{{AFX_MSG_MAP(PayOutSet)
- ON_BN_CLICKED(IDC_BUTadd, OnBUTadd)
- ON_BN_CLICKED(IDC_BUTdel, OnBUTdel)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // PayOutSet message handlers
- BOOL PayOutSet::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- CRect rc;
- m_List1.GetClientRect (rc);
- CString strHeadings;
- m_List1.SetHeadings("影楼名称,150;单数,150;刷新时间,150;远程控制,150" );
- m_List1.LoadColumnInfo (_T("101"));
-
- FillGrid();
- this->CenterWindow (g_pMainWnd);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void PayOutSet::FillGrid()
- {
- CRecordset myset(&g_db);
- CString sql="select count(*) as cot from unauth";
- myset.Open (CRecordset::forwardOnly, sql);
- myset.GetFieldValue ("cot", sql);
- myset.Close();
- m_List1array.SetSize(atol(sql) , 1 );
- CRstunauth rsSt;
- rsSt.Open();
- DWORD ii=0;
- while(!rsSt.IsEOF())
- {
- m_List1array.ElementAt (ii).RemoveAll ();
- m_List1array.ElementAt (ii).Add(rsSt.m_name) ;
- m_List1array.ElementAt (ii).Add(rsSt.m_dindan) ;
- m_List1array.ElementAt (ii).Add(rsSt.m_datetime) ;
- m_List1array.ElementAt (ii).Add(rsSt.m_execute) ;
- ii++;
- rsSt.MoveNext();if(m_List1array.GetSize ()<=ii)break;
- }
- rsSt.Close();m_List1array.SetSize(ii , 1 );
- m_List1.DeleteAllItems2 ();
- ii=0;
- {
- m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- m_List1.m_arLabels.ElementAt (ii).Copy (m_List1array.ElementAt (ii));
- }
- m_List1.m_LabelCount=ii;
- m_List1.SetItemCountEx (ii);
- }
- void PayOutSet::OnBUTadd()
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要控制的项目!", MB_ICONINFORMATION);
- return;
- }
- int iItem=m_List1.GetNextSelectedItem(pos);
- CString name=m_List1.GetItemText (iItem, 0);
- InputPsw dlg;
- if(dlg.DoModal()!=IDOK)return;
- CString sql;
-
- sql.Format("update [unauth] set [execute]='%s' where [name]='%s'", "停止运行", name);
-
- MyExecuteSQL(&g_db, sql);
-
- FillGrid();
- }
- void PayOutSet::OnBUTdel()
- {
- // TODO: Add your control notification handler code here
-
- }
|