YearForm2.cpp 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020
  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. #ifdef CHILD_VERSION
  231. SetDlgItemText(IDC_CHECK4, _T("引导二销"));
  232. #endif
  233. DateChange();
  234. }
  235. void YearForm2::FillGrid()
  236. {
  237. }
  238. void YearForm2::OnBUTclose()
  239. {
  240. // TODO: Add your control notification handler code here
  241. GetParent()->SendMessage(WM_CLOSE);
  242. }
  243. void YearForm2::OnChangeEDITyear()
  244. {
  245. // TODO: If this is a RICHEDIT control, the control will not
  246. // send this notification unless you override the MyFormView::OnInitDialog()
  247. // function and call CRichEditCtrl().SetEventMask()
  248. // with the ENM_CHANGE flag ORed into the mask.
  249. DateChange();
  250. // TODO: Add your control notification handler code here
  251. }
  252. void YearForm2::OnChangeEDITmonth()
  253. {
  254. // TODO: If this is a RICHEDIT control, the control will not
  255. // send this notification unless you override the MyFormView::OnInitDialog()
  256. // function and call CRichEditCtrl().SetEventMask()
  257. // with the ENM_CHANGE flag ORed into the mask.
  258. // DateChange();
  259. // TODO: Add your control notification handler code here
  260. }
  261. void YearForm2::OnChangeEDITday()
  262. {
  263. // TODO: If this is a RICHEDIT control, the control will not
  264. // send this notification unless you override the MyFormView::OnInitDialog()
  265. // function and call CRichEditCtrl().SetEventMask()
  266. // with the ENM_CHANGE flag ORed into the mask.
  267. // DateChange();
  268. // TODO: Add your control notification handler code here
  269. }
  270. void YearForm2::DateChange()
  271. {
  272. if(m_bInit==0)return;
  273. m_spinyear.EnableWindow(0);
  274. m_spinmonth.EnableWindow(0);
  275. m_spinday.EnableWindow(0);
  276. UpdateData();
  277. int i;
  278. int g_nYearposTemp=g_nYearpos;
  279. BOOL bLastYear=0;
  280. BOOL bThisYear=0;
  281. #if JEFF_TEST_ON // 2015开始禁用跨年数据;
  282. int g_nYearposPre = -1;
  283. if (m_year >= 2014 && m_year <= atoi(g_date.Left(4)) && g_hisyeararray.GetSize())
  284. {
  285. g_nYearpos = -1;
  286. bThisYear = 1;
  287. if (m_year == 2014)
  288. {
  289. g_nYearposPre = GetYearPos(m_year - 1);
  290. }
  291. }
  292. else if (m_year <= 2013 && g_hisyeararray.GetSize())
  293. {
  294. g_nYearpos = GetYearPos(m_year);
  295. if (g_nYearpos != -1)
  296. g_nYearposPre = GetYearPos(m_year - 1);
  297. bLastYear = 1;
  298. }
  299. #else
  300. if(m_year==atoi(g_date.Left (4)) && g_hisyeararray.GetSize () )
  301. bThisYear=1;
  302. else if(m_year<=atoi(g_date.Left (4))-1 && g_hisyeararray.GetSize ())
  303. bLastYear=1;
  304. g_nYearpos=GetYearPos(m_year);
  305. int g_nYearposPre=GetYearPos(m_year-1);
  306. #endif
  307. g_sendhead.bsql=0;
  308. g_sendhead.code[0]=14; // 其他收入;
  309. g_sendhead.code[1]=13; // 支出;
  310. g_sendhead.code[2]=16; // 订单收入;
  311. g_sendhead.code[3]=198; // 二销收入;
  312. #if 0 // Jeff
  313. g_sendhead.tabcount=4;
  314. #else
  315. g_sendhead.code[4]=216; // 会员充值;
  316. g_sendhead.tabcount=5;
  317. #endif
  318. CString sql,strdate,strdate2;
  319. strdate.Format ("%04d-%02d-%02d", m_year, 1, 1);
  320. strdate2.Format ("%04d-%02d-%02d", m_year, 12, 31);
  321. CRect rc;
  322. m_static1.GetWindowRect (rc);
  323. ScreenToClient(rc);
  324. InvalidateRect(rc);
  325. m_static1.SetWindowText (strdate.Left (4)+"年财务表");
  326. sql = _T("dat>='") + strdate + _T("' and dat<='") + strdate2 + _T("' and (sale2type is null or sale2type='');dat>='") + strdate + _T("' and dat<='") + strdate2 + _T("';date>='") + strdate + _T("' and date<='") + strdate2 + _T("';date>='") + strdate + _T("' and date<='") + strdate2 + _T("'; date>='") + strdate + _T("' and date<='") + strdate2 + _T("'");
  327. g_pMainWnd->ProcessChatMessageRequest2(sql);
  328. if(g_bSendOK==0)
  329. {
  330. g_nYearpos=g_nYearposTemp;
  331. m_spinyear.EnableWindow(1);
  332. m_spinmonth.EnableWindow(1);
  333. m_spinday.EnableWindow(1);
  334. return;
  335. }
  336. #if 0
  337. DataToArray(&List2array,&List3array,&List11array,&other2salearray); // Jeff delete;
  338. #else
  339. DataToArray(&List2array,&List3array,&List11array,&other2salearray,&memberarray); // Jeff添加会员充值;
  340. #endif
  341. if(bLastYear)//如果是去年, 则加今年的补款
  342. {
  343. g_nYearpos=-1;//今年
  344. g_sendhead.bsql=0;
  345. g_sendhead.code[0]=14; // 其他收入;
  346. g_sendhead.code[1]=13; // 支出;
  347. g_sendhead.code[2]=16; // 订单收入;
  348. g_sendhead.code[3]=198; // 二销收入;
  349. #if 0
  350. g_sendhead.tabcount=4;
  351. #else
  352. g_sendhead.code[4]=216; // 会员充值;
  353. g_sendhead.tabcount=5;
  354. #endif
  355. g_pMainWnd->ProcessChatMessageRequest2(sql);
  356. if(g_bSendOK==0)
  357. {
  358. g_nYearpos=g_nYearposTemp;
  359. m_spinyear.EnableWindow(1);
  360. m_spinmonth.EnableWindow(1);
  361. m_spinday.EnableWindow(1);
  362. return;
  363. }
  364. CArray<CStringArray, CStringArray>ThisYearList11array;
  365. CArray<CStringArray, CStringArray>ThisYearList3array;
  366. CArray<CStringArray, CStringArray>ThisYearList2array;
  367. CArray<CStringArray, CStringArray>ThisYearother2salearray;
  368. #if 0
  369. DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray);
  370. #else
  371. CArray<CStringArray, CStringArray>ThisYearmemberarray;
  372. DataToArray(&ThisYearList2array,&ThisYearList3array,&ThisYearList11array,&ThisYearother2salearray,&ThisYearmemberarray); // Jeff添加会员充值;
  373. #endif
  374. int oldsize=List11array.GetSize ();
  375. List11array.SetSize(oldsize+ThisYearList11array.GetSize ());
  376. for(i=oldsize; i<oldsize+ThisYearList11array.GetSize (); i++)
  377. {
  378. List11array.ElementAt (i).Copy(ThisYearList11array.ElementAt (i-oldsize));
  379. }
  380. oldsize=List3array.GetSize ();
  381. List3array.SetSize(oldsize+ThisYearList3array.GetSize ());
  382. for(i=oldsize; i<oldsize+ThisYearList3array.GetSize (); i++)
  383. {
  384. List3array.ElementAt (i).Copy(ThisYearList3array.ElementAt (i-oldsize));
  385. }
  386. oldsize=List2array.GetSize ();
  387. List2array.SetSize(oldsize+ThisYearList2array.GetSize ());
  388. for(i=oldsize; i<oldsize+ThisYearList2array.GetSize (); i++)
  389. {
  390. List2array.ElementAt (i).Copy(ThisYearList2array.ElementAt (i-oldsize));
  391. }
  392. oldsize=other2salearray.GetSize ();
  393. other2salearray.SetSize(oldsize+ThisYearother2salearray.GetSize ());
  394. for(i=oldsize; i<oldsize+ThisYearother2salearray.GetSize (); i++)
  395. {
  396. other2salearray.ElementAt (i).Copy(ThisYearother2salearray.ElementAt (i-oldsize));
  397. }
  398. #if 1 // 添加会员充值;
  399. oldsize=memberarray.GetSize();
  400. memberarray.SetSize(oldsize+ThisYearmemberarray.GetSize());
  401. for (i=oldsize;i<oldsize+ThisYearmemberarray.GetSize();i++)
  402. {
  403. memberarray.ElementAt(i).Copy(ThisYearmemberarray.ElementAt(i-oldsize));
  404. }
  405. #endif
  406. }
  407. if(g_nYearposPre!=-1)//如果是今年, 则加去年的补款
  408. {
  409. g_nYearpos=g_nYearposPre;//去年
  410. g_sendhead.bsql=0;
  411. g_sendhead.code[0]=14; // 其他收入;
  412. g_sendhead.code[1]=13; // 支出;
  413. g_sendhead.code[2]=16; // 订单收入;
  414. g_sendhead.code[3]=198; // 二销收入;
  415. #if 0
  416. g_sendhead.tabcount=4;
  417. #else
  418. g_sendhead.code[4]=216; // 会员充值;
  419. g_sendhead.tabcount=5;
  420. #endif
  421. g_pMainWnd->ProcessChatMessageRequest2(sql);
  422. if(g_bSendOK==0)
  423. {
  424. g_nYearpos=g_nYearposTemp;
  425. m_spinyear.EnableWindow(1);
  426. m_spinmonth.EnableWindow(1);
  427. m_spinday.EnableWindow(1);
  428. return;
  429. }
  430. CArray<CStringArray, CStringArray>ThisYearList11array;
  431. CArray<CStringArray, CStringArray>ThisYearList3array;
  432. CArray<CStringArray, CStringArray>ThisYearList2array;
  433. CArray<CStringArray, CStringArray>ThisYearother2salearray;
  434. #if 0
  435. DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray);
  436. #else
  437. CArray<CStringArray, CStringArray>ThisYearmemberarray;
  438. DataToArray(&ThisYearList2array,&ThisYearList3array,&ThisYearList11array,&ThisYearother2salearray,&ThisYearmemberarray); // Jeff添加会员充值;
  439. #endif
  440. int oldsize=List11array.GetSize ();
  441. List11array.SetSize(oldsize+ThisYearList11array.GetSize ());
  442. for(i=oldsize; i<oldsize+ThisYearList11array.GetSize (); i++)
  443. {
  444. List11array.ElementAt (i).Copy(ThisYearList11array.ElementAt (i-oldsize));
  445. }
  446. oldsize=List3array.GetSize ();
  447. List3array.SetSize(oldsize+ThisYearList3array.GetSize ());
  448. for(i=oldsize; i<oldsize+ThisYearList3array.GetSize (); i++)
  449. {
  450. List3array.ElementAt (i).Copy(ThisYearList3array.ElementAt (i-oldsize));
  451. }
  452. oldsize=List2array.GetSize ();
  453. List2array.SetSize(oldsize+ThisYearList2array.GetSize ());
  454. for(i=oldsize; i<oldsize+ThisYearList2array.GetSize (); i++)
  455. {
  456. List2array.ElementAt (i).Copy(ThisYearList2array.ElementAt (i-oldsize));
  457. }
  458. oldsize=other2salearray.GetSize ();
  459. other2salearray.SetSize(oldsize+ThisYearother2salearray.GetSize ());
  460. for(i=oldsize; i<oldsize+ThisYearother2salearray.GetSize (); i++)
  461. {
  462. other2salearray.ElementAt (i).Copy(ThisYearother2salearray.ElementAt (i-oldsize));
  463. }
  464. #if 1 // 添加会员充值;
  465. oldsize=memberarray.GetSize();
  466. memberarray.SetSize(oldsize+ThisYearmemberarray.GetSize());
  467. for (i=oldsize;i<oldsize+ThisYearmemberarray.GetSize();i++)
  468. {
  469. memberarray.ElementAt(i).Copy(ThisYearmemberarray.ElementAt(i-oldsize));
  470. }
  471. #endif
  472. }
  473. g_nYearpos=g_nYearposTemp;
  474. KindChange();
  475. m_spinyear.EnableWindow(1);
  476. m_spinmonth.EnableWindow(1);
  477. m_spinday.EnableWindow(1);
  478. }
  479. void YearForm2::KindChange()
  480. {
  481. int i=0;
  482. float incomeMember[12]={0}; // add by Jeff:会员卡值;
  483. float incomedata1[12]={0}; // 前期 - all remark by Jeff
  484. float incomedata2[12]={0}; // 摄影二销
  485. float incomedata3[12]={0}; // 化妆二销
  486. float incomedata4[12]={0}; // 套系升级二销
  487. float incomedata5[12]={0}; // 选片二销
  488. float incomedata6[12]={0}; // 其它二销
  489. float payoutdata[12]={0}; // 支出
  490. float fConsumeCards[12] = {0.0}; // add by Jeff:储值卡扣款;
  491. float fOtherIncome[12] = {0.0}; // add by Jeff:其他收入;
  492. CString stryear[12]={"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"};
  493. #if 1 // Jeff会员充值;
  494. for( i=0; i<memberarray.GetSize (); i++)
  495. {
  496. incomeMember[atoi(memberarray.ElementAt(i).ElementAt(4).Mid(5,2))-1] += atof(memberarray.ElementAt(i).ElementAt(3));
  497. }
  498. #endif
  499. for( i=0; i<List11array.GetSize (); i++) // 订单收入 ;
  500. {
  501. if (List11array.ElementAt(i).ElementAt(8) == "储值卡扣款") // Jeff add
  502. {
  503. fConsumeCards[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  504. //AfxMessageBox("订单收入==储值卡扣款");
  505. }
  506. if(List11array.ElementAt (i).ElementAt (5)=="预约收款"||List11array.ElementAt (i).ElementAt (5)=="预约补款")
  507. incomedata1[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  508. else if(List11array.ElementAt (i).ElementAt (5)=="摄影二销")
  509. incomedata2[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  510. #ifndef CHILD_VERSION
  511. else if(List11array.ElementAt (i).ElementAt (5)=="化妆二销")
  512. #else
  513. else if(List11array.ElementAt (i).ElementAt (5)=="引导二销")
  514. #endif
  515. incomedata3[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  516. else if(List11array.ElementAt (i).ElementAt (5)=="套系升级二销")
  517. incomedata4[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  518. else if(List11array.ElementAt (i).ElementAt (5)=="选片二销")
  519. incomedata5[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  520. else if(List11array.ElementAt (i).ElementAt(5)!="")
  521. incomedata6[atoi(List11array.ElementAt (i).ElementAt (7).Mid (5, 2))-1]+=atof(List11array.ElementAt (i).ElementAt (4));
  522. }
  523. /* -add by Jeff- */
  524. for ( i = 0; i < List2array.GetSize(); i++) // 其它收入;
  525. {
  526. if (List2array.ElementAt(i).ElementAt(9) == "储值卡扣款")
  527. {
  528. fConsumeCards[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  529. //AfxMessageBox("其它收入==储值卡扣款");
  530. }
  531. fOtherIncome[atoi(List2array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List2array.ElementAt (i).ElementAt (2));
  532. }
  533. for( i=0; i<other2salearray.GetSize (); i++)
  534. {
  535. if (other2salearray.ElementAt(i).ElementAt(7) == "储值卡扣款")
  536. {
  537. fConsumeCards[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  538. //AfxMessageBox("2销收入==储值卡扣款");
  539. }
  540. if(other2salearray.ElementAt (i).ElementAt (3)=="摄影二销")
  541. incomedata2[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  542. #ifndef CHILD_VERSION
  543. else if(other2salearray.ElementAt (i).ElementAt (3)=="化妆二销")
  544. #else
  545. else if(other2salearray.ElementAt (i).ElementAt (3)=="化妆二销")//"引导二销"
  546. #endif
  547. incomedata3[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  548. else if(other2salearray.ElementAt (i).ElementAt (3)=="套系升级二销")
  549. incomedata4[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  550. else if(other2salearray.ElementAt (i).ElementAt (3)=="选片二销")
  551. incomedata5[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  552. else if(other2salearray.ElementAt (i).ElementAt(3)!="")
  553. incomedata6[atoi(other2salearray.ElementAt (i).ElementAt (5).Mid (5, 2))-1]+=atof(other2salearray.ElementAt (i).ElementAt (4));
  554. }
  555. if(m_filter.IsEmpty ())
  556. {
  557. for( i=0; i<List3array.GetSize (); i++)
  558. {
  559. payoutdata[atoi(List3array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List3array.ElementAt (i).ElementAt (2));
  560. }
  561. }
  562. else
  563. {
  564. for( i=0; i<List3array.GetSize (); i++)
  565. {
  566. if(m_filter==List3array.ElementAt (i).ElementAt (1))
  567. payoutdata[atoi(List3array.ElementAt (i).ElementAt (3).Mid (5, 2))-1]+=atof(List3array.ElementAt (i).ElementAt (2));
  568. }
  569. }
  570. int nRowCount=12;// VARIANT var;
  571. m_Chart.SetRowCount(nRowCount);
  572. m_Chart2.SetRowCount(nRowCount);
  573. m_Chart3.SetRowCount(nRowCount);
  574. float ftemp;
  575. if(m_radio2==0)//叠加
  576. {
  577. for(int row = 1; row <= nRowCount; ++row) // row月份
  578. {
  579. m_Chart.SetRow(row);
  580. m_Chart.SetRowLabel(stryear[row-1]);
  581. if(m_check1) // m_check1:总收入;
  582. //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,没有卡值;
  583. m_Chart.GetDataGrid().SetData(row, 1,
  584. incomeMember[row-1]+
  585. incomedata1[row-1]+
  586. incomedata2[row-1]+
  587. incomedata3[row-1]+
  588. incomedata4[row-1]+
  589. incomedata5[row-1]+
  590. incomedata6[row-1]+
  591. fOtherIncome[row-1]-
  592. fConsumeCards[row-1],
  593. 0);//Jeff,有卡值;
  594. else
  595. {
  596. ftemp=0;
  597. if(m_check2)
  598. ftemp+=incomedata1[row-1];
  599. if(m_check3)
  600. ftemp+=incomedata2[row-1];
  601. if(m_check4)
  602. ftemp+=incomedata3[row-1];
  603. if(m_check5)
  604. ftemp+=incomedata4[row-1];
  605. if(m_check6)
  606. ftemp+=incomedata5[row-1];
  607. if(m_check7)
  608. ftemp+=incomedata6[row-1];
  609. m_Chart.GetDataGrid().SetData(row, 1, ftemp, 0);
  610. }
  611. }
  612. }
  613. else
  614. {
  615. for(int row = 1; row <= nRowCount; ++row)
  616. {
  617. m_Chart.SetRow(row);
  618. m_Chart.SetRowLabel(stryear[row-1]);
  619. m_Chart.GetDataGrid().SetData(row, 1, incomedata1[row-1], 0);
  620. m_Chart.GetDataGrid().SetData(row, 2, incomedata2[row-1], 0);
  621. m_Chart.GetDataGrid().SetData(row, 3, incomedata3[row-1], 0);
  622. m_Chart.GetDataGrid().SetData(row, 4, incomedata4[row-1], 0);
  623. m_Chart.GetDataGrid().SetData(row, 5, incomedata5[row-1], 0);
  624. m_Chart.GetDataGrid().SetData(row, 6, incomedata6[row-1], 0);
  625. }
  626. }
  627. for(int row = 1; row <= nRowCount; ++row)
  628. {
  629. m_Chart2.SetRow(row);
  630. m_Chart2.SetRowLabel(stryear[row-1]);
  631. m_Chart2.GetDataGrid().SetData(row, 1, payoutdata[row-1], 0);
  632. /* m_Chart3.SetRow(row);
  633. m_Chart3.SetRowLabel(stryear[row-1]);
  634. m_Chart3.GetDataGrid().SetData(row, 1, dindandata1[row-1]+dindandata2[row-1]+dindandata3[row-1]+dindandata4[row-1]+dindandata5[row-1], 0);
  635. m_Chart3.GetDataGrid().SetData(row, 2, dindandata1[row-1], 0);
  636. m_Chart3.GetDataGrid().SetData(row, 3, dindandata2[row-1], 0);
  637. m_Chart3.GetDataGrid().SetData(row, 4, dindandata3[row-1], 0);
  638. m_Chart3.GetDataGrid().SetData(row, 5, dindandata4[row-1], 0);
  639. m_Chart3.GetDataGrid().SetData(row, 6, dindandata5[row-1], 0);*/
  640. }
  641. m_Chart.Refresh();
  642. m_Chart2.Refresh();
  643. // m_Chart3.Refresh();
  644. }
  645. void YearForm2::OnRadio3()
  646. {
  647. // TODO: Add your control notification handler code here
  648. UpdateData();
  649. if(m_radio1==0)
  650. {
  651. m_Chart.SetChartType(3);
  652. m_Chart2.SetChartType(3);
  653. m_Chart3.SetChartType(3);
  654. }
  655. else if(m_radio1==1)
  656. {
  657. m_Chart.SetChartType(1);
  658. m_Chart2.SetChartType(1);
  659. m_Chart3.SetChartType(1);
  660. }
  661. else if(m_radio1==2)
  662. {
  663. m_Chart.SetChartType(14);
  664. m_Chart2.SetChartType(14);
  665. m_Chart3.SetChartType(14);
  666. }
  667. }
  668. void YearForm2::OnRadio4()
  669. {
  670. // TODO: Add your control notification handler code here
  671. OnRadio3();
  672. }
  673. void YearForm2::OnRadio5()
  674. {
  675. // TODO: Add your control notification handler code here
  676. OnRadio3();
  677. }
  678. void YearForm2::OnCheck1()
  679. {
  680. // TODO: Add your control notification handler code here
  681. UpdateData();
  682. m_check2=m_check3=m_check4=m_check5=m_check6=m_check7=m_check1;
  683. UpdateData(false);
  684. KindChange();
  685. }
  686. void YearForm2::OnCheck2()
  687. {
  688. // TODO: Add your control notification handler code here
  689. UpdateData();
  690. if(m_check2==0)
  691. {
  692. m_check1=m_check2;
  693. UpdateData(false);
  694. }
  695. KindChange();
  696. }
  697. void YearForm2::OnCheck3()
  698. {
  699. // TODO: Add your control notification handler code here
  700. UpdateData();
  701. if(m_check3==0)
  702. {
  703. m_check1=m_check3;
  704. UpdateData(false);
  705. }
  706. KindChange();
  707. }
  708. void YearForm2::OnCheck4()
  709. {
  710. // TODO: Add your control notification handler code here
  711. UpdateData();
  712. if(m_check4==0)
  713. {
  714. m_check1=m_check4;
  715. UpdateData(false);
  716. }
  717. KindChange();
  718. }
  719. void YearForm2::OnCheck5()
  720. {
  721. // TODO: Add your control notification handler code here
  722. UpdateData();
  723. if(m_check5==0)
  724. {
  725. m_check1=m_check5;
  726. UpdateData(false);
  727. }
  728. KindChange();
  729. }
  730. void YearForm2::OnCheck6()
  731. {
  732. // TODO: Add your control notification handler code here
  733. UpdateData();
  734. if(m_check6==0)
  735. {
  736. m_check1=m_check6;
  737. UpdateData(false);
  738. }
  739. KindChange();
  740. }
  741. void YearForm2::OnCheck7()
  742. {
  743. // TODO: Add your control notification handler code here
  744. UpdateData();
  745. if(m_check7==0)
  746. {
  747. m_check1=m_check7;
  748. UpdateData(false);
  749. }
  750. KindChange();
  751. }
  752. void YearForm2::OnRadio6() //叠加
  753. {
  754. // TODO: Add your control notification handler code here
  755. UpdateData();
  756. if(m_radio2==0)
  757. {
  758. m_Chart.SetColumnCount(1);
  759. m_Chart.SetColumn(1);
  760. m_Chart.SetColumnLabel((LPCTSTR)"总收入");
  761. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 0);
  762. // 线宽(对点线图有效)
  763. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetWidth(30);
  764. // 数据点类型显示数据值的模式(对柱柱状图和点线图有效)
  765. // 0: 不显示 1: 显示在柱状图外
  766. // 2: 显示在柱状图内上方 3: 显示在柱状图内中间 4: 显示在柱状图内下方
  767. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  768. }
  769. else
  770. {
  771. m_Chart.SetColumnCount(6);
  772. m_Chart.SetColumn(1);
  773. m_Chart.SetColumnLabel((LPCTSTR)"前期");
  774. m_Chart.SetColumn(2);
  775. m_Chart.SetColumnLabel((LPCTSTR)"摄影二销");
  776. m_Chart.SetColumn(3);
  777. #ifndef CHILD_VERSION
  778. m_Chart.SetColumnLabel((LPCTSTR)"化妆二销");
  779. #else
  780. m_Chart.SetColumnLabel((LPCTSTR)"引导二销");//"引导二销"
  781. #endif
  782. m_Chart.SetColumn(4);
  783. m_Chart.SetColumnLabel((LPCTSTR)"套系升级");
  784. m_Chart.SetColumn(5);
  785. m_Chart.SetColumnLabel((LPCTSTR)"选片二销");
  786. m_Chart.SetColumn(6);
  787. m_Chart.SetColumnLabel((LPCTSTR)"其他收入");
  788. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 0);
  789. m_Chart.GetPlot().GetSeriesCollection().GetItem(2).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 255, 0);
  790. m_Chart.GetPlot().GetSeriesCollection().GetItem(3).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 0, 255);
  791. m_Chart.GetPlot().GetSeriesCollection().GetItem(4).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(0, 255, 255);
  792. m_Chart.GetPlot().GetSeriesCollection().GetItem(5).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 255, 0);
  793. m_Chart.GetPlot().GetSeriesCollection().GetItem(6).GetDataPoints ().GetItem(-1).GetBrush ().GetFillColor ().Set(255, 0, 255);
  794. // 线宽(对点线图有效)
  795. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetWidth(30);
  796. m_Chart.GetPlot().GetSeriesCollection().GetItem(2).GetPen().SetWidth(30);
  797. m_Chart.GetPlot().GetSeriesCollection().GetItem(3).GetPen().SetWidth(30);
  798. m_Chart.GetPlot().GetSeriesCollection().GetItem(4).GetPen().SetWidth(30);
  799. m_Chart.GetPlot().GetSeriesCollection().GetItem(5).GetPen().SetWidth(30);
  800. m_Chart.GetPlot().GetSeriesCollection().GetItem(6).GetPen().SetWidth(30);
  801. // 数据点类型显示数据值的模式(对柱柱状图和点线图有效)
  802. // 0: 不显示 1: 显示在柱状图外
  803. // 2: 显示在柱状图内上方 3: 显示在柱状图内中间 4: 显示在柱状图内下方
  804. m_Chart.GetPlot().GetSeriesCollection().GetItem(1).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  805. m_Chart.GetPlot().GetSeriesCollection().GetItem(2).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  806. m_Chart.GetPlot().GetSeriesCollection().GetItem(3).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  807. m_Chart.GetPlot().GetSeriesCollection().GetItem(4).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  808. m_Chart.GetPlot().GetSeriesCollection().GetItem(5).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  809. m_Chart.GetPlot().GetSeriesCollection().GetItem(6).GetDataPoints().GetItem(-1).GetDataPointLabel().SetLocationType(1);
  810. }
  811. GetDlgItem(IDC_CHECK1)->EnableWindow(m_radio2==0);
  812. GetDlgItem(IDC_CHECK2)->EnableWindow(m_radio2==0);
  813. GetDlgItem(IDC_CHECK3)->EnableWindow(m_radio2==0);
  814. GetDlgItem(IDC_CHECK4)->EnableWindow(m_radio2==0);
  815. GetDlgItem(IDC_CHECK5)->EnableWindow(m_radio2==0);
  816. GetDlgItem(IDC_CHECK6)->EnableWindow(m_radio2==0);
  817. GetDlgItem(IDC_CHECK7)->EnableWindow(m_radio2==0);
  818. KindChange();
  819. }
  820. void YearForm2::OnRadio7() //对比
  821. {
  822. // TODO: Add your control notification handler code here
  823. OnRadio6();
  824. }
  825. BEGIN_EVENTSINK_MAP(YearForm2, MyFormView)
  826. //{{AFX_EVENTSINK_MAP(YearForm2)
  827. ON_EVENT(YearForm2, IDC_MSCHART1, -601 /* DblClick */, OnDblClickMschart1, VTS_NONE)
  828. ON_EVENT(YearForm2, IDC_MSCHART2, -601 /* DblClick */, OnDblClickMschart2, VTS_NONE)
  829. ON_EVENT(YearForm2, IDC_MSCHART3, -601 /* DblClick */, OnDblClickMschart3, VTS_NONE)
  830. //}}AFX_EVENTSINK_MAP
  831. END_EVENTSINK_MAP()
  832. BOOL g_bShowMsChart=0;
  833. HWND g_hShowChartWnd=NULL;
  834. void YearForm2::OnDblClickMschart1()
  835. {
  836. // TODO: Add your control notification handler code here
  837. if(g_bShowMsChart)
  838. {
  839. ::SendMessage (g_hShowChartWnd, WM_CLOSE, 0, 0);
  840. return;
  841. }
  842. g_bShowMsChart=1;
  843. CRect rc;
  844. m_Chart.GetWindowRect (rc);
  845. ScreenToClient(rc);
  846. ShowMschart dlg;
  847. dlg.m_pParent =this;
  848. dlg.m_pChart=&m_Chart;
  849. dlg.DoModal ();
  850. m_Chart.MoveWindow (rc);
  851. g_bShowMsChart=0;
  852. }
  853. void YearForm2::OnDblClickMschart2()
  854. {
  855. // TODO: Add your control notification handler code here
  856. if(g_bShowMsChart)
  857. {
  858. ::SendMessage (g_hShowChartWnd, WM_CLOSE, 0, 0);
  859. return;
  860. }
  861. g_bShowMsChart=1;
  862. CRect rc;
  863. m_Chart2.GetWindowRect (rc);
  864. ScreenToClient(rc);
  865. ShowMschart dlg;
  866. dlg.m_pParent =this;
  867. dlg.m_pChart=&m_Chart2;
  868. dlg.DoModal ();
  869. m_Chart2.MoveWindow (rc);
  870. g_bShowMsChart=0;
  871. }
  872. void YearForm2::OnDblClickMschart3()
  873. {
  874. // TODO: Add your control notification handler code here
  875. if(g_bShowMsChart)
  876. {
  877. ::SendMessage (g_hShowChartWnd, WM_CLOSE, 0, 0);
  878. return;
  879. }
  880. g_bShowMsChart=1;
  881. CRect rc;
  882. m_Chart3.GetWindowRect (rc);
  883. ScreenToClient(rc);
  884. ShowMschart dlg;
  885. dlg.m_pParent =this;
  886. dlg.m_pChart=&m_Chart3;
  887. dlg.DoModal ();
  888. m_Chart3.MoveWindow (rc);
  889. g_bShowMsChart=0;
  890. }
  891. void YearForm2::TypeChange(CString str)
  892. {
  893. m_filter=str;
  894. KindChange();
  895. }
  896. void YearForm2::OnBUTprint()
  897. {
  898. // TODO: Add your control notification handler code here
  899. if(payoutdlg.GetSafeHwnd ()==NULL)
  900. {
  901. payoutdlg.Create (IDD_DLGPayOutSet, this);
  902. CRect rc,rc2;
  903. m_Chart.GetWindowRect (rc);
  904. m_Chart2.GetWindowRect (rc2);
  905. rc.bottom =rc2.bottom ;
  906. payoutdlg.MoveWindow2 (rc);
  907. payoutdlg.m_pParent=this;
  908. payoutdlg.m_mode=3;
  909. payoutdlg.ShowWindow (SW_SHOW);
  910. }
  911. else if(payoutdlg.IsWindowVisible ())
  912. {
  913. payoutdlg.ShowWindow (SW_HIDE);
  914. if(!m_filter.IsEmpty ())
  915. {
  916. m_filter.Empty ();
  917. KindChange();
  918. }
  919. }
  920. else
  921. payoutdlg.ShowWindow (SW_SHOW);
  922. }