www.pudn.com > VC与ORACLE数据的提取.rar > ChbhfDlg.cpp
// ChbhfDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Chbhf.h"
#include "ChbhfDlg.h"
#include "DialogPWD.h"
#include "Nsrjbxx.h"
#include "XTtbm.h"
#include "Gzdfb.h"
#include "GzdZb.h"
#include "WSLCT.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChbhfDlg dialog
CChbhfDlg::CChbhfDlg(CWnd* pParent /*=NULL*/)
: CDialog(CChbhfDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CChbhfDlg)
m_cl = _T("");
m_ts = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CChbhfDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChbhfDlg)
DDX_Control(pDX, IDC_CL, m_CL);
DDX_Control(pDX, IDC_TS, m_TS);
DDX_Control(pDX, IDC_XZBC, m_xzbaocun);
DDX_Control(pDX, IDC_XZ, m_xuanze);
DDX_Control(pDX, IDC_TAB1, m_tab);
DDX_Control(pDX, IDC_LIST4, m_list4);
DDX_Control(pDX, IDC_LIST3, m_list3);
DDX_Control(pDX, IDC_LIST2, m_list2);
DDX_Control(pDX, IDC_LIST1, m_list1);
DDX_Control(pDX, IDC_JSQX, m_jsquxiao);
DDX_Control(pDX, IDC_JS, m_jieshou);
DDX_Control(pDX, IDC_COMBO1, m_combo1);
DDX_Control(pDX, IDC_BCQX, m_bcquxiao);
DDX_Control(pDX, IDC_BC, m_baocun);
DDX_Text(pDX, IDC_CL, m_cl);
DDX_Text(pDX, IDC_TS, m_ts);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CChbhfDlg, CDialog)
//{{AFX_MSG_MAP(CChbhfDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_JS, OnJs)
ON_BN_CLICKED(IDC_JSQX, OnJsqx)
ON_BN_CLICKED(IDC_BC, OnBc)
ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
ON_CBN_EDITCHANGE(IDC_COMBO1, OnEditchangeCombo1)
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
ON_WM_TIMER()
ON_BN_CLICKED(IDC_XZ, OnXz)
ON_WM_CTLCOLOR()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChbhfDlg message handlers
BOOL CChbhfDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
m_brush .CreateSolidBrush (RGB ( 20, 130, 180 ) ) ;
init();
combo1();
FLASH();
// TODO: Add extra initialization here
return TRUE;// }
//else return FALSE;// return TRUE unless you set the focus to a control
}
void CChbhfDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CChbhfDlg::OnPaint()
{
CPaintDC dc(this);
if (IsIconic())
{
// device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
/*
RECT rect;
this->GetClientRect(&rect);
CBrush BGBrush;
BGBrush.CreateSolidBrush(RGB(10,80,150));
dc.SelectObject(&BGBrush);
dc.Rectangle(&rect);
*/
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CChbhfDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CChbhfDlg::FLASH()
{
CString SQL,str;
CDBVariant varValue;//设置结构变量,存放字段的值
SQL.Format("select * from TBL_NSRJBXX where TBL_NSRJBXX.bz1 in(select TBL_GZDFB.slbh from TBL_GZDFB where TBL_GZDFB.wcbz!='*' and TBL_GZDFB.slbm = (select bmh from TBL_XTBM where bmnr in(select gw from TBL_RYGL where RYBH=%d)))",user1);/*(select bmh from TBL_XTBM where bmnr in(select gw from TBL_RYGL where RYBH=%d))*/
m_set.Open(AFX_DB_USE_DEFAULT_TYPE,SQL);
if(m_set.GetRecordCount()>0)
m_set.MoveFirst();
else MessageBox("现在还没有符合要求的数据");
char buf[20];
int i = 0;
m_list1.DeleteAllItems();//删除控件中所有记录
while(!m_set.IsEOF())
{
int temp = 0;
if (m_set.m_BZ1.IsEmpty())
m_list1.InsertItem(i,"kong !");
else
{
m_set.GetFieldValue(17,varValue);
m_list1.InsertItem(i,varValue.m_pstring->GetBuffer(1));
slbh1=m_list1.GetItemText(i,0);
lowtime();
}
if(m_set.m_LSH.IsEmpty())
m_list1.SetItemText(i,1,"");
else
{
m_set.GetFieldValue(temp,varValue);//从数据集中取得当前行第4个字段的值。
m_list1.SetItemText(i,1,varValue.m_pstring->GetBuffer(1));
}
if(m_set.m_SLBM.IsEmpty())
m_list1.SetItemText(i,2,"");
else
{ m_set.GetFieldValue(11,varValue);//从数据集中取得当前行第3个字段的值。
m_list1.SetItemText(i,2,varValue.m_pstring->GetBuffer(1));
}
if(m_set.m_SLDL.IsEmpty())
m_list1.SetItemText(i,3,"");
else
{
m_set.GetFieldValue(19,varValue);//从数据集中取得当前行第15个字段的值。
m_list1.SetItemText(i,3,varValue.m_pstring->GetBuffer(1));
}
if(m_set.m_NSRMC.IsEmpty())
m_list1.SetItemText(i,4,"");
else
{
m_set.GetFieldValue(3,varValue);//从数据集中取得当前行第6个字段的值。
m_list1.SetItemText(i,4,varValue.m_pstring->GetBuffer(1));
}
if(m_set.m_NSRSBH.IsEmpty())
m_list1.SetItemText(i,5,"");
else
{ m_set.GetFieldValue(4,varValue);//从数据集中取得当前行第5个字段的值。
m_list1.SetItemText(i,5,varValue.m_pstring->GetBuffer(1));
}
if (m_set.m_WJBH.IsEmpty())
m_list1.SetItemText(i,6,"");
else
{ m_set.GetFieldValue(1,varValue);//从数据集中取得当前行第2个字段的值。
m_list1.SetItemText(i,6,varValue.m_pstring->GetBuffer(1));
}
if(m_set.m_FS.IsEmpty())
m_list1.SetItemText(i,7,"2");
else
{
m_set.GetFieldValue(15,varValue);//从数据集中取得当前行第15个字段的值
m_list1.SetItemText(i,7,varValue.m_pstring->GetBuffer(1));
}
if(!m_set.m_SLRQ.GetDay())
m_list1.SetItemText(i,8,"");
else
{
m_set.GetFieldValue(12,varValue);//从数据集中取得当前行第12个字段的值
sprintf(buf,"%d-%d-%d-%d-%d-%d",varValue.m_pdate->year,varValue.m_pdate->month,
varValue.m_pdate->day,
varValue.m_pdate->hour,varValue.m_pdate->minute,varValue.m_pdate->second);
m_list1.SetItemText(i,8,buf);
}
if(m_set.m_SLR.IsEmpty())
m_list1.SetItemText(i,9,"kong!");
else
{ m_set.GetFieldValue(13,varValue);//从数据集中取得当前行第7个字段的值。
m_list1.SetItemText(i,9,varValue.m_pstring->GetBuffer(1));
}
i++;
m_set.MoveNext();
}
if (m_set.IsOpen())
m_set.Close();
}
void CChbhfDlg::init()
{SetWindowPos(NULL, 20,20,800,600,NULL);
m_tab.ShowWindow( SW_SHOW );
m_tab.InsertItem( 0, _T("新任务列表与接收") );
m_tab.InsertItem( 1, _T("任务处理") );
m_tab.InsertItem( 2, _T("退出") );
m_list3.ShowWindow( SW_HIDE );
m_list4.ShowWindow( SW_HIDE );
m_baocun.ShowWindow( SW_HIDE );
m_list1.ShowWindow( SW_SHOW );
m_list2.ShowWindow( SW_SHOW );
m_xuanze.ShowWindow( SW_SHOW );
m_jieshou.ShowWindow( SW_SHOW );
// m_bcquxiao.ShowWindow( SW_HIDE );
// m_jsquxiao.ShowWindow( SW_SHOW );
m_xzbaocun.ShowWindow( SW_HIDE );
m_combo1.ShowWindow( SW_HIDE );
SetDlgItemText(IDC_CL,"");
// m_TS.ShowWindow( SW_SHOW );
m_list1.InsertColumn(0,"受理编号");//分割第一、
m_list1.InsertColumn(1,"序号");
m_list1.InsertColumn(2,"受理部门");
m_list1.InsertColumn(3,"承办事项");
m_list1.InsertColumn(4,"企业名称");
m_list1.InsertColumn(5,"纳税识别号");
m_list1.InsertColumn(6,"微机编号");
m_list1.InsertColumn(7,"资料分数");
m_list1.InsertColumn(8,"受理时间");
m_list1.InsertColumn(9,"受理人");
RECT rect;//定义RECT数据类型,可以存储控件的区域。如坐标。
int width;
m_list1.GetWindowRect(&rect);//取得控件的四个顶点的坐标。放到rect变量中。
width = rect.right - rect.left;
m_list1.SetColumnWidth(0,width/7);//设置控件中每一列的宽度。
m_list1.SetColumnWidth(1,width/7);
m_list1.SetColumnWidth(2,width/4);
m_list1.SetColumnWidth(3,width/4);//设置控件中每一列的宽度。
m_list1.SetColumnWidth(4,width/5);
m_list1.SetColumnWidth(5,width/4);
m_list1.SetColumnWidth(6,width/4);//设置控件中每一列的宽度。
m_list1.SetColumnWidth(7,width/4);
m_list1.SetColumnWidth(8,width/4);
m_list1.SetColumnWidth(9,width/4);
m_list1.SetExtendedStyle(LVS_EX_FULLROWSELECT);//设置整行选择
//初始化LIST2
m_list2.InsertColumn(0,"受理编号");//分割第一、
m_list2.InsertColumn(1,"序号");
m_list2.InsertColumn(2,"受理部门");
m_list2.InsertColumn(3,"承办事项");
m_list2.InsertColumn(4,"企业名称");
m_list2.InsertColumn(5,"纳税识别号");
m_list2.InsertColumn(6,"微机编号");
m_list2.InsertColumn(7,"资料分数");
m_list2.InsertColumn(8,"受理时间");
m_list2.InsertColumn(9,"受理人");
m_list2.SetColumnWidth(0,width/7);//设置控件中每一列的宽度。
m_list2.SetColumnWidth(1,width/7);
m_list2.SetColumnWidth(2,width/4);
m_list2.SetColumnWidth(3,width/4);//设置控件中每一列的宽度。
m_list2.SetColumnWidth(4,width/5);
m_list2.SetColumnWidth(5,width/4);
m_list2.SetColumnWidth(6,width/4);//设置控件中每一列的宽度。
m_list2.SetColumnWidth(7,width/4);
m_list2.SetColumnWidth(8,width/4);
m_list2.SetColumnWidth(9,width/4);
// m_list2.SetItemColor(0,1,RGB(255,0,0),RGB(0,255,0));
// m_list2.setExtendedStyle(LVS_EX_FULLROWSELECT);//设置整行选择
//初始化LIST3
m_list3.InsertColumn(0,"受理编号");//分割第一、
m_list3.InsertColumn(1,"序号");
m_list3.InsertColumn(2,"受理部门");
m_list3.InsertColumn(3,"承办事项");
m_list3.InsertColumn(4,"企业名称");
m_list3.InsertColumn(5,"纳税识别号");
m_list3.InsertColumn(6,"微机编号");
m_list3.InsertColumn(7,"资料分数");
m_list3.InsertColumn(8,"受理时间");
m_list3.InsertColumn(9,"受理人");
m_list3.SetColumnWidth(0,width/7);//设置控件中每一列的宽度。
m_list3.SetColumnWidth(1,width/7);
m_list3.SetColumnWidth(2,width/4);
m_list3.SetColumnWidth(3,width/4);//设置控件中每一列的宽度。
m_list3.SetColumnWidth(4,width/5);
m_list3.SetColumnWidth(5,width/4);
m_list3.SetColumnWidth(6,width/4);//设置控件中每一列的宽度。
m_list3.SetColumnWidth(7,width/4);
m_list3.SetColumnWidth(8,width/4);
m_list3.SetColumnWidth(9,width/4);
//初始化LIST4
m_list4.InsertColumn(0,"受理编号");//分割第一、
m_list4.InsertColumn(1,"序号");
m_list4.InsertColumn(2,"受理部门");
m_list4.InsertColumn(3,"承办事项");
m_list4.InsertColumn(4,"企业名称");
m_list4.InsertColumn(5,"纳税识别号");
m_list4.InsertColumn(6,"微机编号");
m_list4.InsertColumn(7,"资料分数");
m_list4.InsertColumn(8,"受理时间");
m_list4.InsertColumn(9,"受理人");
m_list4.SetColumnWidth(0,width/5);//设置控件中每一列的宽度。
m_list4.SetColumnWidth(1,width/6);
m_list4.SetColumnWidth(2,width/4);
m_list4.SetColumnWidth(3,width/3);//设置控件中每一列的宽度。
m_list4.SetColumnWidth(4,width/5);
m_list4.SetColumnWidth(5,width/3);
m_list4.SetColumnWidth(6,width/3);//设置控件中每一列的宽度。
m_list4.SetColumnWidth(7,width/3);
m_list4.SetColumnWidth(8,width/3);
m_list4.SetColumnWidth(9,width/3);
SetDlgItemText(IDC_TS,"接收:"); //设置STATIC控件数据
SetDlgItemText(IDC_CL,"");
SetWindowText("文书受理");
SetTimer(100,100000,NULL);
m_list1.SetExtendedStyle(LVS_EX_FULLROWSELECT);
// m_list1.SetExtendedStyle(LVS_EX_GRIDLINES); // 为List添加网格
m_list2.SetExtendedStyle(LVS_EX_FULLROWSELECT);
// m_list2.SetExtendedStyle(LVS_EX_GRIDLINES); // 为List添加网格
m_list3.SetExtendedStyle(LVS_EX_FULLROWSELECT);
// m_list3.SetExtendedStyle(LVS_EX_GRIDLINES); // 为List添加网格
m_list1.SetBkColor(RGB(255,255,255));
m_list1.SetTextBkColor(RGB(255,255,255));
m_list1.SetTextColor(RGB(0,200,0));
//m_list1.SetCheck(0,TRUE);
m_list2.SetBkColor(RGB(255,255,255));
m_list2.SetTextBkColor(RGB(0,0,255));
m_list2.SetTextColor(RGB(255,255,255));
m_list3.SetBkColor(RGB(255,255,255));
m_list3.SetTextBkColor(RGB(0,200,0));
m_list3.SetTextColor(RGB(255,255,255));
// SetWindowPos(NULL, 0,0,1024,768,NULL);
if (!m_database.Open(NULL,FALSE,FALSE,"ODBC;DSN=wssl;PWD=wssl"))
ASSERT("不能打开到该数据源的连接!");
user1=atoi(user);
}
int CChbhfDlg::lowtime()
{
CTime time;
CDBVariant varValue;//设置结构变量,存放字段的值
CString CurrentTime,day,year,month;
int day1,day2,month1,month2,year1,year2,di;
time=time.GetCurrentTime();
year=time.Format("%Y");
year1=atoi(year);
month=time.Format("%m");
month1=atoi(month);
day=time.Format("%d");
day1=atoi(day);
char buf1[4],buf2[4],buf3[4];
if(m_set.m_SLRQ.GetDay())
{
m_set.GetFieldValue(12,varValue);//从数据集中取得当前行第12个字段的值
sprintf(buf1,"%d",varValue.m_pdate->year);
sprintf(buf2,"%d",varValue.m_pdate->month);
sprintf(buf3,"%d",varValue.m_pdate->day);
}
else
MessageBox("受理日期为空值!!!!!");
m_list4.InsertItem(0,buf1);
year2=atoi(m_list4.GetItemText(0,0));
//MessageBox("受理日期为空值!!!!!1");
m_list4.SetItemText(0,1,buf2);
month2=atoi(m_list4.GetItemText(0,1));
m_list4.SetItemText(0,2,buf3);
day2=atoi(m_list4.GetItemText(0,2));
//MessageBox("受理日期为空值!!!!!1");
m_list4.DeleteAllItems();
//m_set.Close();
UpdateData(true);
if(month1=day2)
di=day1-day2-1;
else
{
MessageBox("系统时间有问题");
}
CString SQL,s;
CWSLCT m_set1;
SQL.Format("select max(slsj) from TBL_WSLCT where bmh in(select a.slbm from TBL_GZDFB a where a.slbh='1000101')",slbh1);/*(select bmh from TBL_XTBM where bmnr in(select gw from TBL_RYGL where RYBH=%d))*/
m_database.ExecuteSQL(SQL);
s=m_set1.m_SLSJ;
if((di-atoi(s))<0)
di=di-atoi(m_set1.m_SLSJ);
else
{di=100000;
SetDlgItemText(IDC_TS,"超时!!!!!");
}
return di;
}
void CChbhfDlg::combo1()
{
CXTtbm m_set;
m_set.Open(AFX_DB_USE_DEFAULT_TYPE,"select * from TBL_xtbm where bmlbxh='4'and bmh!='000000' ");
CString str;
m_set.MoveFirst();
while(!m_set.IsEOF())
{
str.Format("%s",m_set.m_BMNR);
m_combo1.AddString(str);
m_set.MoveNext();
}
m_set.Close();
}
void CChbhfDlg::OnJs()
{
i = m_list1.GetSelectionMark();
if (i==-1)
{
MessageBox("请您选择一项任务");
}
else
{
UpdateData();
CString ItemValuse;
int num = 0;
ItemValuse= m_list1.GetItemText(i,num);
slbh1=ItemValuse;
m_list2.InsertItem(0,ItemValuse);
m_list3.InsertItem(0,ItemValuse);
for (num = 1;num<10;num++)
{ ItemValuse = m_list1.GetItemText(i,num);
m_list2.SetItemText(0,num,ItemValuse);
m_list3.SetItemText(0,num,ItemValuse);
}
m_list1.DeleteItem(i);
m_list2.SetHotItem(i);
m_list3.SetHotItem(i);
UpdateData(false);
CString strSQL,str,user2,slbh2;
CTime time;
time=time.GetCurrentTime();
if (time.GetMonth()<10)
str.Format("%d0%d%d",time.GetYear(),time.GetMonth(),time.GetDay());
else
str.Format("%d%d%d",time.GetYear(),time.GetMonth(),time.GetDay());
user2=user;
slbh2=slbh1;
strSQL.Format("insert into TBL_GZDFB(slbh,slbm,slsj,wcbz) values('%s','%s',To_date('%s','YYYYMMDD'),'%s')",slbh1,user,str,user2);
m_database.ExecuteSQL(strSQL);
strSQL.Format("UPDATE TBL_GZDFB set jssj = To_date('%s','YYYYMMDD') where slbh='%s'",str,slbh2);
m_database.ExecuteSQL(strSQL);
MessageBox("成功接收\r请尽快办理!!!!!");
}
flag ="1";
}
void CChbhfDlg::OnJsqx()
{
//m_timer.UpdateWindow();//OnEnable(true);
j =i;
if(flag=="1")
{
if (j==-1)
{
MessageBox("请选择一行纪录");
}
else
{
UpdateData();
CString ItemValuse;
int num = 0;
ItemValuse = m_list2.GetItemText(0,num);
m_list1.InsertItem(j,ItemValuse);
for (num = 1;num<6;num++)
{
ItemValuse = m_list2.GetItemText(0,num);
m_list1.SetItemText(j,num,ItemValuse);
}
m_list2.DeleteItem(0);
m_list1.SetHotItem(j);
UpdateData(false);
}
}
flag = "0"; // TODO: Add your control notification handler code here
}
void CChbhfDlg::OnBc()
{
// TODO: Add your control notification handler code here
CString strSQL,str;
CTime time;
int task = m_list3.GetSelectionMark();
if (task==-1&&sl)
{
MessageBox("请您选择一项任务");
}
else
{
time=time.GetCurrentTime();
if (time.GetMonth()<10)
str.Format("%d0%d%d",time.GetYear(),time.GetMonth(),time.GetDay());
else
str.Format("%d%d%d",time.GetYear(),time.GetMonth(),time.GetDay());
// strSQL.Format("insert into TBL_GZDFB(slbh,slbm) values('0020220','10','To_date('20040414'),YYYYmmDD')");
// strSQL.Format("insert into TBL_GZDFB(slbh,slbm) values('0020221','10')");
strSQL.Format("UPDATE TBL_GZDFB set wcbz = '*',slsj =To_date('%s','YYYYMMDD') where slbh ='%s' ",str,user);
// AfxMessageBox("不成功111111111!");
m_database.ExecuteSQL(strSQL);
m_list2.DeleteItem(task);
m_list3.DeleteItem(task);
MessageBox("保存成功\r你成功的处理了一项任务\r加油");
}
}
void CChbhfDlg::OnSelchangeCombo1()
{
m_combo1.GetLBText(m_combo1.GetCurSel(),sl);
// TODO: Add your control notification handler code here
}
void CChbhfDlg::OnEditchangeCombo1()
{
CString str1;
int n;
n=m_combo1.GetCurSel();//m_combo1.GetDlgCtrlID();
m_combo1.GetDlgItem(n,NULL);
// UpdateData(true);
// m_e1=atoi(str1);
// UpdateData(false); // TODO: Add your control notification handler code here
}
void CChbhfDlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{
int sel = m_tab.GetCurSel();
switch(sel)
{
case 0:
SetWindowPos(NULL, 20,20,800,600,NULL);
m_list3.ShowWindow( SW_HIDE );
m_list4.ShowWindow( SW_HIDE );
m_baocun.ShowWindow( SW_HIDE );
m_list1.ShowWindow( SW_SHOW );
m_list2.ShowWindow( SW_SHOW );
m_xuanze.ShowWindow( SW_HIDE );
m_jieshou.ShowWindow( SW_SHOW );
m_bcquxiao.ShowWindow( SW_HIDE );
// m_jsquxiao.ShowWindow( SW_SHOW );
m_xuanze.ShowWindow( SW_SHOW );
m_xzbaocun.ShowWindow( SW_HIDE );
m_list1.SetExtendedStyle(LVS_EX_FULLROWSELECT);
m_list2.SetExtendedStyle(LVS_EX_FULLROWSELECT);
// m_TS.ShowWindow( SW_SHOW );
m_CL.ShowWindow( SW_SHOW );
SetDlgItemText(IDC_TS,"接收:");
SetDlgItemText(IDC_CL,"");
m_combo1.ShowWindow( SW_HIDE );
SetWindowText("文书受理");
// m_list1.SetExtendedStyle(LVS_EX_GRIDLINES); // 为List添加网格
// m_list2.SetExtendedStyle(LVS_EX_GRIDLINES); // 为List添加网格
break;
case 1:
m_list1.ShowWindow( SW_HIDE );
m_list2.ShowWindow( SW_HIDE );
m_baocun.ShowWindow( SW_SHOW );
m_list3.ShowWindow( SW_SHOW );
m_list4.ShowWindow( SW_HIDE );
m_xuanze.ShowWindow( SW_HIDE );
m_jieshou.ShowWindow( SW_HIDE );
// m_bcquxiao.ShowWindow( SW_SHOW );
m_jsquxiao.ShowWindow( SW_HIDE );
// m_xzbaocun.ShowWindow( SW_SHOW );
m_combo1.ShowWindow( SW_SHOW );
SetDlgItemText(IDC_TS,"");
SetDlgItemText(IDC_CL,"处理:");
SetWindowText("任务处理");
SetWindowPos(NULL, 20,20,800,270,NULL);
// m_list3.SetExtendedStyle(LVS_EX_GRIDLINES); // 为List添加网格
// m_list3.SetExtendedStyle(LVS_EX_FULLROWSELECT);
break;
case 2:
CDialog::OnOK();
break;
} // TODO: Add your control notification handler code here
*pResult = 0;
}
void CChbhfDlg::OnTimer(UINT nIDEvent)
{
// FLASH(); // 刷新list控件中数据
// TODO: Add your message handler code here and/or call default
CDialog::OnTimer(nIDEvent);
}
void CChbhfDlg::OnXz()
{
FLASH();// TODO: Add your control notification handler code here
}
HBRUSH CChbhfDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
hbr=m_brush;
if(nCtlColor==CTLCOLOR_DLG )
{ pDC->SetBkMode(TRANSPARENT);
//此处设置字体的颜色
//pDC->SetBkColor (RGB (25,100, 45));
pDC->SetTextColor(RGB(255,0,255));
}
if (nCtlColor==CTLCOLOR_STATIC )
if(pWnd->GetDlgCtrlID() == IDC_TS)
{ pDC->SetBkMode(TRANSPARENT);
//此处设置字体的颜色
pDC->SetBkColor (RGB (180,189, 189));
pDC->SetTextColor(RGB(255,0,0));
// TODO: Change any attributes of the DC here
}
else if(pWnd->GetDlgCtrlID() == IDC_CL)
{
pDC->SetBkMode(TRANSPARENT);
//此处设置字体的颜色
pDC->SetBkColor (RGB (180,189, 189));
pDC->SetTextColor(RGB(0,0,255));
}// TODO: Return a different brush if the default is not desired
return hbr;
}
void CChbhfDlg::OnButton1()
{SetWindowPos(NULL, 20,20,800,600,NULL);
m_list3.ShowWindow( SW_HIDE );
m_list4.ShowWindow( SW_HIDE );
m_baocun.ShowWindow( SW_HIDE );
m_list1.ShowWindow( SW_SHOW );
m_list2.ShowWindow( SW_SHOW );
m_xuanze.ShowWindow( SW_HIDE );
m_jieshou.ShowWindow( SW_SHOW );
m_bcquxiao.ShowWindow( SW_HIDE );
// m_jsquxiao.ShowWindow( SW_SHOW );
m_xuanze.ShowWindow( SW_SHOW );
m_xzbaocun.ShowWindow( SW_HIDE );
m_list1.SetExtendedStyle(LVS_EX_FULLROWSELECT);
m_list2.SetExtendedStyle(LVS_EX_FULLROWSELECT);
// m_CL.ShowWindow( SW_SHOW );
SetDlgItemText(IDC_TS,"接收:");
SetDlgItemText(IDC_CL,"");
m_combo1.ShowWindow( SW_HIDE );
SetWindowText("文书受理"); // TODO: Add your control notification handler code here
}
void CChbhfDlg::OnButton2()
{SetWindowPos(NULL, 20,20,800,300,NULL);
m_list1.ShowWindow( SW_HIDE );
m_list2.ShowWindow( SW_HIDE );
m_baocun.ShowWindow( SW_SHOW );
m_list3.ShowWindow( SW_SHOW );
m_list4.ShowWindow( SW_HIDE );
m_xuanze.ShowWindow( SW_HIDE );
m_jieshou.ShowWindow( SW_HIDE );
// m_bcquxiao.ShowWindow( SW_SHOW );
m_jsquxiao.ShowWindow( SW_HIDE );
// m_xzbaocun.ShowWindow( SW_SHOW );
m_combo1.ShowWindow( SW_SHOW );
SetDlgItemText(IDC_TS,"");
SetDlgItemText(IDC_CL,"处理:");
SetWindowText("任务处理");
m_list3.SetExtendedStyle(LVS_EX_GRIDLINES); // 为List添加网格
m_list3.SetExtendedStyle(LVS_EX_FULLROWSELECT); // TODO: Add your control notification handler code here
}
void CChbhfDlg::OnButton3()
{
CDialog::OnOK(); // TODO: Add your control notification handler code here
}