123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687 |
- // WorkerReport.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "WorkerReport.h"
- #include "MyMdi.H"
- #include "SendMsgDlg.h"
- #include "SelBrunDevice.h"
- #include "GetClientInfo.h"
- #include "ShowRemark.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // WorkerReport
- IMPLEMENT_DYNCREATE(WorkerReport, MyFormView)
- WorkerReport::WorkerReport()
- : MyFormView(WorkerReport::IDD)
- {
- //{{AFX_DATA_INIT(WorkerReport)
- m_filter = _T("");
- m_clerk = _T("");
- m_worker = g_user.name ;
- m_addr = _T("");
- m_date1 = ::GetTmFromStr (g_date);
- m_date2 = ::GetTmFromStr (g_date);
- m_remark = _T("");
- m_check1 = FALSE;
- m_remark2 = _T("");
- m_days=0;
- m_remark3 = _T("");
- //}}AFX_DATA_INIT
- }
- WorkerReport::~WorkerReport()
- {
- }
- void WorkerReport::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(WorkerReport)
- DDX_Control(pDX, IDC_COMBOclerk, m_comboclerk);
- DDX_Control(pDX, IDC_COMBO1, m_combo1);
- DDX_Control(pDX, IDC_LIST2, m_List1);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_CBString(pDX, IDC_COMBO1, m_filter);
- DDX_CBString(pDX, IDC_COMBOclerk, m_clerk);
- DDX_Text(pDX, IDC_EDITworker, m_worker);
- DDX_Text(pDX, IDC_EDITaddr, m_addr);
- DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_date1);
- DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER2, m_date2);
- DDX_Text(pDX, IDC_EDITremark, m_remark);
- DDX_Check(pDX, IDC_CHECK1, m_check1);
- DDX_Text(pDX, IDC_EDITremark2, m_remark2);
- DDX_Text(pDX, IDC_EDITremark3, m_remark3);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(WorkerReport, MyFormView)
- //{{AFX_MSG_MAP(WorkerReport)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
- ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
- ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
- ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
- ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
- ON_CBN_CLOSEUP(IDC_COMBOclerk, OnCloseupCOMBOclerk)
- ON_CBN_CLOSEUP(IDC_COMBO1, OnCloseupCombo1)
- ON_WM_TIMER()
- ON_BN_CLICKED(IDC_BUTTON10, OnButton10)
- ON_BN_CLICKED(IDC_BUTTON11, OnButton11)
- ON_BN_CLICKED(IDC_BUTTON32, OnButton32)
- ON_BN_CLICKED(IDC_BUTTON14, OnButton14)
- ON_BN_CLICKED(IDC_BUTTON9, OnButton9)
- ON_BN_CLICKED(IDC_BUTTON16, OnButton16)
- ON_BN_CLICKED(IDC_BUTTON12, OnButton12)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- // ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList)
- /////////////////////////////////////////////////////////////////////////////
- // WorkerReport diagnostics
- #ifdef _DEBUG
- void WorkerReport::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void WorkerReport::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // WorkerReport message handlers
- void WorkerReport::OnInitialUpdate()
- {
- MyFormView::OnInitialUpdate();
- // TODO: Add your specialized code here and/or call the base class
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
- GetDlgItem(IDC_BUTTON2)->EnableWindow(IsHasRights2new(49));
- GetDlgItem(IDC_BUTTON14)->EnableWindow(IsHasRights2new(53));
- // Here we create the outbar control using the splitter as its parent
- // and setting its id to the first pane.
- CRect rc2;
- GetWindowRect(rc2);
- ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
- EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
- m_static1.SetFont (&g_titlefont);
- m_List1.SetHeadings("id,0;人员,100;客户全称,180;日期,110;填写日期,110;工作内容,180;明日计划,180;领导评定,180;状态,50" );
- // m_List1.LoadColumnInfo (201);
- GetData();
- m_combo1.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_combo1.MoveWindow (rc2);
- GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
- SetComboHei(&m_combo1, rc2.Height ());
- m_combo1.AddString("广东");
- m_combo1.AddString("广西");
- m_combo1.AddString("河南");
- m_combo1.AddString("河北");
- m_combo1.AddString("山东");
- m_combo1.AddString("山西");
- m_combo1.AddString("湖南");
- m_combo1.AddString("湖北");
- m_combo1.AddString("云南");
- m_combo1.AddString("黑龙江");
- m_combo1.AddString("吉林");
- m_combo1.AddString("甘肃");
- m_combo1.AddString("陕西");
- m_combo1.AddString("四川");
- m_combo1.AddString("重庆");
- m_combo1.AddString("北京");
- m_combo1.AddString("天津");
- m_combo1.AddString("内蒙");
- m_combo1.AddString("新疆");
- m_combo1.AddString("辽宁");
- m_combo1.AddString("青海");
- m_combo1.AddString("江苏");
- m_combo1.AddString("江西");
- m_combo1.AddString("浙江");
- m_combo1.AddString("福建");
- m_combo1.AddString("海南");
- m_combo1.AddString("贵州");
- m_combo1.AddString("安徽");
- m_combo1.AddString("上海");
- m_combo1.AddString("西藏");
- m_combo1.AddString("宁夏");
- m_combo1.AddString("香港");
- m_combo1.AddString("澳门");
- m_combo1.AddString("台湾");
- m_comboclerk.RefDroppedWidth();
- }
- void WorkerReport::FillGrid()
- {
- m_List1.DeleteAllItems2 ();
- int ii=0;
- m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
- int count=0;
- if(m_days)
- {
- CTime tm=::GetTmFromStr (g_date);
- CTimeSpan dt=CTimeSpan(m_days, 0, 0, 0);
- CTime begintm=tm-dt;
- CString begindate=begintm.Format ("%Y-%m-%d");
- CStringArray existarray;
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(::FindArray(&existarray, m_List1array.ElementAt (ii).ElementAt(1))!=-1)continue;
- if(m_List1array.ElementAt (ii).ElementAt (3)<=begindate )
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- //else
- existarray.Add(m_List1array.ElementAt (ii).ElementAt(1));
- }
- m_days=0;
- }
- else if(m_clerk!="")
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (1)==m_clerk )
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else if(m_filter.IsEmpty ())
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
- m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 )
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii=count;
- m_List1.m_LabelCount=ii;
- m_List1.SetItemCountEx (ii);
- }
- void WorkerReport::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- BOOL WorkerReport::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- try
- {
- if(pMsg->message==WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_RETURN:
- OnButton1();
- return 1;
- case 0x43: // copy
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_COPY);
- return TRUE;
- }
- break;
- case 0x56: //Ctrl + V:
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_PASTE);
- return TRUE;
- }
- break;
- case 0x58: // cut
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_CUT);
- return TRUE;
- }
- break;
- case 0x5A: //undo
- case 0x59: //redo
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_UNDO);
- return TRUE;
- }
- break;
- }
- }
- return MyFormView::PreTranslateMessage(pMsg);
- }
- catch(...)
- {
- }
- }
- void WorkerReport::OnButton1()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid();
- }
- void WorkerReport::OnButton3()
- {
- UpdateData();
- m_addr.TrimLeft ();
- m_addr.TrimRight ();
- m_remark.TrimLeft ();
- m_remark.TrimRight ();
- if(m_remark=="" || m_remark3=="" || m_addr=="")
- {
- AfxMessageBox("资料不全!", MB_ICONINFORMATION);
- return;
- }
- if(m_date2>m_date1)
- {
- CTimeSpan dt=m_date2-m_date1;
- if(dt.GetDays()>6)
- {
- AfxMessageBox("只能签到近一星期!", MB_ICONINFORMATION);
- return;
- }
- }
- else
- {
- CTimeSpan dt=m_date1-m_date2;
- if(dt.GetDays()>2)
- {
- AfxMessageBox("请不要玩穿越!", MB_ICONINFORMATION);
- return;
- }
- }
- CString date1=m_date1.Format ("%Y-%m-%d");
- CString date2=m_date2.Format ("%Y-%m-%d");
- CString sql;
- if(m_id=="")
- sql.Format ("insert into [workerreport] ([worker],[addr],[date1],[date2],[remark],[remark3])values( '%s','%s','%s','%s','%s','%s')",m_worker,m_addr, date1, date2, m_remark, m_remark3);
- else
- sql.Format ("update [workerreport] set [addr]='%s',[date1]='%s',[date2]='%s',[remark]='%s',[remark3]='%s' where id=%s", m_addr, date1, date2, m_remark, m_remark3, m_id);
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- AfxMessageBox("保存成功!", MB_ICONINFORMATION);
- GetData();
- }
- void WorkerReport::GetData()
- {
- UpdateData();
- g_sendhead.bsql=0;
- g_sendhead.code[0]=212;
- g_sendhead.tabcount=1;
- if(m_check1)
- g_pMainWnd->ProcessChatMessageRequest2(3);
- else
- {
- CString filter;
- CTime tm=::GetTmFromStr (g_date);
- CTimeSpan dt=CTimeSpan(30, 0, 0, 0);
- CTime begintm=tm-dt;
- CString begindate=begintm.Format ("%Y-%m-%d");
- CString enddate=tm.Format ("%Y-%m-%d");
- filter.Format ("date2>='%s' and date2<='%s'", begindate, enddate);
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- }
- if(g_bSendOK==0)
- {
- return;
- }
- DataToArray(&m_List1array);
- int size=m_List1array.GetSize ();
- CStringArray array;
- for(int i=0; i<g_userarray.GetSize (); i++)
- {
- CString worker=g_userarray.ElementAt (i).ElementAt (1);
- BOOL bFind=0;
- for(int j=0; j<size; j++)
- {
- if(m_List1array.ElementAt (j).ElementAt (1)==worker)
- {
- bFind=1;break;
- }
- }
- if(bFind==0)array.Add (worker);
- }
- m_List1array.SetSize(size+array.GetSize (), 1);
- for(i=0; i<array.GetSize (); i++)
- {
- m_List1array.ElementAt (size+i).Add ("");
- m_List1array.ElementAt (size+i).Add (array.ElementAt (i));
- m_List1array.ElementAt (size+i).Add ("");
- m_List1array.ElementAt (size+i).Add ("");
- m_List1array.ElementAt (size+i).Add ("");
- m_List1array.ElementAt (size+i).Add ("");
- m_List1array.ElementAt (size+i).Add ("");
- m_List1array.ElementAt (size+i).Add ("");
- m_List1array.ElementAt (size+i).Add ("");
- }
- m_List1arrayBak.SetSize(m_List1array.GetSize ());
- for( i=0; i<m_List1array.GetSize (); i++)
- {
- m_List1arrayBak.ElementAt (i).Copy (m_List1array.ElementAt (i));
- if(m_List1array.ElementAt (i).ElementAt (5).GetLength ()>100)
- m_List1array.ElementAt (i).SetAt (5, m_List1array.ElementAt (i).ElementAt (5).Left (100)+"..");
- if(m_List1array.ElementAt (i).ElementAt (6).GetLength ()>100)
- m_List1array.ElementAt (i).SetAt (6, m_List1array.ElementAt (i).ElementAt (6).Left (100)+"..");
- if(m_List1array.ElementAt (i).ElementAt (7).GetLength ()>100)
- m_List1array.ElementAt (i).SetAt (7, m_List1array.ElementAt (i).ElementAt (7).Left (100)+"..");
- if(m_List1array.ElementAt (i).ElementAt (7)!="")
- {
- if(0==atoi(m_List1array.ElementAt (i).ElementAt (8)))
- m_List1array.ElementAt (i).SetAt (8, "未读");
- else
- m_List1array.ElementAt (i).SetAt (8, "已读");
- }
- }
- FillGrid();
- BOOL bFind=0;
- for( i=0; i<m_List1arrayBak.GetSize (); i++)
- {
- if(0==atoi(m_List1arrayBak.ElementAt (i).ElementAt (8)) && m_List1arrayBak.ElementAt (i).ElementAt (7)!="" && m_List1arrayBak.ElementAt (i).ElementAt (1)==g_user.name)
- {
- ShowRemark dlg;
- dlg.m_remark=m_List1arrayBak.ElementAt (i).ElementAt (7);
- dlg.DoModal();
- CString sql;
- sql.Format ("update [workerreport] set [read]='1' where id=%s", m_List1arrayBak.ElementAt (i).ElementAt (0));
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- bFind=1;
- }
- }
- if(bFind)GetData();
- }
- void WorkerReport::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- OnButton4();
- return;
- }
- int iItem=m_List1.GetNextSelectedItem(pos);
- m_id=m_List1.GetItemText (iItem, 0);
- if(m_id=="")
- {
- OnButton4();
- return;
- }
- for(int i=0; i<m_List1arrayBak.GetSize(); i++)
- {
- if(m_id==m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- m_worker = m_List1arrayBak.ElementAt(i).ElementAt(1);
- m_addr = m_List1arrayBak.ElementAt(i).ElementAt(2);
- m_date1 = ::GetTmFromStr (m_List1arrayBak.ElementAt(i).ElementAt(3));
- m_date2 = ::GetTmFromStr (m_List1arrayBak.ElementAt(i).ElementAt(4));
- m_remark = m_List1arrayBak.ElementAt(i).ElementAt(5);
- m_remark3 = m_List1arrayBak.ElementAt(i).ElementAt(6);
- m_remark2 = m_List1arrayBak.ElementAt(i).ElementAt(7);
- UpdateData(0);
- GetDlgItem(IDC_BUTTON3)->SetWindowText("保存更改");
- if(g_user.name!=m_worker || m_List1arrayBak.ElementAt(i).ElementAt(4)!=g_date || m_List1arrayBak.ElementAt(i).ElementAt(7)!="")
- GetDlgItem(IDC_BUTTON3)->EnableWindow(0);
- else
- GetDlgItem(IDC_BUTTON3)->EnableWindow(1);
- break;
- }
- }
- *pResult = 0;
- }
- void WorkerReport::OnButton4()
- {
- // TODO: Add your control notification handler code here
- m_id="";
- m_worker = g_user.name ;
- m_addr = _T("");
- m_date1 = ::GetTmFromStr (g_date);
- m_date2 = ::GetTmFromStr (g_date);
- m_remark = _T(""); m_remark2 = _T("");m_remark3 = _T("");
- UpdateData(0);
- GetDlgItem(IDC_BUTTON3)->SetWindowText("保存");
- GetDlgItem(IDC_BUTTON3)->EnableWindow(1);
- }
- void WorkerReport::OnButton2()
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
- return;
- }
- if(AfxMessageBox("确认删除此记录吗?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
- int iItem=m_List1.GetNextSelectedItem(pos);
- CString id=m_List1.GetItemText (iItem, 0);
- CString sql;
- sql.Format ("delete from [workerreport] where [id]=%s", id);
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- GetData();
- }
- void WorkerReport::OnButton5()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- GetClientInfo dlg;
- if(dlg.DoModal ()==IDOK)
- {
- m_addr = dlg.m_name2 ;
- UpdateData(0);
- }
- }
- void WorkerReport::OnCheck1()
- {
- // TODO: Add your control notification handler code here
- GetData();
- }
- void WorkerReport::OnCloseupCOMBOclerk()
- {
- // TODO: Add your control notification handler code here
- int pos=m_comboclerk.GetCurSel ();
- if(pos==-1)return;
- m_comboclerk.GetLBText (pos, m_clerk);
- FillGrid();
- }
- void WorkerReport::OnCloseupCombo1()
- {
- // TODO: Add your control notification handler code here
- SetTimer(1, 100, NULL);
- }
- void WorkerReport::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- KillTimer(1);
- UpdateData();
- FillGrid();
- MyFormView::OnTimer(nIDEvent);
- }
- void WorkerReport::OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult )
- {
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
- // Take the default processing unless we set this to something else below.
- *pResult = 0;
- // First thing - check the draw stage. If it's the control's prepaint
- // stage, then tell Windows we want messages for every item.
- if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
- {
- *pResult = CDRF_NOTIFYITEMDRAW;
- }
- else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
- {
- // This is the prepaint stage for an item. Here's where we set the
- // item's text color. Our return value will tell Windows to draw the
- // item itself, but it will use the new color we set here.
- // We'll cycle the colors through red, green, and light blue.
- if(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (8)!="0")
- pLVCD->clrText = RGB(220,0,0);
- else
- pLVCD->clrText = RGB(20,133,20);
- if(pLVCD->nmcd.dwItemSpec%2)
- pLVCD->clrTextBk = g_gridcol1;
- else
- pLVCD->clrTextBk = g_gridcol2;
- // Store the color back in the NMLVCUSTOMDRAW struct.
- // Tell Windows to paint the control itself.
- *pResult = CDRF_DODEFAULT;
- }
- }
- void WorkerReport::OnButton10()
- {
- // TODO: Add your control notification handler code here
- m_days=2;
- FillGrid();
- }
- void WorkerReport::OnButton11()
- {
- // TODO: Add your control notification handler code here
- m_days=3;
- FillGrid();
- }
- void WorkerReport::OnButton32()
- {
- // TODO: Add your control notification handler code here
- m_days=5;
- FillGrid();
- }
- void WorkerReport::OnButton14()
- {
- // 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 id=m_List1.GetItemText (iItem, 0);
- ShowRemark dlg;
- dlg.m_remark =m_remark2;
- if(dlg.DoModal ()==IDOK)
- {
- CString right=g_user.name+"示";
- if(dlg.m_remark.GetLength ()>=right.GetLength ())
- {
- if(dlg.m_remark.Right (right.GetLength ())!=right)
- dlg.m_remark+=" "+right;
- }
- else
- dlg.m_remark+=" "+right;
- CString m_remark2=dlg.m_remark;
- CString sql;
- sql.Format ("update [workerreport] set [remark2]='%s',[read]='0' where id=%s",m_remark2, id);
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- AfxMessageBox("保存成功!", MB_ICONINFORMATION);
- GetData();
- }
- }
- void WorkerReport::OnButton9()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- ShowRemark dlg;
- dlg.m_remark =m_remark;
- if(dlg.DoModal ()==IDOK)
- {
- m_remark=dlg.m_remark;
- UpdateData(0);
- }
- }
- void WorkerReport::OnButton16()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- ShowRemark dlg;
- dlg.m_remark =m_remark2;
- if(dlg.DoModal ()==IDOK)
- {
- }
- }
- void WorkerReport::OnButton12()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- ShowRemark dlg;
- dlg.m_remark =m_remark3;
- if(dlg.DoModal ()==IDOK)
- {
- m_remark3=dlg.m_remark;
- UpdateData(0);
- }
- }
|