YearForm2.cpp 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990
  1. // YearForm2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "YearForm2.h"
  6. #include "MyMdi.H"
  7. #include "VcPlot.h"
  8. #include "VcAxis.h"
  9. #include "VcValueScale.h"
  10. #include "VcSeriesCollection.h"
  11. #include "VcSeries.h"
  12. #include "VcPen.h"
  13. #include "VcCategoryScale.h"
  14. #include "VcColor.h"
  15. #include "VcDataGrid.h"
  16. #include "VcBackdrop.h"
  17. #include "VcFill.h"
  18. #include "VcBrush.h"
  19. #include "VcDataPoints.h"
  20. #include "VcDataPoint.h"
  21. #include "VcDataPointLabel.h"
  22. #include "VcAxisTitle.h"
  23. #include "ShowMschart.h"
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. /////////////////////////////////////////////////////////////////////////////
  30. // YearForm2
  31. IMPLEMENT_DYNCREATE(YearForm2, MyFormView)
  32. YearForm2::YearForm2()
  33. : MyFormView(YearForm2::IDD)
  34. {
  35. m_year = atoi(g_date.Mid (0,4));
  36. m_month = atoi(g_date.Mid (5,2));
  37. m_day = atoi(g_date.Mid (8,2));
  38. m_check1 = 1;
  39. m_check2 = 1;
  40. m_check3 = 1;
  41. m_check4 = 1;
  42. m_radio2 = 0;
  43. m_radio1 = 1;
  44. m_check5 = 1;
  45. m_bInit=0;
  46. m_timestmap=0;
  47. m_check6 = 1;
  48. m_check7 = 1;
  49. //}}AFX_DATA_INIT
  50. }
  51. YearForm2::~YearForm2()
  52. {
  53. }
  54. void YearForm2::DoDataExchange(CDataExchange* pDX)
  55. {
  56. MyFormView::DoDataExchange(pDX);
  57. DDX_Control(pDX, IDC_SPIN3, m_spinday);
  58. DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
  59. DDX_Control(pDX, IDC_SPIN1, m_spinyear);
  60. DDX_Control(pDX, IDC_STATIC1, m_static1);
  61. DDX_Text(pDX, IDC_EDITyear, m_year);
  62. DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
  63. DDX_Text(pDX, IDC_EDITmonth, m_month);
  64. DDV_MinMaxUInt(pDX, m_month, 1, 12);
  65. DDX_Text(pDX, IDC_EDITday, m_day);
  66. DDV_MinMaxUInt(pDX, m_day, 1, 31);
  67. DDX_Control(pDX, IDC_MSCHART1, m_Chart);
  68. DDX_Check(pDX, IDC_CHECK1, m_check1);
  69. DDX_Check(pDX, IDC_CHECK2, m_check2);
  70. DDX_Check(pDX, IDC_CHECK3, m_check3);
  71. DDX_Check(pDX, IDC_CHECK4, m_check4);
  72. DDX_Radio(pDX, IDC_RADIO6, m_radio2);
  73. DDX_Radio(pDX, IDC_RADIO3, m_radio1);
  74. DDX_Control(pDX, IDC_MSCHART2, m_Chart2);
  75. DDX_Control(pDX, IDC_MSCHART3, m_Chart3);
  76. DDX_Check(pDX, IDC_CHECK5, m_check5);
  77. DDX_Check(pDX, IDC_CHECK6, m_check6);
  78. DDX_Check(pDX, IDC_CHECK7, m_check7);
  79. //}}AFX_DATA_MAP
  80. }
  81. BEGIN_MESSAGE_MAP(YearForm2, MyFormView)
  82. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  83. ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
  84. ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
  85. ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
  86. ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
  87. ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
  88. ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
  89. ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
  90. ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
  91. ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  92. ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
  93. ON_BN_CLICKED(IDC_CHECK3, OnCheck3)
  94. ON_BN_CLICKED(IDC_CHECK4, OnCheck4)
  95. ON_BN_CLICKED(IDC_CHECK5, OnCheck5)
  96. ON_BN_CLICKED(IDC_CHECK6, OnCheck6)
  97. ON_BN_CLICKED(IDC_CHECK7, OnCheck7)
  98. ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
  99. //}}AFX_MSG_MAP
  100. END_MESSAGE_MAP()
  101. /////////////////////////////////////////////////////////////////////////////
  102. // YearForm2 diagnostics
  103. #ifdef _DEBUG
  104. void YearForm2::AssertValid() const
  105. {
  106. MyFormView::AssertValid();
  107. }
  108. void YearForm2::Dump(CDumpContext& dc) const
  109. {
  110. MyFormView::Dump(dc);
  111. }
  112. #endif //_DEBUG
  113. /////////////////////////////////////////////////////////////////////////////
  114. // YearForm2 message handlers
  115. void YearForm2::OnInitialUpdate()
  116. {
  117. MyFormView::OnInitialUpdate();
  118. // TODO: Add your specialized code here and/or call the base class
  119. CMyMdi Mdi;
  120. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  121. // Here we create the outbar control using the splitter as its parent
  122. // and setting its id to the first pane.
  123. CRect rc2;
  124. GetWindowRect(rc2); //
  125. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  126. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
  127. m_static1.SetFont (&g_titlefont);
  128. m_spinyear.SetRange (1900, 3000);
  129. m_spinmonth.SetRange (1, 12);
  130. m_spinday.SetRange (1, 31);
  131. m_Chart.GetBackdrop().GetFill().SetStyle(1);
  132. m_Chart.GetBackdrop().GetFill().GetBrush().GetFillColor().Set(255, 255, 255);
  133. m_Chart.SetShowLegend(TRUE);
  134. m_Chart.SetColumn(1);
  135. m_Chart.SetColumnLabel((LPCTSTR)"总收入");
  136. m_Chart.SetChartType(1);
  137. // 栈模式
  138. m_Chart.SetStacking(FALSE);
  139. VARIANT var;
  140. m_Chart.GetPlot().GetAxis(1,var).GetValueScale().SetAuto(1); // 不自动标注Y轴刻度
  141. m_Chart.GetPlot().GetAxis(0,var).GetCategoryScale().SetAuto(0); // 不自动标注X轴刻度
  142. m_Chart.GetPlot().GetAxis(0,var).GetCategoryScale().SetDivisionsPerLabel(1);// 每刻度一个标注
  143. m_Chart.GetPlot().GetAxis(0,var).GetCategoryScale().SetDivisionsPerTick(1); // 每刻度一个刻度线
  144. m_Chart.SetColumnCount(1);
  145. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 0);
  146. // 线宽(对点线图有效)
  147. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetWidth(30);
  148. // 数据点类型显示数据值的模式(对柱柱状图和点线图有效)
  149. // 0: 不显示 1: 显示在柱状图外
  150. // 2: 显示在柱状图内上方 3: 显示在柱状图内中间 4: 显示在柱状图内下方
  151. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  152. //////////////////////
  153. m_Chart2.GetBackdrop().GetFill().SetStyle(1);
  154. m_Chart2.GetBackdrop().GetFill().GetBrush().GetFillColor().Set(255, 255, 255);
  155. m_Chart2.SetShowLegend(TRUE);
  156. m_Chart2.SetColumn(1);
  157. m_Chart2.SetColumnLabel((LPCTSTR)"总支出");
  158. m_Chart2.SetChartType(1);
  159. // 栈模式
  160. m_Chart2.SetStacking(FALSE);
  161. m_Chart2.GetPlot().GetAxis(1,var).GetValueScale().SetAuto(1); // 不自动标注Y轴刻度
  162. m_Chart2.GetPlot().GetAxis(0,var).GetCategoryScale().SetAuto(0); // 不自动标注X轴刻度
  163. m_Chart2.GetPlot().GetAxis(0,var).GetCategoryScale().SetDivisionsPerLabel(1);// 每刻度一个标注
  164. m_Chart2.GetPlot().GetAxis(0,var).GetCategoryScale().SetDivisionsPerTick(1); // 每刻度一个刻度线
  165. m_Chart2.SetColumnCount(1);
  166. m_Chart2.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 0);
  167. // 线宽(对点线图有效)
  168. m_Chart2.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetWidth(30);
  169. // 数据点类型显示数据值的模式(对柱柱状图和点线图有效)
  170. // 0: 不显示 1: 显示在柱状图外
  171. // 2: 显示在柱状图内上方 3: 显示在柱状图内中间 4: 显示在柱状图内下方
  172. m_Chart2.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  173. ///////////////////////////
  174. m_Chart3.GetBackdrop().GetFill().SetStyle(1);
  175. m_Chart3.GetBackdrop().GetFill().GetBrush().GetFillColor().Set(255, 255, 255);
  176. m_Chart3.SetShowLegend(TRUE);
  177. m_Chart3.SetChartType(1);
  178. // 栈模式
  179. m_Chart3.SetStacking(FALSE);
  180. m_Chart3.GetPlot().GetAxis(1,var).GetValueScale().SetAuto(1); // 不自动标注Y轴刻度
  181. m_Chart3.GetPlot().GetAxis(0,var).GetCategoryScale().SetAuto(0); // 不自动标注X轴刻度
  182. m_Chart3.GetPlot().GetAxis(0,var).GetCategoryScale().SetDivisionsPerLabel(1);// 每刻度一个标注
  183. m_Chart3.GetPlot().GetAxis(0,var).GetCategoryScale().SetDivisionsPerTick(1); // 每刻度一个刻度线
  184. m_Chart3.SetColumnCount(6);
  185. m_Chart3.SetColumn(1);
  186. m_Chart3.SetColumnLabel((LPCTSTR)"全部");
  187. m_Chart3.SetColumn(2);
  188. m_Chart3.SetColumnLabel((LPCTSTR)"婚纱照");
  189. m_Chart3.SetColumn(3);
  190. m_Chart3.SetColumnLabel((LPCTSTR)"写真照");
  191. m_Chart3.SetColumn(4);
  192. m_Chart3.SetColumnLabel((LPCTSTR)"宝宝照");
  193. m_Chart3.SetColumn(5);
  194. m_Chart3.SetColumnLabel((LPCTSTR)"全家福");
  195. m_Chart3.SetColumn(6);
  196. m_Chart3.SetColumnLabel((LPCTSTR)"情侣照");
  197. m_Chart3.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 0);
  198. m_Chart3.GetPlot().GetSeriesCollection().GetItem(2).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 255, 0);
  199. m_Chart3.GetPlot().GetSeriesCollection().GetItem(3).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 0, 255);
  200. m_Chart3.GetPlot().GetSeriesCollection().GetItem(4).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 255, 255);
  201. m_Chart3.GetPlot().GetSeriesCollection().GetItem(5).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 255, 0);
  202. m_Chart3.GetPlot().GetSeriesCollection().GetItem(6).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 255);
  203. // 线宽(对点线图有效)
  204. m_Chart3.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetWidth(30);
  205. m_Chart3.GetPlot().GetSeriesCollection().GetItem(2).GetPen().SetWidth(30);
  206. m_Chart3.GetPlot().GetSeriesCollection().GetItem(3).GetPen().SetWidth(30);
  207. m_Chart3.GetPlot().GetSeriesCollection().GetItem(4).GetPen().SetWidth(30);
  208. m_Chart3.GetPlot().GetSeriesCollection().GetItem(5).GetPen().SetWidth(30);
  209. m_Chart3.GetPlot().GetSeriesCollection().GetItem(6).GetPen().SetWidth(30);
  210. // 数据点类型显示数据值的模式(对柱柱状图和点线图有效)
  211. // 0: 不显示 1: 显示在柱状图外
  212. // 2: 显示在柱状图内上方 3: 显示在柱状图内中间 4: 显示在柱状图内下方
  213. m_Chart3.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  214. m_Chart3.GetPlot().GetSeriesCollection().GetItem(2).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  215. m_Chart3.GetPlot().GetSeriesCollection().GetItem(3).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  216. m_Chart3.GetPlot().GetSeriesCollection().GetItem(4).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  217. m_Chart3.GetPlot().GetSeriesCollection().GetItem(5).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  218. m_Chart3.GetPlot().GetSeriesCollection().GetItem(6).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  219. ////////////////
  220. GetDlgItem(IDC_STATIC2)->GetWindowRect(rc2);
  221. ScreenToClient(rc2);
  222. m_Chart.MoveWindow (rc2);
  223. GetDlgItem(IDC_STATIC3)->GetWindowRect(rc2);
  224. ScreenToClient(rc2);
  225. m_Chart2.MoveWindow (rc2);
  226. GetDlgItem(IDC_STATIC12)->GetWindowRect(rc2);
  227. ScreenToClient(rc2);
  228. m_Chart3.MoveWindow (rc2);
  229. m_bInit=1;
  230. DateChange();
  231. }
  232. void YearForm2::FillGrid()
  233. {
  234. }
  235. void YearForm2::OnBUTclose()
  236. {
  237. // TODO: Add your control notification handler code here
  238. GetParent()->SendMessage(WM_CLOSE);
  239. }
  240. void YearForm2::OnChangeEDITyear()
  241. {
  242. // TODO: If this is a RICHEDIT control, the control will not
  243. // send this notification unless you override the MyFormView::OnInitDialog()
  244. // function and call CRichEditCtrl().SetEventMask()
  245. // with the ENM_CHANGE flag ORed into the mask.
  246. DateChange();
  247. // TODO: Add your control notification handler code here
  248. }
  249. void YearForm2::OnChangeEDITmonth()
  250. {
  251. // TODO: If this is a RICHEDIT control, the control will not
  252. // send this notification unless you override the MyFormView::OnInitDialog()
  253. // function and call CRichEditCtrl().SetEventMask()
  254. // with the ENM_CHANGE flag ORed into the mask.
  255. // DateChange();
  256. // TODO: Add your control notification handler code here
  257. }
  258. void YearForm2::OnChangeEDITday()
  259. {
  260. // TODO: If this is a RICHEDIT control, the control will not
  261. // send this notification unless you override the MyFormView::OnInitDialog()
  262. // function and call CRichEditCtrl().SetEventMask()
  263. // with the ENM_CHANGE flag ORed into the mask.
  264. // DateChange();
  265. // TODO: Add your control notification handler code here
  266. }
  267. void YearForm2::DateChange()
  268. {
  269. if(m_bInit==0)return;
  270. m_spinyear.EnableWindow(0);
  271. m_spinmonth.EnableWindow(0);
  272. m_spinday.EnableWindow(0);
  273. UpdateData();
  274. int i;
  275. int g_nYearposTemp=g_nYearpos;
  276. BOOL bLastYear=0;
  277. BOOL bThisYear=0;
  278. if(m_year==atoi(g_date.Left (4)) && g_hisyeararray.GetSize () )
  279. bThisYear=1;
  280. else if(m_year<=atoi(g_date.Left (4))-1 && g_hisyeararray.GetSize ())
  281. bLastYear=1;
  282. g_nYearpos=GetYearPos(m_year);
  283. int g_nYearposPre=GetYearPos(m_year-1);
  284. g_sendhead.bsql=0;
  285. g_sendhead.code[0]=14; // 其他收入;
  286. g_sendhead.code[1]=13; // 支出;
  287. g_sendhead.code[2]=16; // 订单收入;
  288. g_sendhead.code[3]=198; // 二销收入;
  289. #if 0 // Jeff
  290. g_sendhead.tabcount=4;
  291. #else
  292. g_sendhead.code[4]=216; // 会员充值;
  293. g_sendhead.tabcount=5;
  294. #endif
  295. CString sql,strdate,strdate2;
  296. strdate.Format ("%04d-%02d-%02d", m_year, 1, 1);
  297. strdate2.Format ("%04d-%02d-%02d", m_year, 12, 31);
  298. CRect rc;
  299. m_static1.GetWindowRect (rc);
  300. ScreenToClient(rc);
  301. InvalidateRect(rc);
  302. m_static1.SetWindowText (strdate.Left (4)+"年财务表");
  303. sql.Format ("dat>='"+strdate+"' and dat<='"+strdate2+"' and (sale2type is null or sale2type='');dat>='"+strdate+"' and dat<='"+strdate2+"';date>='"+strdate+"' and date<='"+strdate2+"';date>='"+strdate+"' and date<='"+strdate2+"'");
  304. g_pMainWnd->ProcessChatMessageRequest2(sql);
  305. if(g_bSendOK==0)
  306. {
  307. g_nYearpos=g_nYearposTemp;
  308. m_spinyear.EnableWindow(1);
  309. m_spinmonth.EnableWindow(1);
  310. m_spinday.EnableWindow(1);
  311. return;
  312. }
  313. #if 0
  314. DataToArray(&List2array,&List3array,&List11array,&other2salearray); // Jeff delete;
  315. #else
  316. DataToArray(&List2array,&List3array,&List11array,&other2salearray,&memberarray); // Jeff添加会员充值;
  317. #endif
  318. if(bLastYear)//如果是去年, 则加今年的补款
  319. {
  320. g_nYearpos=-1;//今年
  321. g_sendhead.bsql=0;
  322. g_sendhead.code[0]=14; // 其他收入;
  323. g_sendhead.code[1]=13; // 支出;
  324. g_sendhead.code[2]=16; // 订单收入;
  325. g_sendhead.code[3]=198; // 二销收入;
  326. #if 0
  327. g_sendhead.tabcount=4;
  328. #else
  329. g_sendhead.code[4]=216; // 会员充值;
  330. g_sendhead.tabcount=5;
  331. #endif
  332. g_pMainWnd->ProcessChatMessageRequest2(sql);
  333. if(g_bSendOK==0)
  334. {
  335. g_nYearpos=g_nYearposTemp;
  336. m_spinyear.EnableWindow(1);
  337. m_spinmonth.EnableWindow(1);
  338. m_spinday.EnableWindow(1);
  339. return;
  340. }
  341. CArray<CStringArray, CStringArray>ThisYearList11array;
  342. CArray<CStringArray, CStringArray>ThisYearList3array;
  343. CArray<CStringArray, CStringArray>ThisYearList2array;
  344. CArray<CStringArray, CStringArray>ThisYearother2salearray;
  345. #if 0
  346. DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray);
  347. #else
  348. CArray<CStringArray, CStringArray>ThisYearmemberarray;
  349. DataToArray(&ThisYearList2array,&ThisYearList3array,&ThisYearList11array,&ThisYearother2salearray,&ThisYearmemberarray); // Jeff添加会员充值;
  350. #endif
  351. int oldsize=List11array.GetSize ();
  352. List11array.SetSize(oldsize+ThisYearList11array.GetSize ());
  353. for(i=oldsize; i<oldsize+ThisYearList11array.GetSize (); i++)
  354. {
  355. List11array.ElementAt (i).Copy(ThisYearList11array.ElementAt (i-oldsize));
  356. }
  357. oldsize=List3array.GetSize ();
  358. List3array.SetSize(oldsize+ThisYearList3array.GetSize ());
  359. for(i=oldsize; i<oldsize+ThisYearList3array.GetSize (); i++)
  360. {
  361. List3array.ElementAt (i).Copy(ThisYearList3array.ElementAt (i-oldsize));
  362. }
  363. oldsize=List2array.GetSize ();
  364. List2array.SetSize(oldsize+ThisYearList2array.GetSize ());
  365. for(i=oldsize; i<oldsize+ThisYearList2array.GetSize (); i++)
  366. {
  367. List2array.ElementAt (i).Copy(ThisYearList2array.ElementAt (i-oldsize));
  368. }
  369. oldsize=other2salearray.GetSize ();
  370. other2salearray.SetSize(oldsize+ThisYearother2salearray.GetSize ());
  371. for(i=oldsize; i<oldsize+ThisYearother2salearray.GetSize (); i++)
  372. {
  373. other2salearray.ElementAt (i).Copy(ThisYearother2salearray.ElementAt (i-oldsize));
  374. }
  375. #if 1 // 添加会员充值;
  376. oldsize=memberarray.GetSize();
  377. memberarray.SetSize(oldsize+ThisYearmemberarray.GetSize());
  378. for (i=oldsize;i<oldsize+ThisYearmemberarray.GetSize();i++)
  379. {
  380. memberarray.ElementAt(i).Copy(ThisYearmemberarray.ElementAt(i-oldsize));
  381. }
  382. #endif
  383. }
  384. if(g_nYearposPre!=-1)//如果是今年, 则加去年的补款
  385. {
  386. g_nYearpos=g_nYearposPre;//去年
  387. g_sendhead.bsql=0;
  388. g_sendhead.code[0]=14; // 其他收入;
  389. g_sendhead.code[1]=13; // 支出;
  390. g_sendhead.code[2]=16; // 订单收入;
  391. g_sendhead.code[3]=198; // 二销收入;
  392. #if 0
  393. g_sendhead.tabcount=4;
  394. #else
  395. g_sendhead.code[4]=216; // 会员充值;
  396. g_sendhead.tabcount=5;
  397. #endif
  398. g_pMainWnd->ProcessChatMessageRequest2(sql);
  399. if(g_bSendOK==0)
  400. {
  401. g_nYearpos=g_nYearposTemp;
  402. m_spinyear.EnableWindow(1);
  403. m_spinmonth.EnableWindow(1);
  404. m_spinday.EnableWindow(1);
  405. return;
  406. }
  407. CArray<CStringArray, CStringArray>ThisYearList11array;
  408. CArray<CStringArray, CStringArray>ThisYearList3array;
  409. CArray<CStringArray, CStringArray>ThisYearList2array;
  410. CArray<CStringArray, CStringArray>ThisYearother2salearray;
  411. #if 0
  412. DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray);
  413. #else
  414. CArray<CStringArray, CStringArray>ThisYearmemberarray;
  415. DataToArray(&ThisYearList2array,&ThisYearList3array,&ThisYearList11array,&ThisYearother2salearray,&ThisYearmemberarray); // Jeff添加会员充值;
  416. #endif
  417. int oldsize=List11array.GetSize ();
  418. List11array.SetSize(oldsize+ThisYearList11array.GetSize ());
  419. for(i=oldsize; i<oldsize+ThisYearList11array.GetSize (); i++)
  420. {
  421. List11array.ElementAt (i).Copy(ThisYearList11array.ElementAt (i-oldsize));
  422. }
  423. oldsize=List3array.GetSize ();
  424. List3array.SetSize(oldsize+ThisYearList3array.GetSize ());
  425. for(i=oldsize; i<oldsize+ThisYearList3array.GetSize (); i++)
  426. {
  427. List3array.ElementAt (i).Copy(ThisYearList3array.ElementAt (i-oldsize));
  428. }
  429. oldsize=List2array.GetSize ();
  430. List2array.SetSize(oldsize+ThisYearList2array.GetSize ());
  431. for(i=oldsize; i<oldsize+ThisYearList2array.GetSize (); i++)
  432. {
  433. List2array.ElementAt (i).Copy(ThisYearList2array.ElementAt (i-oldsize));
  434. }
  435. oldsize=other2salearray.GetSize ();
  436. other2salearray.SetSize(oldsize+ThisYearother2salearray.GetSize ());
  437. for(i=oldsize; i<oldsize+ThisYearother2salearray.GetSize (); i++)
  438. {
  439. other2salearray.ElementAt (i).Copy(ThisYearother2salearray.ElementAt (i-oldsize));
  440. }
  441. #if 1 // 添加会员充值;
  442. oldsize=memberarray.GetSize();
  443. memberarray.SetSize(oldsize+ThisYearmemberarray.GetSize());
  444. for (i=oldsize;i<oldsize+ThisYearmemberarray.GetSize();i++)
  445. {
  446. memberarray.ElementAt(i).Copy(ThisYearmemberarray.ElementAt(i-oldsize));
  447. }
  448. #endif
  449. }
  450. g_nYearpos=g_nYearposTemp;
  451. KindChange();
  452. m_spinyear.EnableWindow(1);
  453. m_spinmonth.EnableWindow(1);
  454. m_spinday.EnableWindow(1);
  455. }
  456. void YearForm2::KindChange()
  457. {
  458. int i=0;
  459. float incomeMember[12]={0}; // add by Jeff:会员卡值;
  460. float incomedata1[12]={0}; // 前期 - all remark by Jeff
  461. float incomedata2[12]={0}; // 摄影二销
  462. float incomedata3[12]={0}; // 化妆二销
  463. float incomedata4[12]={0}; // 套系升级二销
  464. float incomedata5[12]={0}; // 选片二销
  465. float incomedata6[12]={0}; // 其它二销
  466. float payoutdata[12]={0}; // 支出
  467. float fConsumeCards[12] = {0.0}; // add by Jeff:储值卡扣款;
  468. float fOtherIncome[12] = {0.0}; // add by Jeff:其他收入;
  469. CString stryear[12]={"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"};
  470. #if 1 // Jeff会员充值;
  471. for( i=0; i<memberarray.GetSize (); i++)
  472. {
  473. incomeMember[atoi(memberarray.ElementAt(i).ElementAt(4).Mid(5,2))-1] += atof(memberarray.ElementAt(i).ElementAt(3));
  474. }
  475. #endif
  476. for( i=0; i<List11array.GetSize (); i++) // 订单收入 ;
  477. {
  478. if (List11array.ElementAt(i).ElementAt(8) == "储值卡扣款") // Jeff add
  479. {
  480. fConsumeCards[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  481. //AfxMessageBox("订单收入==储值卡扣款");
  482. }
  483. if(List11array.ElementAt (i).ElementAt (5)=="预约收款"||List11array.ElementAt (i).ElementAt (5)=="预约补款")
  484. incomedata1[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  485. else if(List11array.ElementAt (i).ElementAt (5)=="摄影二销")
  486. incomedata2[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  487. else if(List11array.ElementAt (i).ElementAt (5)=="化妆二销")
  488. incomedata3[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  489. else if(List11array.ElementAt (i).ElementAt (5)=="套系升级二销")
  490. incomedata4[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  491. else if(List11array.ElementAt (i).ElementAt (5)=="选片二销")
  492. incomedata5[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  493. else if(List11array.ElementAt (i).ElementAt(5)!="")
  494. incomedata6[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  495. }
  496. /* -add by Jeff- */
  497. for ( i = 0; i < List2array.GetSize(); i++) // 其它收入;
  498. {
  499. if (List2array.ElementAt(i).ElementAt(9) == "储值卡扣款")
  500. {
  501. fConsumeCards[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  502. //AfxMessageBox("其它收入==储值卡扣款");
  503. }
  504. fOtherIncome[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  505. }
  506. /* for( i=0; i<List2array.GetSize (); i++)
  507. {
  508. if(List2array.ElementAt (i).ElementAt (8)=="摄影二销")
  509. incomedata2[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  510. else if(List2array.ElementAt (i).ElementAt (8)=="化妆二销")
  511. incomedata3[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  512. else if(List2array.ElementAt (i).ElementAt (8)=="套系升级二销")
  513. incomedata4[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  514. else if(List2array.ElementAt (i).ElementAt (8)=="选片二销")
  515. incomedata5[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  516. else if(List2array.ElementAt (i).ElementAt(8)!="")
  517. incomedata6[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  518. }*/
  519. for( i=0; i<other2salearray.GetSize (); i++)
  520. {
  521. if (other2salearray.ElementAt(i).ElementAt(7) == "储值卡扣款")
  522. {
  523. fConsumeCards[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  524. //AfxMessageBox("2销收入==储值卡扣款");
  525. }
  526. if(other2salearray.ElementAt (i).ElementAt (3)=="摄影二销")
  527. incomedata2[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  528. else if(other2salearray.ElementAt (i).ElementAt (3)=="化妆二销")
  529. incomedata3[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  530. else if(other2salearray.ElementAt (i).ElementAt (3)=="套系升级二销")
  531. incomedata4[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  532. else if(other2salearray.ElementAt (i).ElementAt (3)=="选片二销")
  533. incomedata5[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  534. else if(other2salearray.ElementAt (i).ElementAt(3)!="")
  535. incomedata6[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  536. }
  537. if(m_filter.IsEmpty ())
  538. {
  539. for( i=0; i<List3array.GetSize (); i++)
  540. {
  541. payoutdata[atoi(List3array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List3array.ElementAt (i).ElementAt (2));
  542. }
  543. }
  544. else
  545. {
  546. for( i=0; i<List3array.GetSize (); i++)
  547. {
  548. if(m_filter==List3array.ElementAt (i).ElementAt (1))
  549. payoutdata[atoi(List3array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List3array.ElementAt (i).ElementAt (2));
  550. }
  551. }
  552. int nRowCount=12;// VARIANT var;
  553. m_Chart.SetRowCount(nRowCount);
  554. m_Chart2.SetRowCount(nRowCount);
  555. m_Chart3.SetRowCount(nRowCount);
  556. float ftemp;
  557. if(m_radio2==0)//叠加
  558. {
  559. for(int row = 1; row <= nRowCount; ++row) // row月份
  560. {
  561. m_Chart.SetRow(row);
  562. m_Chart.SetRowLabel(stryear[row-1]);
  563. if(m_check1) // m_check1:总收入;
  564. //m_Chart.GetDataGrid().SetData(row, 1, incomedata1[row-1]+incomedata2[row-1]+incomedata3[row-1]+incomedata4[row-1]+incomedata5[row-1]+incomedata6[row-1], 0);//Jeff,没有卡值;
  565. m_Chart.GetDataGrid().SetData(row, 1,
  566. incomeMember[row-1]+
  567. incomedata1[row-1]+
  568. incomedata2[row-1]+
  569. incomedata3[row-1]+
  570. incomedata4[row-1]+
  571. incomedata5[row-1]+
  572. incomedata6[row-1]+
  573. fOtherIncome[row-1]-
  574. fConsumeCards[row-1],
  575. 0);//Jeff,有卡值;
  576. else
  577. {
  578. ftemp=0;
  579. if(m_check2)
  580. ftemp+=incomedata1[row-1];
  581. if(m_check3)
  582. ftemp+=incomedata2[row-1];
  583. if(m_check4)
  584. ftemp+=incomedata3[row-1];
  585. if(m_check5)
  586. ftemp+=incomedata4[row-1];
  587. if(m_check6)
  588. ftemp+=incomedata5[row-1];
  589. if(m_check7)
  590. ftemp+=incomedata6[row-1];
  591. m_Chart.GetDataGrid().SetData(row, 1, ftemp, 0);
  592. }
  593. }
  594. }
  595. else
  596. {
  597. for(int row = 1; row <= nRowCount; ++row)
  598. {
  599. m_Chart.SetRow(row);
  600. m_Chart.SetRowLabel(stryear[row-1]);
  601. m_Chart.GetDataGrid().SetData(row, 1, incomedata1[row-1], 0);
  602. m_Chart.GetDataGrid().SetData(row, 2, incomedata2[row-1], 0);
  603. m_Chart.GetDataGrid().SetData(row, 3, incomedata3[row-1], 0);
  604. m_Chart.GetDataGrid().SetData(row, 4, incomedata4[row-1], 0);
  605. m_Chart.GetDataGrid().SetData(row, 5, incomedata5[row-1], 0);
  606. m_Chart.GetDataGrid().SetData(row, 6, incomedata6[row-1], 0);
  607. }
  608. }
  609. for(int row = 1; row <= nRowCount; ++row)
  610. {
  611. m_Chart2.SetRow(row);
  612. m_Chart2.SetRowLabel(stryear[row-1]);
  613. m_Chart2.GetDataGrid().SetData(row, 1, payoutdata[row-1], 0);
  614. /* m_Chart3.SetRow(row);
  615. m_Chart3.SetRowLabel(stryear[row-1]);
  616. m_Chart3.GetDataGrid().SetData(row, 1, dindandata1[row-1]+dindandata2[row-1]+dindandata3[row-1]+dindandata4[row-1]+dindandata5[row-1], 0);
  617. m_Chart3.GetDataGrid().SetData(row, 2, dindandata1[row-1], 0);
  618. m_Chart3.GetDataGrid().SetData(row, 3, dindandata2[row-1], 0);
  619. m_Chart3.GetDataGrid().SetData(row, 4, dindandata3[row-1], 0);
  620. m_Chart3.GetDataGrid().SetData(row, 5, dindandata4[row-1], 0);
  621. m_Chart3.GetDataGrid().SetData(row, 6, dindandata5[row-1], 0);*/
  622. }
  623. m_Chart.Refresh();
  624. m_Chart2.Refresh();
  625. // m_Chart3.Refresh();
  626. }
  627. void YearForm2::OnRadio3()
  628. {
  629. // TODO: Add your control notification handler code here
  630. UpdateData();
  631. if(m_radio1==0)
  632. {
  633. m_Chart.SetChartType(3);
  634. m_Chart2.SetChartType(3);
  635. m_Chart3.SetChartType(3);
  636. }
  637. else if(m_radio1==1)
  638. {
  639. m_Chart.SetChartType(1);
  640. m_Chart2.SetChartType(1);
  641. m_Chart3.SetChartType(1);
  642. }
  643. else if(m_radio1==2)
  644. {
  645. m_Chart.SetChartType(14);
  646. m_Chart2.SetChartType(14);
  647. m_Chart3.SetChartType(14);
  648. }
  649. }
  650. void YearForm2::OnRadio4()
  651. {
  652. // TODO: Add your control notification handler code here
  653. OnRadio3();
  654. }
  655. void YearForm2::OnRadio5()
  656. {
  657. // TODO: Add your control notification handler code here
  658. OnRadio3();
  659. }
  660. void YearForm2::OnCheck1()
  661. {
  662. // TODO: Add your control notification handler code here
  663. UpdateData();
  664. m_check2=m_check3=m_check4=m_check5=m_check6=m_check7=m_check1;
  665. UpdateData(false);
  666. KindChange();
  667. }
  668. void YearForm2::OnCheck2()
  669. {
  670. // TODO: Add your control notification handler code here
  671. UpdateData();
  672. if(m_check2==0)
  673. {
  674. m_check1=m_check2;
  675. UpdateData(false);
  676. }
  677. KindChange();
  678. }
  679. void YearForm2::OnCheck3()
  680. {
  681. // TODO: Add your control notification handler code here
  682. UpdateData();
  683. if(m_check3==0)
  684. {
  685. m_check1=m_check3;
  686. UpdateData(false);
  687. }
  688. KindChange();
  689. }
  690. void YearForm2::OnCheck4()
  691. {
  692. // TODO: Add your control notification handler code here
  693. UpdateData();
  694. if(m_check4==0)
  695. {
  696. m_check1=m_check4;
  697. UpdateData(false);
  698. }
  699. KindChange();
  700. }
  701. void YearForm2::OnCheck5()
  702. {
  703. // TODO: Add your control notification handler code here
  704. UpdateData();
  705. if(m_check5==0)
  706. {
  707. m_check1=m_check5;
  708. UpdateData(false);
  709. }
  710. KindChange();
  711. }
  712. void YearForm2::OnCheck6()
  713. {
  714. // TODO: Add your control notification handler code here
  715. UpdateData();
  716. if(m_check6==0)
  717. {
  718. m_check1=m_check6;
  719. UpdateData(false);
  720. }
  721. KindChange();
  722. }
  723. void YearForm2::OnCheck7()
  724. {
  725. // TODO: Add your control notification handler code here
  726. UpdateData();
  727. if(m_check7==0)
  728. {
  729. m_check1=m_check7;
  730. UpdateData(false);
  731. }
  732. KindChange();
  733. }
  734. void YearForm2::OnRadio6() //叠加
  735. {
  736. // TODO: Add your control notification handler code here
  737. UpdateData();
  738. if(m_radio2==0)
  739. {
  740. m_Chart.SetColumnCount(1);
  741. m_Chart.SetColumn(1);
  742. m_Chart.SetColumnLabel((LPCTSTR)"总收入");
  743. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 0);
  744. // 线宽(对点线图有效)
  745. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetWidth(30);
  746. // 数据点类型显示数据值的模式(对柱柱状图和点线图有效)
  747. // 0: 不显示 1: 显示在柱状图外
  748. // 2: 显示在柱状图内上方 3: 显示在柱状图内中间 4: 显示在柱状图内下方
  749. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  750. }
  751. else
  752. {
  753. m_Chart.SetColumnCount(6);
  754. m_Chart.SetColumn(1);
  755. m_Chart.SetColumnLabel((LPCTSTR)"前期");
  756. m_Chart.SetColumn(2);
  757. m_Chart.SetColumnLabel((LPCTSTR)"摄影二销");
  758. m_Chart.SetColumn(3);
  759. m_Chart.SetColumnLabel((LPCTSTR)"化妆二销");
  760. m_Chart.SetColumn(4);
  761. m_Chart.SetColumnLabel((LPCTSTR)"套系升级");
  762. m_Chart.SetColumn(5);
  763. m_Chart.SetColumnLabel((LPCTSTR)"选片二销");
  764. m_Chart.SetColumn(6);
  765. m_Chart.SetColumnLabel((LPCTSTR)"其他收入");
  766. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 0);
  767. m_Chart.GetPlot().GetSeriesCollection().GetItem(2).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 255, 0);
  768. m_Chart.GetPlot().GetSeriesCollection().GetItem(3).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 0, 255);
  769. m_Chart.GetPlot().GetSeriesCollection().GetItem(4).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 255, 255);
  770. m_Chart.GetPlot().GetSeriesCollection().GetItem(5).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 255, 0);
  771. m_Chart.GetPlot().GetSeriesCollection().GetItem(6).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 255);
  772. // 线宽(对点线图有效)
  773. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetWidth(30);
  774. m_Chart.GetPlot().GetSeriesCollection().GetItem(2).GetPen().SetWidth(30);
  775. m_Chart.GetPlot().GetSeriesCollection().GetItem(3).GetPen().SetWidth(30);
  776. m_Chart.GetPlot().GetSeriesCollection().GetItem(4).GetPen().SetWidth(30);
  777. m_Chart.GetPlot().GetSeriesCollection().GetItem(5).GetPen().SetWidth(30);
  778. m_Chart.GetPlot().GetSeriesCollection().GetItem(6).GetPen().SetWidth(30);
  779. // 数据点类型显示数据值的模式(对柱柱状图和点线图有效)
  780. // 0: 不显示 1: 显示在柱状图外
  781. // 2: 显示在柱状图内上方 3: 显示在柱状图内中间 4: 显示在柱状图内下方
  782. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  783. m_Chart.GetPlot().GetSeriesCollection().GetItem(2).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  784. m_Chart.GetPlot().GetSeriesCollection().GetItem(3).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  785. m_Chart.GetPlot().GetSeriesCollection().GetItem(4).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  786. m_Chart.GetPlot().GetSeriesCollection().GetItem(5).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  787. m_Chart.GetPlot().GetSeriesCollection().GetItem(6).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  788. }
  789. GetDlgItem(IDC_CHECK1)->EnableWindow(m_radio2==0);
  790. GetDlgItem(IDC_CHECK2)->EnableWindow(m_radio2==0);
  791. GetDlgItem(IDC_CHECK3)->EnableWindow(m_radio2==0);
  792. GetDlgItem(IDC_CHECK4)->EnableWindow(m_radio2==0);
  793. GetDlgItem(IDC_CHECK5)->EnableWindow(m_radio2==0);
  794. GetDlgItem(IDC_CHECK6)->EnableWindow(m_radio2==0);
  795. GetDlgItem(IDC_CHECK7)->EnableWindow(m_radio2==0);
  796. KindChange();
  797. }
  798. void YearForm2::OnRadio7() //对比
  799. {
  800. // TODO: Add your control notification handler code here
  801. OnRadio6();
  802. }
  803. BEGIN_EVENTSINK_MAP(YearForm2, MyFormView)
  804. //{{AFX_EVENTSINK_MAP(YearForm2)
  805. ON_EVENT(YearForm2, IDC_MSCHART1, -601 /* DblClick */, OnDblClickMschart1, VTS_NONE)
  806. ON_EVENT(YearForm2, IDC_MSCHART2, -601 /* DblClick */, OnDblClickMschart2, VTS_NONE)
  807. ON_EVENT(YearForm2, IDC_MSCHART3, -601 /* DblClick */, OnDblClickMschart3, VTS_NONE)
  808. //}}AFX_EVENTSINK_MAP
  809. END_EVENTSINK_MAP()
  810. BOOL g_bShowMsChart=0;
  811. HWND g_hShowChartWnd=NULL;
  812. void YearForm2::OnDblClickMschart1()
  813. {
  814. // TODO: Add your control notification handler code here
  815. if(g_bShowMsChart)
  816. {
  817. ::SendMessage (g_hShowChartWnd, WM_CLOSE, 0, 0);
  818. return;
  819. }
  820. g_bShowMsChart=1;
  821. CRect rc;
  822. m_Chart.GetWindowRect (rc);
  823. ScreenToClient(rc);
  824. ShowMschart dlg;
  825. dlg.m_pParent =this;
  826. dlg.m_pChart=&m_Chart;
  827. dlg.DoModal ();
  828. m_Chart.MoveWindow (rc);
  829. g_bShowMsChart=0;
  830. }
  831. void YearForm2::OnDblClickMschart2()
  832. {
  833. // TODO: Add your control notification handler code here
  834. if(g_bShowMsChart)
  835. {
  836. ::SendMessage (g_hShowChartWnd, WM_CLOSE, 0, 0);
  837. return;
  838. }
  839. g_bShowMsChart=1;
  840. CRect rc;
  841. m_Chart2.GetWindowRect (rc);
  842. ScreenToClient(rc);
  843. ShowMschart dlg;
  844. dlg.m_pParent =this;
  845. dlg.m_pChart=&m_Chart2;
  846. dlg.DoModal ();
  847. m_Chart2.MoveWindow (rc);
  848. g_bShowMsChart=0;
  849. }
  850. void YearForm2::OnDblClickMschart3()
  851. {
  852. // TODO: Add your control notification handler code here
  853. if(g_bShowMsChart)
  854. {
  855. ::SendMessage (g_hShowChartWnd, WM_CLOSE, 0, 0);
  856. return;
  857. }
  858. g_bShowMsChart=1;
  859. CRect rc;
  860. m_Chart3.GetWindowRect (rc);
  861. ScreenToClient(rc);
  862. ShowMschart dlg;
  863. dlg.m_pParent =this;
  864. dlg.m_pChart=&m_Chart3;
  865. dlg.DoModal ();
  866. m_Chart3.MoveWindow (rc);
  867. g_bShowMsChart=0;
  868. }
  869. void YearForm2::TypeChange(CString str)
  870. {
  871. m_filter=str;
  872. KindChange();
  873. }
  874. void YearForm2::OnBUTprint()
  875. {
  876. // TODO: Add your control notification handler code here
  877. if(payoutdlg.GetSafeHwnd ()==NULL)
  878. {
  879. payoutdlg.Create (IDD_DLGPayOutSet, this);
  880. CRect rc,rc2;
  881. m_Chart.GetWindowRect (rc);
  882. m_Chart2.GetWindowRect (rc2);
  883. rc.bottom =rc2.bottom ;
  884. payoutdlg.MoveWindow2 (rc);
  885. payoutdlg.m_pParent=this;
  886. payoutdlg.m_mode=3;
  887. payoutdlg.ShowWindow (SW_SHOW);
  888. }
  889. else if(payoutdlg.IsWindowVisible ())
  890. {
  891. payoutdlg.ShowWindow (SW_HIDE);
  892. if(!m_filter.IsEmpty ())
  893. {
  894. m_filter.Empty ();
  895. KindChange();
  896. }
  897. }
  898. else
  899. payoutdlg.ShowWindow (SW_SHOW);
  900. }