123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688 |
- // DressManage.cpp : implementation file
- #include "stdafx.h"
- #include "ylgl.h"
- #include "DressManage.h"
- #include "MyMdi.H"
- #include "SPLBDlg.h"
- #include "ShowPhoto.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // DressManage IDC_LIST5
- IMPLEMENT_DYNCREATE(DressManage, MyFormView)
- DressManage::DressManage()
- : MyFormView(DressManage::IDD)
- {
- //{{AFX_DATA_INIT(DressManage)
- m_type = _T("");
- m_count = _T("");
- m_dresstype = _T("");
- m_name = _T("");
- m_remark = _T("");
- m_price1 = _T("");
- m_price2 = _T("");
- m_date = g_date;
- m_no = _T("");
- m_bModify=0;
- m_pImg=NULL;
- m_radio1 = 0;
- //}}AFX_DATA_INIT
- }
- DressManage::~DressManage()
- {
- if(m_pImg)delete m_pImg;
- }
- void DressManage::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(DressManage)
- DDX_Control(pDX, IDC_COMBO1, m_comboarea);
- DDX_Control(pDX, IDC_EDITprice2, m_editctrl3);
- DDX_Control(pDX, IDC_EDITprice1, m_editctrl2);
- DDX_Control(pDX, IDC_EDITdate, m_datectrl);
- DDX_Control(pDX, IDC_LIST5, m_List2);
- DDX_Control(pDX, IDC_EDITcount, m_editctrl);
- DDX_Control(pDX, IDC_LIST1, m_List1);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_Text(pDX, IDC_EDIT1, m_type);
- DDX_Text(pDX, IDC_EDITcount, m_count);
- DDX_Text(pDX, IDC_EDITdresstype, m_dresstype);
- DDX_Text(pDX, IDC_EDITname, m_name);
- DDX_Text(pDX, IDC_EDITremark, m_remark);
- DDV_MaxChars(pDX, m_remark, 1000);
- DDX_Text(pDX, IDC_EDITprice1, m_price1);
- DDX_Text(pDX, IDC_EDITprice2, m_price2);
- DDX_Text(pDX, IDC_EDITdate, m_date);
- DDX_Text(pDX, IDC_EDITno, m_no);
- DDX_Radio(pDX, IDC_RADIO1, m_radio1);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(DressManage, MyFormView)
- //{{AFX_MSG_MAP(DressManage)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_BN_CLICKED(IDC_BUTTON2, OnAdd)
- ON_BN_CLICKED(IDC_BUTTON5, OnDel)
- ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
- ON_BN_CLICKED(IDC_BUTsave, OnBUTsave)
- ON_BN_CLICKED(IDC_BUTdel5, OnBUTdel5)
- ON_LBN_SELCHANGE(IDC_LIST5, OnSelchangeList5)
- ON_BN_CLICKED(IDC_BUTreset, OnBUTreset)
- ON_BN_CLICKED(IDC_BUTload, OnBUTload)
- ON_WM_PAINT()
- ON_BN_CLICKED(IDC_BUTdel, OnBUTdel)
- ON_BN_CLICKED(IDC_BUTgetno, OnBUTgetno)
- ON_BN_CLICKED(IDC_BUTgetno2, OnBUTgetno2)
- ON_BN_CLICKED(IDC_STATIC2, OnStatic2)
- ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // DressManage diagnostics
- #ifdef _DEBUG
- void DressManage::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void DressManage::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // DressManage message handlers
- void DressManage::OnInitialUpdate()
- {
- MyFormView::OnInitialUpdate();
- GetDlgItem(IDC_BUTdel5)->EnableWindow(IsHasRights2new(49));
- // TODO: Add your specialized code here and/or call the base class
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
-
- // 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_comboarea.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_comboarea.MoveWindow (rc2);
-
- m_static1.SetFont (&g_titlefont);
-
-
- m_List1.ResetContent ();
- g_sendhead.bsql=0;
- g_sendhead.code[0]=71;
- g_sendhead.code[1]=72;
- g_sendhead.code[2]=190;
- g_sendhead.tabcount=3;
- g_pMainWnd->ProcessChatMessageRequest2(0);if(g_bSendOK==0)return;
- DataToArray(&m_typearray,&m_List1array,&m_dressareaarray);
- int i = 0;
- for(i=0; i<m_typearray.GetSize (); i++)
- {
- if(m_radio1!=atoi(m_typearray.ElementAt (i).ElementAt (1)))continue;
- if(m_List1.GetCount()%2)
- m_List1.AddEntry( m_typearray.ElementAt (i).ElementAt (0) , g_gridcol1, m_List1.GetCount());
- else
- m_List1.AddEntry( m_typearray.ElementAt (i).ElementAt (0) , g_gridcol2, m_List1.GetCount());
- }
- m_List1.Invalidate ();
-
- m_List2.ResetContent ();
- for( i=0; i<m_List1array.GetSize (); i++)
- {
- if(m_radio1!=atoi(m_List1array.ElementAt (i).ElementAt (12)))continue;
- if(m_List2.GetCount()%2)
- m_List2.AddEntry( m_List1array.ElementAt (i).ElementAt (2) , g_gridcol1, m_List2.GetCount());
- else
- m_List2.AddEntry( m_List1array.ElementAt (i).ElementAt (2) , g_gridcol2, m_List2.GetCount());
- }
- m_List2.Invalidate ();
-
- for( i=0; i<m_dressareaarray.GetSize (); i++)
- {
- m_comboarea.AddString( m_dressareaarray.ElementAt (i).ElementAt (0) );
- }
- }
- void DressManage::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- BOOL DressManage::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 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(...)
- {
- }
- return true;
- }
- void DressManage::OnAdd()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_type.TrimLeft (); m_type.TrimRight ();
- CString str;
- for(int i=0; i<m_List1.GetCount (); i++)
- {
- m_List1.GetText (i, str);
- if(str==m_type)
- {
- AfxMessageBox("已有此类别的记录!");
- return;
- }
- }
- CString sql;
- sql.Format ("insert into dresstype(name,type)values('%s','%d')", m_type,m_radio1);
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- GetType();
-
- }
- void DressManage::OnDel()
- {
- // TODO: Add your control notification handle r code here
- int pos=m_List1.GetCurSel ();
- if(pos==-1)
- {
- AfxMessageBox("请先选中您要删除的类别!");
- return;
- }
- CString str;
- m_List1.GetText (pos, str);
- CString sql;
- sql.Format ("delete from dresstype where name='%s'", str);
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- GetType();
- }
- void DressManage::GetData()
- {
- g_sendhead.bsql=0;
- g_sendhead.code[0]=72;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(0);if(g_bSendOK==0)return;
- DataToArray(&m_List1array);
-
- TypeChange2();
- }
- void DressManage::OnSelchangeList1()
- {
- // TODO: Add your control notification handler code here
- int pos;
- pos=m_List1.GetCurSel ();
- if(pos==-1)return;
- UpdateData();
- m_List1.GetText (pos, m_dresstype);
- UpdateData(false);
- }
- void DressManage::OnBUTsave()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_no.TrimLeft ();m_no.TrimRight ();
- m_name.TrimLeft ();m_name.TrimRight ();
- m_count.TrimLeft ();m_count.TrimRight ();
- CString dressarea;
- int pos=m_comboarea.GetCurSel ();
- if(pos!=-1)
- {
- m_comboarea.GetLBText (pos, dressarea);
- }
-
- if(m_dresstype.IsEmpty ()||m_no.IsEmpty ()||m_name.IsEmpty ()||m_count.IsEmpty ()||dressarea.IsEmpty ())
- {
- AfxMessageBox("资料不全!");
- return;
- }
- CString sql;
-
- if(m_bModify==0)
- {
- sql="select count(*) as cot from dressinfo where [no]='"+m_no+"' or [name]='"+m_name+"'";
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- if(g_ncount)
- {
- AfxMessageBox("已有此编号或名称的记录!");
- return;
- }
- sql.Format ("insert into [dressinfo]([type],[no],[name],[count],[hirecount],[salecount],[balance],[remark],[price1],[price2],[date],[dressarea],[type2])values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%d')", m_dresstype, m_no, m_name, m_count, "0","0",m_count, m_remark, m_price1, m_price2, m_date,dressarea,m_radio1);
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- }
- else
- {
- if(IsHasRights2new(43)==0)return;
- sql="update [dressinfo] set [type]='"+m_dresstype+"',[name]='"+m_name+"',[count]='"+m_count+"',[remark]='"+m_remark+"',[price1]='"+m_price1+"',[price2]='"+m_price2+"',[dressarea]='"+dressarea+"' where [no]='"+m_no+"'";
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- }
-
-
-
- AfxMessageBox("保存成功!", MB_ICONINFORMATION);
- GetData();
-
-
- CString str;
- for(int i=0; i<m_List2.GetCount (); i++)
- {
- m_List2.GetText (i, str);
- if(str==m_name)
- {
- m_List2.SetCurSel (i);
- break;
- }
- }
- GetDlgItem(IDC_BUTload)->EnableWindow(1);
- GetDlgItem(IDC_BUTdel)->EnableWindow(1);
- GetDlgItem(IDC_EDITno)->EnableWindow(0);
- GetDlgItem(IDC_EDITname)->EnableWindow(0);
-
- // GetDlgItem(IDC_BUTsave)->SetWindowText("修改礼服资料");
- // GetDlgItem(IDC_BUTsave)->Invalidate();
- m_bModify=1;
- }
- void DressManage::GetType()
- {
- g_sendhead.bsql=0;
- g_sendhead.code[0]=71;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(0);if(g_bSendOK==0)return;
- DataToArray(&m_typearray);
- TypeChange();
- }
- void DressManage::OnBUTdel5()
- {
- // TODO: Add your control notification handler code here
- if(IsHasRights2new(49)==0)return;
- int pos=m_List2.GetCurSel ();
- if(pos==-1)
- {
- AfxMessageBox("请先选中您要删除的礼服!");
- return;
- }
- if(AfxMessageBox("删除后将不可恢复, 是否继续?", MB_YESNO|MB_ICONSTOP)!=IDYES)
- return;
-
- CString str;
- m_List2.GetText (pos, str);
- CString sql;
- sql.Format ("delete from dressinfo where name='%s'", str);
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- GetData();
- }
- void DressManage::OnSelchangeList5()
- {
- // TODO: Add your control notification handler code here
- int pos;
- pos=m_List2.GetCurSel ();
- if(pos==-1)return;
- m_List2.GetText (pos, m_name);
- CString filter="name='"+m_name+"'";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=72;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>m_List1array;
- DataToArray(&m_List1array);
- if(m_List1array.GetSize ())
- {
- m_dresstype = m_List1array.ElementAt (0).ElementAt (0);
- m_no = m_List1array.ElementAt (0).ElementAt (1);
- m_count =m_List1array.ElementAt (0).ElementAt (4);
- m_price1 = m_List1array.ElementAt (0).ElementAt (8);
- m_price2 = m_List1array.ElementAt (0).ElementAt (9);
- m_remark = m_List1array.ElementAt (0).ElementAt (10);
- m_date = m_List1array.ElementAt (0).ElementAt (11);
- CString dressarea = m_List1array.ElementAt (0).ElementAt (3);
- int pos=m_comboarea.FindString (0, dressarea);
- if(pos!=-1)
- {
- m_comboarea.SetCurSel (pos);
- }
- else
- {
- m_comboarea.AddString (dressarea);
- m_comboarea.SetCurSel (m_comboarea.FindString (0, dressarea));
- }
-
-
- CString savepath=g_path5+"\\";
- if(m_pImg)delete m_pImg;m_pImg=NULL;
- if(PathFileExists( savepath+""+m_no+".jpg" ) )
- {
- ::LoadImageFromBuf (&m_pImg, savepath+""+m_no+".jpg");
-
- }
- CRect rc;
- GetDlgItem(IDC_STATIC2)->GetWindowRect(rc);
- ScreenToClient(rc);
- InvalidateRect(rc);
- }
-
- if(m_pImg==NULL)
- {
- GetDlgItem(IDC_BUTload)->EnableWindow(1);
- GetDlgItem(IDC_BUTdel)->EnableWindow(1);
- }
- else if(IsHasRights2new(43))
- {
- GetDlgItem(IDC_BUTload)->EnableWindow(1);
- GetDlgItem(IDC_BUTdel)->EnableWindow(1);
- }
- else
- {
- GetDlgItem(IDC_BUTload)->EnableWindow(0);
- GetDlgItem(IDC_BUTdel)->EnableWindow(0);
- }
-
-
- GetDlgItem(IDC_EDITno)->EnableWindow(0);
- GetDlgItem(IDC_EDITname)->EnableWindow(0);
- // GetDlgItem(IDC_BUTsave)->SetWindowText("修改礼服资料");GetDlgItem(IDC_BUTsave)->Invalidate();
- m_bModify=1;
- UpdateData(false);
-
- // GetDlgItem(IDC_BUTsave)->EnableWindow(IsHasRights2new(43));
- }
- void DressManage::OnBUTreset()
- {
- // TODO: Add your control notification handler code here
- GetDlgItem(IDC_BUTload)->EnableWindow(0);
- GetDlgItem(IDC_BUTdel)->EnableWindow(0);
- GetDlgItem(IDC_EDITno)->EnableWindow(1);
- GetDlgItem(IDC_EDITname)->EnableWindow(1);
- // GetDlgItem(IDC_BUTsave)->SetWindowText("添加新礼服");
- // GetDlgItem(IDC_BUTsave)->Invalidate();
- m_bModify=0;
- UpdateData();
- m_count = _T("");
- m_name = _T("");
- m_remark = _T("");
- m_no = _T("");
- m_price1 = _T("");
- m_price2 = _T("");
- m_date = g_date;
- m_comboarea.SetCurSel (-1);
- UpdateData(false);
-
- if(m_pImg)delete m_pImg;m_pImg=NULL;
-
- CRect rc;
- GetDlgItem(IDC_STATIC2)->GetWindowRect(rc);
- ScreenToClient(rc);
- InvalidateRect(rc);
-
- // GetDlgItem(IDC_BUTsave)->EnableWindow(1);
- }
- extern void SaveImageToFile(Image *img, CString path);
- void DressManage::OnBUTload()
- {
- // TODO: Add your control notification handler code here
-
- if(g_path5.IsEmpty ())
- {
- AfxMessageBox("未设置礼服图片保存机器, 请通知系统管理员!", MB_ICONINFORMATION);
- return;
- }
-
- if(!::CheckFolderFileExist (g_path5))
- {
- AfxMessageBox("礼服图片保存机器目录未设置, 请通知系统管理员!", MB_ICONINFORMATION);
- return;
- }
-
- CFileDialog fdlg(true, NULL,"", OFN_HIDEREADONLY, "jpg files(*jpg)|*.jpg||");
- if(fdlg.DoModal ()!=IDOK)return;
- CString path=fdlg.GetPathName();
- if(m_pImg)delete m_pImg;m_pImg=NULL;
- ::LoadImageFromBuf (&m_pImg, path);
- if(m_pImg==NULL)
- AfxMessageBox("无效图片文件!");
- else
- {
- CRect rc(0,0,160,160);
- RectFitDes(m_pImg->GetWidth(), m_pImg->GetHeight(), rc);
-
- Image *pTemp=m_pImg->GetThumbnailImage(rc.Width (), rc.Height (), NULL, NULL);
-
-
- Graphics graphic(pTemp);
- graphic.SetSmoothingMode(SmoothingModeHighQuality);
- graphic.DrawImage(m_pImg, 0,0,pTemp->GetWidth(), pTemp->GetHeight() );
- CString savepath=g_path5+"\\";
- ::SaveImageToFile (pTemp, savepath+"s"+m_no+".jpg");
- ::SaveImageToFile (m_pImg, savepath+m_no+".jpg");
- delete pTemp;
-
- // CRect rc;
- GetDlgItem(IDC_STATIC2)->GetWindowRect(rc);
- ScreenToClient(rc);
- InvalidateRect(rc);
- }
- }
- void DressManage::OnBUTdel()
- {
- // TODO: Add your control notification handler code here
- CString savepath=g_path5+"\\";
- ::DeleteFile (savepath+"s"+m_no+".jpg"); // 删除礼服管理中的s的jpg;
- ::DeleteFile (savepath+m_no+".jpg"); // 删除礼服管理中的jpg;
- delete m_pImg;m_pImg=NULL;
- CRect rc;
- GetDlgItem(IDC_STATIC2)->GetWindowRect(rc);
- ScreenToClient(rc);
- InvalidateRect(rc);
- }
- void DressManage::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
-
- // TODO: Add your message handler code here
- if(m_pImg)
- {
- CRect rc;
- GetDlgItem(IDC_STATIC2)->GetWindowRect(rc);
- ScreenToClient(rc);
- RectFitDes(m_pImg->GetWidth(), m_pImg->GetHeight(), rc);
- Graphics dcgraph(dc.GetSafeHdc());
- Rect destinationRect(rc.left , rc.top , rc.Width (), rc.Height ());
- dcgraph.DrawImage(m_pImg, destinationRect, 0,0,m_pImg->GetWidth(), m_pImg->GetHeight(),UnitPixel);
- }
- // Do not call MyFormView::OnPaint() for painting messages
- }
- void DressManage::OnBUTgetno()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_dresstype.IsEmpty ())
- {
- AfxMessageBox("请先选择礼服类别!");
- return;
- }
- CString strRes1;
- ChinesePinYin::GetFirstLetter(m_dresstype, strRes1);
- int begin=1;
-
- BOOL bFind=1;
- while(bFind)
- {
- int i = 0;
- m_no.Format ("%s%03d", strRes1, begin++);
- for( i=0; i< m_List1array.GetSize (); i++)
- {
- if(m_no==m_List1array.ElementAt (i).ElementAt (1))
- {
- break;
- }
- }
- if(i==m_List1array.GetSize ())bFind=0;
- }
- UpdateData(false);
- }
- void DressManage::OnBUTgetno2()
- {
- // TODO: Add your control notification handler code here
- SPLBDlg dlg;
- dlg.m_mode=11;
- dlg.DoModal ();
- m_comboarea.ResetContent ();
- g_sendhead.bsql=0;
- g_sendhead.code[0]=190;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(0);if(g_bSendOK==0)return;
- DataToArray(&m_dressareaarray);
- for(int i=0; i<m_dressareaarray.GetSize (); i++)
- {
- m_comboarea.AddString( m_dressareaarray.ElementAt (i).ElementAt (0) );
- }
- }
- void DressManage::OnStatic2()
- {
- // TODO: Add your control notification handler code here
- if(m_pImg)
- {
- ShowPhoto dlg;
- dlg.m_pImg=m_pImg;
- dlg.DoModal();
- }
- }
- void DressManage::OnRadio1()
- {
- // TODO: Add your control notification handler code here
- OnRadio2() ;
- }
- void DressManage::OnRadio2()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_radio1==0)
- {
- GetDlgItem(IDC_STATIC3)->SetWindowText("礼服类别");
- GetDlgItem(IDC_STATIC4)->SetWindowText("添加礼服");
- GetDlgItem(IDC_STATIC5)->SetWindowText("全部礼服");
- GetDlgItem(IDC_STATIC6)->SetWindowText("*礼服类别:");
- GetDlgItem(IDC_STATIC7)->SetWindowText("*礼服编号:");
- GetDlgItem(IDC_STATIC8)->SetWindowText("*礼服名称:");
- GetDlgItem(IDC_STATIC9)->SetWindowText("*礼服件数:");
- }
- else
- {
- GetDlgItem(IDC_STATIC3)->SetWindowText("其它类别");
- GetDlgItem(IDC_STATIC4)->SetWindowText("添加");
- GetDlgItem(IDC_STATIC5)->SetWindowText("全部");
- GetDlgItem(IDC_STATIC6)->SetWindowText("*类别:");
- GetDlgItem(IDC_STATIC7)->SetWindowText("*编号:");
- GetDlgItem(IDC_STATIC8)->SetWindowText("*名称:");
- GetDlgItem(IDC_STATIC9)->SetWindowText("*数量:");
- }
- TypeChange();TypeChange2();
- }
- void DressManage::TypeChange()
- {
- UpdateData();
- m_List1.ResetContent ();
- for(int i=0; i<m_typearray.GetSize (); i++)
- {
- if(m_radio1!=atoi(m_typearray.ElementAt (i).ElementAt (1)))continue;
- if(m_List1.GetCount()%2)
- m_List1.AddEntry( m_typearray.ElementAt (i).ElementAt (0) , g_gridcol1, m_List1.GetCount());
- else
- m_List1.AddEntry( m_typearray.ElementAt (i).ElementAt (0) , g_gridcol2, m_List1.GetCount());
- }
- m_List1.Invalidate ();
- }
- void DressManage::TypeChange2()
- {
- UpdateData();
- m_List2.ResetContent ();
- for(int i=0; i<m_List1array.GetSize (); i++)
- {
- if(m_radio1!=atoi(m_List1array.ElementAt (i).ElementAt (12)))continue;
- if(m_List2.GetCount()%2)
- m_List2.AddEntry( m_List1array.ElementAt (i).ElementAt (2) , g_gridcol1, m_List2.GetCount());
- else
- m_List2.AddEntry( m_List1array.ElementAt (i).ElementAt (2) , g_gridcol2, m_List2.GetCount());
- }
- m_List2.Invalidate ();
- }
|