YearForm2.cpp 33 KB

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