AnalyzedOrderOperatingFormMain.cs 102 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496
  1. using LYFZ.Model;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. using System.Windows.Forms.DataVisualization.Charting;
  12. namespace LYFZ.Software.MainBusiness.DecisionAssistant
  13. {
  14. public partial class AnalyzedOrderOperatingFormMain : LYFZ.Software.UI.DecisionAssistant.AnalyzedOrderOperatingFormMain
  15. {
  16. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  17. List<ModelImagePostionAction> actionList = new List<ModelImagePostionAction>();
  18. public AnalyzedOrderOperatingFormMain()
  19. {
  20. this.Load += AnalyzedOrderOperatingFormMain_Load;
  21. this.Shown += AnalyzedOrderOperatingFormMain_Shown;
  22. this.btnQuery.Click += btnQuery_Click;
  23. this.btnQueryCompared.Click += btnQueryCompared_Click;
  24. this.btnSaveAs.Click += btnSaveAs_Click;
  25. this.btnColseed.Click += btnColseed_Click;
  26. this.chkComparedStartUp.Click += chkComparedStartUp_Click;
  27. this.dtDataTimeStart.Leave += dtDataTimeStart_Leave;
  28. this.dtDataTimeStartCompared.Leave += dtDataTimeStartCompared_Leave;
  29. this.cmbtreevDisplayItem.ComboBoxTree_NodeMouseClick += cmbtreevDisplayItem_ComboBoxTree_NodeMouseClick;
  30. this.cmbtreevDisplayMethod.ComboBoxTree_NodeMouseClick += cmbtreevDisplayMethod_ComboBoxTree_NodeMouseClick;
  31. this.Resize += AnalyzedOrderOperatingFormMain_Resize;
  32. this.PictImage.MouseDoubleClick += PictImage_MouseDoubleClick;
  33. }
  34. void PictImage_MouseDoubleClick(object sender, MouseEventArgs e)
  35. {
  36. ModelImagePostionAction action = actionList.Find(p => p.MouseX <= e.Location.X && e.Location.X <= (p.MouseX + p.MouseWidth)
  37. &&
  38. p.MouseY <= e.Location.Y && e.Location.Y <= (p.MouseY + p.MouseHeight));
  39. if(action!=null)
  40. {
  41. LYFZ.Software.MainBusiness.DecisionAssistant.SetSmallForm.AnalyzedOrderDetailSmallForm detailForm = new SetSmallForm.AnalyzedOrderDetailSmallForm();
  42. detailForm.BindDataGridView(action);
  43. detailForm.ShowDialog();
  44. //MessageBox.Show("内容!");
  45. }
  46. }
  47. bool IsFristLoad = true;
  48. /// <summary>
  49. /// 窗体加载事件
  50. /// </summary>
  51. /// <param name="sender"></param>
  52. /// <param name="e"></param>
  53. void AnalyzedOrderOperatingFormMain_Load(object sender, EventArgs e)
  54. {
  55. this.panelQueryCompared.Visible = false;
  56. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "stA10", StrKeyCode: "stA11", IsShowAllText: false);
  57. this.dtDataTimeStart.DateValue = SDateTime.Now.ToString("yyyy-MM") + "-01";
  58. this.dtDataTimeEnd.DateValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
  59. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevDisplayItem, "0:消费次数,1:业绩,2:均价,3:实收,4:余款", IsSplit: true);
  60. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevDisplayMethod, "Pie:饼形图,Column:柱状图", IsSplit: true);
  61. this.cmbtreevDisplayItem.TagFindText("0");
  62. this.cmbtreevDisplayMethod.TagFindText("Pie");
  63. }
  64. /// <summary>
  65. /// 窗体加载事件
  66. /// </summary>
  67. /// <param name="sender"></param>
  68. /// <param name="e"></param>
  69. void AnalyzedOrderOperatingFormMain_Shown(object sender, EventArgs e)
  70. {
  71. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.决策助手营收分析);
  72. if (!b)
  73. {
  74. this.Close();
  75. return;
  76. }
  77. this.chart1.Focus();
  78. this.chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
  79. this.chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
  80. this.chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
  81. this.chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;//将滚动内嵌到坐标轴中
  82. this.chart1.ChartAreas["ChartArea1"].AxisX.ScrollBar.Size = 20;// 设置滚动条的大小
  83. this.chart1.ChartAreas["ChartArea1"].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;// 设置滚动条的按钮的风格,下面代码是将所有滚动条上的按钮都显示出来
  84. this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollSize = double.NaN;// 设置自动放大与缩小的最小量
  85. this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollMinSize = 2;
  86. this.chart2.Focus();
  87. this.chart2.ChartAreas[0].CursorX.IsUserEnabled = true;
  88. this.chart2.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
  89. this.chart2.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
  90. this.chart2.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;//将滚动内嵌到坐标轴中
  91. this.chart2.ChartAreas["ChartArea1"].AxisX.ScrollBar.Size = 20;// 设置滚动条的大小
  92. this.chart2.ChartAreas["ChartArea1"].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;// 设置滚动条的按钮的风格,下面代码是将所有滚动条上的按钮都显示出来
  93. this.chart2.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollSize = double.NaN;// 设置自动放大与缩小的最小量
  94. this.chart2.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollMinSize = 2;
  95. this.PublicFunctionRows();
  96. this.IsFristLoad = false;
  97. }
  98. /// <summary>
  99. /// 查询
  100. /// </summary>
  101. /// <param name="sender"></param>
  102. /// <param name="e"></param>
  103. void btnQuery_Click(object sender, EventArgs e)
  104. {
  105. this.PublicFunctionRows();
  106. }
  107. /// <summary>
  108. /// 对比查询
  109. /// </summary>
  110. /// <param name="sender"></param>
  111. /// <param name="e"></param>
  112. void btnQueryCompared_Click(object sender, EventArgs e)
  113. {
  114. this.PublicFunctionRows();
  115. }
  116. /// <summary>
  117. /// 另存为
  118. /// </summary>
  119. /// <param name="sender"></param>
  120. /// <param name="e"></param>
  121. void btnSaveAs_Click(object sender, EventArgs e)
  122. {
  123. string StrFilleName = Convert.ToDateTime(this.dtDataTimeStart.DateValue).ToString("yyyy年MM月dd日") + " — " + Convert.ToDateTime(this.dtDataTimeEnd.DateValue).ToString("yyyy年MM月dd日") + " 营收情况分析表";
  124. if (this.chkComparedStartUp.Checked)
  125. { StrFilleName = this.dtDataTimeStart.DateValue.Trim() + "—" + this.dtDataTimeEnd.DateValue.Trim() + " 与 " + this.dtDataTimeStartCompared.DateValue.Trim() + "—" + this.dtDateTimeEndCompared.DateValue.Trim() + " 营收情况对比分析表"; }
  126. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DownloadSaveAs(this.PictImage.Image, StrFilleName: StrFilleName);
  127. }
  128. /// <summary>
  129. /// 关闭
  130. /// </summary>
  131. /// <param name="sender"></param>
  132. /// <param name="e"></param>
  133. void btnColseed_Click(object sender, EventArgs e)
  134. {
  135. this.Close();
  136. }
  137. /// <summary>
  138. /// 启动对比
  139. /// </summary>
  140. /// <param name="sender"></param>
  141. /// <param name="e"></param>
  142. void chkComparedStartUp_Click(object sender, EventArgs e)
  143. {
  144. if (this.chkComparedStartUp.Checked)
  145. {
  146. this.panelCloseed.Visible = false;
  147. this.panelSaveAs.Visible = false;
  148. this.panelQueryCompared.Visible = true;
  149. this.panelSaveAs.Visible = true;
  150. this.panelCloseed.Visible = true;
  151. if (!string.IsNullOrEmpty(this.dtDataTimeStartCompared.DateValue.Trim()) && !string.IsNullOrEmpty(this.dtDateTimeEndCompared.DateValue.Trim()))
  152. { this.PublicFunctionRows(); }
  153. }
  154. else
  155. {
  156. this.panelQueryCompared.Visible = false;
  157. this.PublicFunctionRows();
  158. }
  159. }
  160. /// <summary>
  161. /// 开始日期离开事件
  162. /// </summary>
  163. /// <param name="sender"></param>
  164. /// <param name="e"></param>
  165. void dtDataTimeStart_Leave(object sender, EventArgs e)
  166. {
  167. this.dtDataTimeEnd.DateValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
  168. }
  169. /// <summary>
  170. /// 开始日期离开事件
  171. /// </summary>
  172. /// <param name="sender"></param>
  173. /// <param name="e"></param>
  174. void dtDataTimeStartCompared_Leave(object sender, EventArgs e)
  175. {
  176. this.dtDateTimeEndCompared.DateValue = Convert.ToDateTime(this.dtDataTimeStartCompared.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
  177. }
  178. /// <summary>
  179. /// 显示项目
  180. /// </summary>
  181. /// <param name="sender"></param>
  182. /// <param name="e"></param>
  183. void cmbtreevDisplayItem_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  184. {
  185. this.PublicFunctionView();
  186. }
  187. /// <summary>
  188. /// 显示方式
  189. /// </summary>
  190. /// <param name="sender"></param>
  191. /// <param name="e"></param>
  192. void cmbtreevDisplayMethod_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  193. {
  194. this.PublicFunctionView();
  195. }
  196. /// <summary>
  197. /// 窗体大小发生变化
  198. /// </summary>
  199. /// <param name="sender"></param>
  200. /// <param name="e"></param>
  201. void AnalyzedOrderOperatingFormMain_Resize(object sender, EventArgs e)
  202. {
  203. switch (this.panelCloseed.Location.Y)
  204. {
  205. case 1: this.flowLayoutPanel1.Height = 35; break;
  206. case 35: this.flowLayoutPanel1.Height = 70; break;
  207. }
  208. if (this.IsFristLoad)
  209. {
  210. this.panelEx6.Width = this.panelEx3.Width / 2;
  211. }
  212. }
  213. Hashtable htDataView = new Hashtable();
  214. Hashtable htDataViewDb = new Hashtable();
  215. /// <summary>
  216. /// 创建行
  217. /// </summary>
  218. private void PublicFunctionRows()
  219. {
  220. actionList.Clear();
  221. #region 处理数据前判断
  222. if (this.chkComparedStartUp.Checked)
  223. {
  224. if (string.IsNullOrEmpty(this.dtDataTimeStart.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDataTimeEnd.DateValue.Trim()))
  225. { MessageBoxCustom.Show("对比前日期段不能为空"); return; }
  226. if (Convert.ToDateTime(this.dtDataTimeEnd.DateValue) < Convert.ToDateTime(this.dtDataTimeStart.DateValue))
  227. { MessageBoxCustom.Show("对比前开始日期不能大于结束日期"); return; }
  228. if (string.IsNullOrEmpty(this.dtDataTimeStartCompared.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDateTimeEndCompared.DateValue.Trim()))
  229. { MessageBoxCustom.Show("对比后日期段不能为空"); return; }
  230. if (Convert.ToDateTime(this.dtDateTimeEndCompared.DateValue) < Convert.ToDateTime(this.dtDataTimeStartCompared.DateValue))
  231. { MessageBoxCustom.Show("对比后开始日期不能大于结束日期"); return; }
  232. if (Convert.ToDateTime(this.dtDateTimeEndCompared.DateValue.Trim()) > Convert.ToDateTime(this.dtDataTimeStart.DateValue.Trim()))
  233. { MessageBoxCustom.Show("对比后的结束日期不能大于对比前的开始日期"); return; }
  234. }
  235. else
  236. {
  237. if (string.IsNullOrEmpty(this.dtDataTimeStart.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDataTimeEnd.DateValue.Trim()))
  238. { MessageBoxCustom.Show("日期段不能为空"); return; }
  239. if (Convert.ToDateTime(this.dtDataTimeEnd.DateValue) < Convert.ToDateTime(this.dtDataTimeStart.DateValue))
  240. { MessageBoxCustom.Show("开始日期不能大于结束日期"); return; }
  241. }
  242. this.IsFristLoad = true;
  243. this.AnalyzedOrderOperatingFormMain_Resize(this, null);
  244. this.IsFristLoad = false;
  245. this.htDataView.Clear();
  246. this.htDataViewDb.Clear();
  247. actionList.Clear();
  248. #endregion
  249. Bitmap newBmp = new Bitmap(this.PictImage.Width, 900);
  250. Graphics g = Graphics.FromImage(newBmp);
  251. g.Clear(System.Drawing.Color.White);
  252. Brush b = Brushes.Black;
  253. Pen p = LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.PenborderColor;
  254. Font ft12b = new Font("微软雅黑", 12);
  255. Font ft11b = new Font("微软雅黑", 11);
  256. Font ft11 = new Font("微软雅黑", 11, FontStyle.Italic);
  257. if (this.chkComparedStartUp.Checked)
  258. {
  259. ft12b = new Font("微软雅黑", 11);
  260. ft11b = new Font("微软雅黑", 10);
  261. ft11 = new Font("微软雅黑", 10, FontStyle.Italic);
  262. }
  263. Font ft15 = new Font("微软雅黑", 15);
  264. int TopAdd = 7;
  265. int LeftWidth = 30;
  266. int TableWidth = newBmp.Width - LeftWidth * 2;
  267. int ColumnWidth1 = 130;
  268. if (this.chkComparedStartUp.Checked)
  269. { ColumnWidth1 = 75; }
  270. int ColumnWidth2 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked? 6: 5);
  271. int ColumnWidth3 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
  272. int ColumnWidth4 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
  273. int ColumnWidth5 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
  274. int ColumnWidth6 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
  275. int ColumnWidth7 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
  276. int TableHeoght = 300 - 60;
  277. int RowHeight = TableHeoght / 7;
  278. string StrTypeTextNull = " ";
  279. if (this.chkComparedStartUp.Checked)
  280. { StrTypeTextNull = " "; }
  281. string StoreWhere = "";
  282. if(!cbxStoredCard.Checked)
  283. {
  284. StoreWhere = " and Pay_PaymentMethod != 'BEBACCAFEGECFBJFD' ";
  285. }
  286. string StrTimeStrat = this.dtDataTimeStart.DateValue.Trim();
  287. string StrTimeEnd = this.dtDataTimeEnd.DateValue.Trim();
  288. string ExecuteSql = "with t AS " +
  289. "(" +
  290. "select Pay_OrdNumber,sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPayment where Pay_Type = 0 And Pay_Category in ('全款','预约收款','预约补款') Group By Pay_OrdNumber " +
  291. ")," +
  292. " t1 AS " +
  293. "(" +
  294. "select Pay_OrdNumber as Pay_OrdStoreNumber,sum(Pay_AmountOf) AS Pay_StoreAmountOf,Pay_Type as Pay_StoreType from tb_ErpPayment where Pay_PaymentMethod = 'BEBACCAFEGECFBJFD' Group By Pay_OrdNumber,Pay_Type " +
  295. ")" +
  296. "select 0 AS Ord_Type,'订 单' AS Ord_TypeText,Count(tb_ErpOrder.ID) AS CountID,isnull(Sum(Ord_SeriesPrice),0) AS SeriesAmount," +
  297. "isnull(Sum(Pay_AmountOf),0) AS PaidAmount, isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf from tb_ErpOrder Left Join t on Pay_OrdNumber = Ord_Number left join t1 on Pay_OrdStoreNumber = Ord_Number and Pay_StoreType = 0 ";
  298. ExecuteSql +=
  299. "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_SaveOrderDateTime", StrTimeStrat, StrTimeEnd, ConnectWord: "") +
  300. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop") + " " +
  301. "UNION ALL " +
  302. "select 1 AS Ord_Type,'选 片' AS Ord_TypeText,Count(ID) AS CountID,isnull(Sum(Ord_SeriesPrice), 0) SeriesAmount,isnull(Sum(Pay_AmountOf), 0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf), 0) AS Pay_StoreAmountOf " +
  303. "from (select tb_ErpOrderDigital.ID,isnull((select sum(Plu_Amount) from tb_ErpPlusPickItems where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ'),0) AS Ord_SeriesPrice," +
  304. "isnull((select Sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPlusPickItems Left Join tb_ErpPayment on Plu_Number = Pay_PlusPickNumber Where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ'),0) AS Pay_AmountOf, " +
  305. "isnull((select Sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPlusPickItems Left Join tb_ErpPayment on Plu_Number = Pay_PlusPickNumber Where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ' and Pay_PaymentMethod = 'BEBACCAFEGECFBJFD' ),0) AS Pay_StoreAmountOf " +
  306. "from tb_ErpOrderDigital Left Join tb_ErpUser on User_EmployeeID = Ordv_FilmSelectionName ";
  307. ExecuteSql +=
  308. "Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_FilmSelectionTime", StrTimeStrat, StrTimeEnd, ConnectWord: "") +
  309. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "User_DividedShop") + ") AS tb " +
  310. "UNION ALL " +
  311. "select 2 AS Ord_Type,'散客消费' AS Ord_TypeText,Count(tb_ErpTwoSalesOrder.ID) AS CountID,isnull(Sum(Tsorder_Money),0) AS SeriesAmount,isnull(Sum(Pay_AmountOf),0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf " +
  312. "from tb_ErpTwoSalesOrder Left Join tb_ErpPayment on Pay_OrdNumber = Tsorder_Number And Pay_Type = 1 left join t1 on Pay_OrdStoreNumber = Tsorder_Number and Pay_StoreType = 1 ";
  313. ExecuteSql +=" Where " +
  314. "" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Tsorder_CreateDatetime", StrTimeStrat, StrTimeEnd, ConnectWord: "") +
  315. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Tsorder_DividedShop") + " " +
  316. "UNION ALL " +
  317. "select 3 AS Ord_Type,'礼服租售' AS Ord_TypeText,Count(tb_ErpDressSaleRentalOrder.ID) AS CountID,isnull(Sum(Dsro_Amount),0) AS SeriesAmount,isnull(Sum(Pay_AmountOf),0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf " +
  318. "from tb_ErpDressSaleRentalOrder Left Join tb_ErpPayment on Pay_OrdNumber = Dsro_Number And Pay_Type = 2 left join t1 on Pay_OrdStoreNumber = Dsro_Number and Pay_StoreType = 2 ";
  319. ExecuteSql += "Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Dsro_CreateDateTime", StrTimeStrat, StrTimeEnd, ConnectWord: "") +
  320. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Dsro_DividedShop") + " ";
  321. DataSet dsData = orbll.GetView_Custom(ExecuteSql);
  322. DataTable dtOrderCount = dsData.Tables["ds"];
  323. if (!this.chkComparedStartUp.Checked)
  324. {
  325. this.panelEx6.Visible = false;
  326. #region 无启动对比
  327. int ForTopLoad = 30;
  328. string StrValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).ToString("yyyy年MM月dd日") + " — " + Convert.ToDateTime(this.dtDataTimeEnd.DateValue).ToString("yyyy年MM月dd日") + " 营收情况分析表";
  329. SizeF sizef = g.MeasureString(StrValue, ft15);
  330. int FtHeigth = Convert.ToInt32(sizef.Height);
  331. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  332. Rectangle rec = new Rectangle(TableWidth / 2 - FtWidth / 2, ForTopLoad, FtWidth, FtHeigth);
  333. g.DrawString(StrValue, ft15, b, rec);//画消费法规
  334. ForTopLoad = rec.Y + rec.Height;
  335. int TotalOrderCount = 0;
  336. decimal TotalSeriesAmount = 0;
  337. decimal TotalPaidAmount = 0;
  338. decimal TotalArrearsAmount = 0;
  339. decimal TotalStoreAmount = 0;
  340. for (int i = 0; i < dtOrderCount.Rows.Count; i++)
  341. {
  342. string StrViewText = "";
  343. #region 标题
  344. if (i == 0)
  345. {
  346. Rectangle rec1 = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
  347. g.DrawRectangle(p, rec1);//画标题矩形
  348. Rectangle recBackColor1 = new Rectangle(rec1.X + 1, rec1.Y + 1, rec1.Width - 1, rec1.Height - 1);
  349. g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.backColortitle, recBackColor1);//画标题矩形
  350. Rectangle rec1_1 = new Rectangle(rec1.X, rec1.Y + TopAdd, ColumnWidth1, RowHeight);
  351. g.DrawString("", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1_1);
  352. Point p11_1 = new Point(rec1.X + ColumnWidth1, rec1.Y);
  353. Point p11_2 = new Point(rec1.X + ColumnWidth1, rec1.Y + rec1.Height);
  354. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11_1, p11_2);
  355. Rectangle rec2_1 = new Rectangle(p11_1.X + ColumnWidth2 / 2 - 30, p11_1.Y + TopAdd, ColumnWidth2, RowHeight);
  356. g.DrawString("消费次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2_1);
  357. Point p21_1 = new Point(p11_1.X + ColumnWidth2, rec1.Y);
  358. Point p21_2 = new Point(p11_1.X + ColumnWidth2, rec1.Y + rec1.Height);
  359. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21_1, p21_2);
  360. Rectangle rec3_1 = new Rectangle(p21_1.X + ColumnWidth3 / 2 - 20, p21_1.Y + TopAdd, ColumnWidth3, RowHeight);
  361. g.DrawString("业绩", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3_1);
  362. Point p31_1 = new Point(p21_1.X + ColumnWidth3, rec1.Y);
  363. Point p31_2 = new Point(p21_1.X + ColumnWidth3, rec1.Y + rec1.Height);
  364. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31_1, p31_2);
  365. Rectangle rec4_1 = new Rectangle(p31_1.X + ColumnWidth4 / 2 - 20, p31_1.Y + TopAdd, ColumnWidth4, RowHeight);
  366. g.DrawString("均价", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4_1);
  367. Point p41_1 = new Point(p31_1.X + ColumnWidth4, rec1.Y);
  368. Point p41_2 = new Point(p31_1.X + ColumnWidth4, rec1.Y + rec1.Height);
  369. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41_1, p41_2);
  370. Rectangle rec5_1 = new Rectangle(p41_1.X + ColumnWidth5 / 2 - 20, p41_1.Y + TopAdd, ColumnWidth5, RowHeight);
  371. g.DrawString("实收", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec5_1);
  372. Point p51_1 = new Point(p41_1.X + ColumnWidth5, rec1.Y);
  373. Point p51_2 = new Point(p41_1.X + ColumnWidth5, rec1.Y + rec1.Height);
  374. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p51_1, p51_2);
  375. if(cbxStoredCard.Checked)
  376. {
  377. Rectangle rec6_1 = new Rectangle(p51_1.X + ColumnWidth6 / 2 - 20, p51_1.Y + TopAdd, ColumnWidth6, RowHeight);
  378. g.DrawString("余款", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec6_1);
  379. Point p61_1 = new Point(p51_1.X + ColumnWidth6, rec1.Y);
  380. Point p61_2 = new Point(p51_1.X + ColumnWidth6, rec1.Y + rec1.Height);
  381. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p61_1, p61_2);
  382. Rectangle rec7_1 = new Rectangle(p61_1.X + ColumnWidth7 / 2 - 20, p61_1.Y + TopAdd, ColumnWidth7, RowHeight);
  383. g.DrawString("储值卡扣款", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec7_1);
  384. }
  385. else
  386. {
  387. Rectangle rec6_1 = new Rectangle(p51_1.X + ColumnWidth6 / 2 - 20, p51_1.Y + TopAdd, ColumnWidth6, RowHeight);
  388. g.DrawString("余款", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec6_1);
  389. }
  390. }
  391. #endregion
  392. #region 内容
  393. Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad + RowHeight * (i + 1), TableWidth, RowHeight);
  394. g.DrawRectangle(p, rec1A);//画标题矩形
  395. Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
  396. if ((i % 2) > 0)
  397. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
  398. else
  399. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
  400. Rectangle rec1A_1 = new Rectangle(rec1A.X + 35, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
  401. g.DrawString(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim(), ft11b, b, rec1A_1);
  402. Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
  403. Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
  404. g.DrawLine(p, p11A_1, p11A_2);
  405. //消费次数
  406. string OrderCount = dtOrderCount.Rows[i]["CountID"].ToString().Trim();
  407. TotalOrderCount += Convert.ToInt32(OrderCount);
  408. Rectangle rec2A_1 = new Rectangle(p11A_1.X + ColumnWidth2 / 2 - 8, p11A_1.Y + TopAdd, ColumnWidth2, RowHeight);
  409. g.DrawString(OrderCount, ft11, b, rec2A_1);
  410. Point p21A_1 = new Point(p11A_1.X + ColumnWidth2, rec1A.Y);
  411. Point p21A_2 = new Point(p11A_1.X + ColumnWidth2, rec1A.Y + rec1A.Height);
  412. g.DrawLine(p, p21A_1, p21A_2);
  413. StrViewText += OrderCount + "|";
  414. SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "消费次数", rec2A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  415. //业绩
  416. decimal SeriesAmount = Convert.ToDecimal(dtOrderCount.Rows[i]["SeriesAmount"]);
  417. decimal PaidAmount = Convert.ToDecimal(dtOrderCount.Rows[i]["PaidAmount"]);
  418. decimal StoreAmount = Convert.ToDecimal(dtOrderCount.Rows[i]["Pay_StoreAmountOf"]);
  419. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmount), ft11);
  420. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  421. TotalSeriesAmount += SeriesAmount;
  422. Rectangle rec3A_1 = new Rectangle(p21A_1.X + ColumnWidth3 - FtWidth - ColumnWidth3 / 3, p21A_1.Y + TopAdd, ColumnWidth3, RowHeight);
  423. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmount), ft11, b, rec3A_1);
  424. Point p31A_1 = new Point(p21A_1.X + ColumnWidth3, rec1A.Y);
  425. Point p31A_2 = new Point(p21A_1.X + ColumnWidth3, rec1A.Y + rec1A.Height);
  426. g.DrawLine(p, p31A_1, p31A_2);
  427. StrViewText += LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmount) + "|";
  428. SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "业绩", rec3A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  429. //均价
  430. string strValue = "0";
  431. if (Convert.ToInt32(OrderCount) > 0)
  432. { strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero((SeriesAmount / Convert.ToInt32(OrderCount)).ToString("0.00")); }
  433. sizef = g.MeasureString(strValue.ToString().Trim(), ft11);
  434. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  435. Rectangle rec4A_1 = new Rectangle(p31A_1.X + ColumnWidth4 - FtWidth - ColumnWidth4 / 3, p31A_1.Y + TopAdd, ColumnWidth4, RowHeight);
  436. g.DrawString(strValue, ft11, b, rec4A_1);
  437. Point p41A_1 = new Point(p31A_1.X + ColumnWidth4, rec1A.Y);
  438. Point p41A_2 = new Point(p31A_1.X + ColumnWidth4, rec1A.Y + rec1A.Height);
  439. g.DrawLine(p, p41A_1, p41A_2);
  440. StrViewText += strValue + "|";
  441. SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "均价", rec4A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  442. //实收
  443. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(PaidAmount), ft11);
  444. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  445. TotalPaidAmount += PaidAmount;
  446. Rectangle rec5A_1 = new Rectangle(p41A_1.X + ColumnWidth5 - FtWidth - ColumnWidth5 / 3, p41A_1.Y + TopAdd, ColumnWidth5, RowHeight);
  447. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(PaidAmount), ft11, b, rec5A_1);
  448. Point p51A_1 = new Point(p41A_1.X + ColumnWidth5, rec1A.Y);
  449. Point p51A_2 = new Point(p41A_1.X + ColumnWidth5, rec1A.Y + rec1A.Height);
  450. g.DrawLine(p, p51A_1, p51A_2);
  451. StrViewText += PaidAmount + "|";
  452. SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "实收", rec5A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  453. if (cbxStoredCard.Checked)
  454. {
  455. //余款
  456. decimal ArrearsAmount = SeriesAmount - PaidAmount;
  457. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11);
  458. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  459. TotalArrearsAmount += ArrearsAmount;
  460. Rectangle rec6A_1 = new Rectangle(p51A_1.X + ColumnWidth6 - FtWidth - ColumnWidth6 / 3, p51A_1.Y + TopAdd, ColumnWidth6, RowHeight);
  461. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11, b, rec6A_1);
  462. Point p61A_1 = new Point(p51A_1.X + ColumnWidth6, rec1A.Y);
  463. Point p61A_2 = new Point(p51A_1.X + ColumnWidth6, rec1A.Y + rec1A.Height);
  464. g.DrawLine(p, p61A_1, p61A_2);
  465. StrViewText += ArrearsAmount + "|";
  466. SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "余款", rec6A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  467. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StoreAmount), ft11);
  468. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  469. Rectangle rec7A_1 = new Rectangle(p61A_1.X + ColumnWidth7 - FtWidth - ColumnWidth7 / 3, p61A_1.Y + TopAdd, ColumnWidth7, RowHeight);
  470. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StoreAmount), ft11, b, rec7A_1);
  471. StrViewText += ArrearsAmount + "|";
  472. TotalStoreAmount += StoreAmount;
  473. }
  474. else
  475. {
  476. //余款
  477. decimal ArrearsAmount = SeriesAmount - PaidAmount;
  478. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11);
  479. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  480. TotalArrearsAmount += ArrearsAmount;
  481. Rectangle rec6A_1 = new Rectangle(p51A_1.X + ColumnWidth6 - FtWidth - ColumnWidth6 / 3, p51A_1.Y + TopAdd, ColumnWidth6, RowHeight);
  482. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11, b, rec6A_1);
  483. StrViewText += ArrearsAmount + "|";
  484. SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "余款", rec6A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  485. }
  486. htDataView[dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim()] = StrViewText.TrimEnd('|');
  487. #endregion
  488. }
  489. if (dtOrderCount.Rows.Count > 1)
  490. {
  491. this.panelEx3.Visible = true;
  492. this.panelEx2.Dock = DockStyle.Top;
  493. #region 总结
  494. Rectangle rec1B = new Rectangle(LeftWidth, ForTopLoad + RowHeight * (dtOrderCount.Rows.Count + 1), TableWidth, RowHeight);
  495. g.DrawRectangle(p, rec1B);//画标题矩形
  496. Rectangle rec1BColor1 = new Rectangle(rec1B.X + 1, rec1B.Y + 1, rec1B.Width - 1, rec1B.Height - 1);
  497. if ((dtOrderCount.Rows.Count % 2) > 0)
  498. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1BColor1); }
  499. else
  500. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1BColor1); }
  501. Rectangle rec1B_1 = new Rectangle(rec1B.X + 34, rec1B.Y + TopAdd, ColumnWidth1, RowHeight);
  502. g.DrawString("总" + StrTypeTextNull + "计", ft11b, b, rec1B_1);
  503. Point p11B_1 = new Point(rec1B.X + ColumnWidth1, rec1B.Y);
  504. Point p11B_2 = new Point(rec1B.X + ColumnWidth1, rec1B.Y + rec1B.Height);
  505. g.DrawLine(p, p11B_1, p11B_2);
  506. //消费次数
  507. Rectangle rec2B_1 = new Rectangle(p11B_1.X + ColumnWidth2 / 2 - 8, p11B_1.Y + TopAdd, ColumnWidth2, RowHeight);
  508. g.DrawString(TotalOrderCount.ToString().Trim(), ft11, b, rec2B_1);
  509. Point p21B_1 = new Point(p11B_1.X + ColumnWidth2, rec1B.Y);
  510. Point p21B_2 = new Point(p11B_1.X + ColumnWidth2, rec1B.Y + rec1B.Height);
  511. g.DrawLine(p, p21B_1, p21B_2);
  512. //业绩
  513. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11);
  514. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  515. Rectangle rec3B_1 = new Rectangle(p21B_1.X + ColumnWidth3 - FtWidth - (ColumnWidth3 / 6) * 2, p21B_1.Y + TopAdd, ColumnWidth3, RowHeight);
  516. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11, b, rec3B_1);
  517. Point p31B_1 = new Point(p21B_1.X + ColumnWidth3, rec1B.Y);
  518. Point p31B_2 = new Point(p21B_1.X + ColumnWidth3, rec1B.Y + rec1B.Height);
  519. g.DrawLine(p, p31B_1, p31B_2);
  520. //均价
  521. string strValue = "0";
  522. if (Convert.ToInt32(TotalOrderCount) > 0)
  523. { strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero((TotalSeriesAmount / Convert.ToInt32(TotalOrderCount)).ToString("0.00")); }
  524. sizef = g.MeasureString(strValue.Trim(), ft11);
  525. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  526. Rectangle rec4B_1 = new Rectangle(p31B_1.X + ColumnWidth4 - FtWidth - (ColumnWidth4 / 6) * 2, p31B_1.Y + TopAdd, ColumnWidth4, RowHeight);
  527. g.DrawString(strValue.Trim(), ft11, b, rec4B_1);
  528. Point p41B_1 = new Point(p31B_1.X + ColumnWidth4, rec1B.Y);
  529. Point p41B_2 = new Point(p31B_1.X + ColumnWidth4, rec1B.Y + rec1B.Height);
  530. g.DrawLine(p, p41B_1, p41B_2);
  531. //实收
  532. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalPaidAmount), ft11);
  533. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  534. Rectangle rec5B_1 = new Rectangle(p41B_1.X + ColumnWidth5 - FtWidth - (ColumnWidth5 / 6) * 2, p41B_1.Y + TopAdd, ColumnWidth5, RowHeight);
  535. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalPaidAmount), ft11, b, rec5B_1);
  536. Point p51B_1 = new Point(p41B_1.X + ColumnWidth5, rec1B.Y);
  537. Point p51B_2 = new Point(p41B_1.X + ColumnWidth5, rec1B.Y + rec1B.Height);
  538. g.DrawLine(p, p51B_1, p51B_2);
  539. if (cbxStoredCard.Checked)
  540. {
  541. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11);
  542. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  543. Rectangle rec6B_1 = new Rectangle(p51B_1.X + ColumnWidth6 - FtWidth - (ColumnWidth6 / 6) * 2, p51B_1.Y + TopAdd, ColumnWidth6, RowHeight);
  544. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11, b, rec6B_1);
  545. Point p61B_1 = new Point(p51B_1.X + ColumnWidth6, rec1B.Y);
  546. Point p61B_2 = new Point(p51B_1.X + ColumnWidth6, rec1B.Y + rec1B.Height);
  547. g.DrawLine(p, p61B_1, p61B_2);
  548. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalStoreAmount), ft11);
  549. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  550. Rectangle rec7B_1 = new Rectangle(p61B_1.X + ColumnWidth7 - FtWidth - (ColumnWidth7 / 6) * 2, p61B_1.Y + TopAdd, ColumnWidth7, RowHeight);
  551. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalStoreAmount), ft11, b, rec7B_1);
  552. }
  553. else
  554. {
  555. //余款
  556. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11);
  557. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  558. Rectangle rec6B_1 = new Rectangle(p51B_1.X + ColumnWidth6 - FtWidth - (ColumnWidth6 / 6) * 2, p51B_1.Y + TopAdd, ColumnWidth6, RowHeight);
  559. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11, b, rec6B_1);
  560. }
  561. #endregion
  562. }
  563. else
  564. {
  565. this.panelEx3.Visible = false;
  566. this.panelEx2.Dock = DockStyle.Fill;
  567. }
  568. #endregion
  569. }
  570. else
  571. {
  572. this.panelEx6.Visible = true;
  573. string StrTimeStratDb = this.dtDataTimeStartCompared.DateValue.Trim();
  574. string StrTimeEndDb = this.dtDateTimeEndCompared.DateValue.Trim();
  575. ExecuteSql = "with t AS " +
  576. "(" +
  577. "select Pay_OrdNumber,sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPayment where Pay_Type = 0 And Pay_Category in ('全款','预约收款','预约补款') Group By Pay_OrdNumber " +
  578. ")," +
  579. " t1 AS " +
  580. "(" +
  581. "select Pay_OrdNumber as Pay_OrdStoreNumber,sum(Pay_AmountOf) AS Pay_StoreAmountOf,Pay_Type as Pay_StoreType from tb_ErpPayment where Pay_PaymentMethod = 'BEBACCAFEGECFBJFD' Group By Pay_OrdNumber,Pay_Type " +
  582. ")" +
  583. "select 0 AS Ord_Type,'订 单' AS Ord_TypeText,Count(tb_ErpOrder.ID) AS CountID,isnull(Sum(Ord_SeriesPrice),0) AS SeriesAmount," +
  584. "isnull(Sum(Pay_AmountOf),0) AS PaidAmount, isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf from tb_ErpOrder Left Join t on Pay_OrdNumber = Ord_Number left join t1 on Pay_OrdStoreNumber = Ord_Number and Pay_StoreType = 0 ";
  585. ExecuteSql +=
  586. "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_SaveOrderDateTime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") +
  587. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop") + " " +
  588. "UNION ALL " +
  589. "select 1 AS Ord_Type,'选 片' AS Ord_TypeText,Count(ID) AS CountID,isnull(Sum(Ord_SeriesPrice), 0) SeriesAmount,isnull(Sum(Pay_AmountOf), 0) AS PaidAmount ,'0' AS Pay_StoreAmountOf " +
  590. "from (select tb_ErpOrderDigital.ID,isnull((select sum(Plu_Amount) from tb_ErpPlusPickItems where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ'),0) AS Ord_SeriesPrice," +
  591. "isnull((select Sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPlusPickItems Left Join tb_ErpPayment on Plu_Number = Pay_PlusPickNumber Where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ'),0) AS Pay_AmountOf, " +
  592. "isnull((select Sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPlusPickItems Left Join tb_ErpPayment on Plu_Number = Pay_PlusPickNumber Where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ' and Pay_PaymentMethod = 'BEBACCAFEGECFBJFD' ),0) AS Pay_StoreAmountOf " +
  593. "from tb_ErpOrderDigital Left Join tb_ErpUser on User_EmployeeID = Ordv_FilmSelectionName ";
  594. ExecuteSql +=
  595. "Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_FilmSelectionTime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") +
  596. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "User_DividedShop") + ") AS tb " +
  597. "UNION ALL " +
  598. "select 2 AS Ord_Type,'散客消费' AS Ord_TypeText,Count(tb_ErpTwoSalesOrder.ID) AS CountID,isnull(Sum(Tsorder_Money),0) AS SeriesAmount,isnull(Sum(Pay_AmountOf),0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf " +
  599. "from tb_ErpTwoSalesOrder Left Join tb_ErpPayment on Pay_OrdNumber = Tsorder_Number And Pay_Type = 1 left join t1 on Pay_OrdStoreNumber = Tsorder_Number and Pay_StoreType = 1 ";
  600. ExecuteSql +=
  601. " Where " +
  602. "" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Tsorder_CreateDatetime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") +
  603. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Tsorder_DividedShop") + " " +
  604. "UNION ALL " +
  605. "select 3 AS Ord_Type,'礼服租售' AS Ord_TypeText,Count(tb_ErpDressSaleRentalOrder.ID) AS CountID,isnull(Sum(Dsro_Amount),0) AS SeriesAmount,isnull(Sum(Pay_AmountOf),0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf " +
  606. "from tb_ErpDressSaleRentalOrder Left Join tb_ErpPayment on Pay_OrdNumber = Dsro_Number And Pay_Type = 2 left join t1 on Pay_OrdStoreNumber = Dsro_Number and Pay_StoreType = 2 ";
  607. ExecuteSql +=
  608. "Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Dsro_CreateDateTime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") +
  609. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Dsro_DividedShop") + " ";
  610. DataSet dsDataDb = orbll.GetView_Custom(ExecuteSql);
  611. DataTable dtOrderCountDb = dsDataDb.Tables["ds"];
  612. #region 启动对比
  613. int ColumnWidthSplit2 = ColumnWidth2 / 3;
  614. int ColumnWidthSplit3 = ColumnWidth3 / 3;
  615. int ColumnWidthSplit4 = ColumnWidth4 / 3;
  616. int ColumnWidthSplit5 = ColumnWidth5 / 3;
  617. int ColumnWidthSplit6 = ColumnWidth6 / 3;
  618. int ForTopLoad = 15;
  619. string StrValue = StrTimeStrat + "—" + StrTimeEnd + " 与 " + StrTimeStratDb + "—" + StrTimeEndDb + " 营收情况对比分析表";
  620. SizeF sizef = g.MeasureString(StrValue, ft15);
  621. int FtHeigth = Convert.ToInt32(sizef.Height);
  622. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  623. Rectangle rec = new Rectangle(TableWidth / 2 - FtWidth / 2, ForTopLoad, FtWidth, FtHeigth);
  624. g.DrawString(StrValue, ft15, b, rec);//画消费法规
  625. ForTopLoad = rec.Y + rec.Height;
  626. decimal TotalOrderCount = 0;
  627. decimal TotalSeriesAmount = 0;
  628. decimal TotalPaidAmount = 0;
  629. decimal TotalArrearsAmount = 0;
  630. decimal TotalOrderCountDb = 0;
  631. decimal TotalSeriesAmountDb = 0;
  632. decimal TotalPaidAmountDb = 0;
  633. decimal TotalArrearsAmountDb = 0;
  634. Hashtable htData = new Hashtable();
  635. for (int i = 0; i < dtOrderCount.Rows.Count; i++)
  636. {
  637. htData[dtOrderCount.Rows[i]["Ord_Type"].ToString().Trim()] = dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim();
  638. }
  639. for (int i = 0; i < dtOrderCountDb.Rows.Count; i++)
  640. {
  641. htData[dtOrderCountDb.Rows[i]["Ord_Type"].ToString().Trim()] = dtOrderCountDb.Rows[i]["Ord_TypeText"].ToString().Trim();
  642. }
  643. int forCount = 0;
  644. foreach (DictionaryEntry item in htData)
  645. {
  646. string StrViewText = "";
  647. string StrViewTextDb = "";
  648. #region 标题
  649. if (forCount == 0)
  650. {
  651. Rectangle rec1 = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight * 2);
  652. g.DrawRectangle(p, rec1);//画标题矩形
  653. Rectangle recBackColor1 = new Rectangle(rec1.X + 1, rec1.Y + 1, rec1.Width - 1, rec1.Height - 1);
  654. g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.backColortitle, recBackColor1);//画标题矩形
  655. ForTopLoad = rec1.Y + rec1.Height;
  656. Point p1_1 = new Point(rec1.X + ColumnWidth1, rec1.Y + RowHeight);
  657. Point p1_2 = new Point(rec1.X + TableWidth, rec1.Y + RowHeight);
  658. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p1_1, p1_2);
  659. Rectangle rec1_1 = new Rectangle(rec1.X, rec1.Y + TopAdd, ColumnWidth1, RowHeight);
  660. g.DrawString("", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1_1);
  661. Point p11_1 = new Point(rec1.X + ColumnWidth1, rec1.Y);
  662. Point p11_2 = new Point(rec1.X + ColumnWidth1, rec1.Y + RowHeight);
  663. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11_1, p11_2);
  664. Rectangle rec2_1 = new Rectangle(p11_1.X + ColumnWidth2 / 2 - 30, p11_1.Y + TopAdd, ColumnWidth2, RowHeight);
  665. g.DrawString("消费次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2_1);
  666. Point p21_1 = new Point(p11_1.X + ColumnWidth2, rec1.Y);
  667. Point p21_2 = new Point(p11_1.X + ColumnWidth2, rec1.Y + RowHeight);
  668. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21_1, p21_2);
  669. Rectangle rec3_1 = new Rectangle(p21_1.X + ColumnWidth3 / 2 - 20, p21_1.Y + TopAdd, ColumnWidth3, RowHeight);
  670. g.DrawString("业绩", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3_1);
  671. Point p31_1 = new Point(p21_1.X + ColumnWidth3, rec1.Y);
  672. Point p31_2 = new Point(p21_1.X + ColumnWidth3, rec1.Y + RowHeight);
  673. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31_1, p31_2);
  674. Rectangle rec4_1 = new Rectangle(p31_1.X + ColumnWidth4 / 2 - 20, p31_1.Y + TopAdd, ColumnWidth4, RowHeight);
  675. g.DrawString("均价", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4_1);
  676. Point p41_1 = new Point(p31_1.X + ColumnWidth4, rec1.Y);
  677. Point p41_2 = new Point(p31_1.X + ColumnWidth4, rec1.Y + RowHeight);
  678. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41_1, p41_2);
  679. Rectangle rec5_1 = new Rectangle(p41_1.X + ColumnWidth5 / 2 - 20, p41_1.Y + TopAdd, ColumnWidth5, RowHeight);
  680. g.DrawString("实收", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec5_1);
  681. Point p51_1 = new Point(p41_1.X + ColumnWidth5, rec1.Y);
  682. Point p51_2 = new Point(p41_1.X + ColumnWidth5, rec1.Y + RowHeight);
  683. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p51_1, p51_2);
  684. Rectangle rec6_1 = new Rectangle(p51_1.X + ColumnWidth6 / 2 - 20, p51_1.Y + TopAdd, ColumnWidth6, RowHeight);
  685. g.DrawString("余款", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec6_1);
  686. sizef = g.MeasureString("测试测", ft11b);
  687. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  688. Rectangle rec1AB = new Rectangle(p1_1.X, p1_1.Y, TableWidth - ColumnWidth1 + 1, RowHeight);
  689. g.DrawRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, rec1AB);//画标题矩形
  690. Rectangle rec2AB_1 = new Rectangle(rec1AB.X + (ColumnWidthSplit2 - FtWidth) / 2, rec1AB.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  691. g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2AB_1);
  692. Point p21AB_1 = new Point(rec1AB.X + ColumnWidthSplit2, rec1AB.Y);
  693. Point p21AB_2 = new Point(rec1AB.X + ColumnWidthSplit2, rec1AB.Y + rec1AB.Height);
  694. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21AB_1, p21AB_2);
  695. Rectangle rec3AB_1 = new Rectangle(p21AB_1.X + (ColumnWidthSplit2 - FtWidth) / 2, p21AB_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  696. g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3AB_1);
  697. Point p31AB_1 = new Point(p21AB_1.X + ColumnWidthSplit2, rec1AB.Y);
  698. Point p31AB_2 = new Point(p21AB_1.X + ColumnWidthSplit2, rec1AB.Y + rec1AB.Height);
  699. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31AB_1, p31AB_2);
  700. Rectangle rec4AB_1 = new Rectangle(p31AB_1.X + (ColumnWidthSplit2 - FtWidth) / 2, p31AB_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
  701. g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4AB_1);
  702. Point p41AB_1 = new Point(p31AB_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1AB.Y);
  703. Point p41AB_2 = new Point(p31AB_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1AB.Y + rec1AB.Height);
  704. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41AB_1, p41AB_2);
  705. Rectangle rec1BB_1 = new Rectangle(p41AB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p41AB_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  706. g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1BB_1);
  707. Point p11BB_1 = new Point(p41AB_1.X + ColumnWidthSplit3, rec1AB.Y);
  708. Point p11BB_2 = new Point(p41AB_1.X + ColumnWidthSplit3, rec1AB.Y + rec1AB.Height);
  709. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11BB_1, p11BB_2);
  710. Rectangle rec2BB_1 = new Rectangle(p11BB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p11BB_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  711. g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2BB_1);
  712. Point p21BB_1 = new Point(p11BB_1.X + ColumnWidthSplit3, rec1AB.Y);
  713. Point p21BB_2 = new Point(p11BB_1.X + ColumnWidthSplit3, rec1AB.Y + rec1AB.Height);
  714. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21BB_1, p21BB_2);
  715. Rectangle rec3BB_1 = new Rectangle(p21BB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p21BB_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
  716. g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3BB_1);
  717. Point p31BB_1 = new Point(p21BB_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1AB.Y);
  718. Point p31BB_2 = new Point(p21BB_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1AB.Y + rec1AB.Height);
  719. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31BB_1, p31BB_2);
  720. Rectangle rec4BB_1 = new Rectangle(p31BB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p31BB_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  721. g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4BB_1);
  722. Point p41BB_1 = new Point(p31BB_1.X + ColumnWidthSplit4, rec1AB.Y);
  723. Point p41BB_2 = new Point(p31BB_1.X + ColumnWidthSplit4, rec1AB.Y + rec1AB.Height);
  724. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41BB_1, p41BB_2);
  725. Rectangle rec1CB_1 = new Rectangle(p41BB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p41BB_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  726. g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1CB_1);
  727. Point p11CB_1 = new Point(p41BB_1.X + ColumnWidthSplit4, rec1AB.Y);
  728. Point p11CB_2 = new Point(p41BB_1.X + ColumnWidthSplit4, rec1AB.Y + rec1AB.Height);
  729. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11CB_1, p11CB_2);
  730. Rectangle rec2CB_1 = new Rectangle(p11CB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p11CB_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
  731. g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2CB_1);
  732. Point p21CB_1 = new Point(p11CB_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1AB.Y);
  733. Point p21CB_2 = new Point(p11CB_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1AB.Y + rec1AB.Height);
  734. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21CB_1, p21CB_2);
  735. Rectangle rec3CB_1 = new Rectangle(p21CB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p21CB_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  736. g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3CB_1);
  737. Point p31CB_1 = new Point(p21CB_1.X + ColumnWidthSplit4, rec1AB.Y);
  738. Point p31CB_2 = new Point(p21CB_1.X + ColumnWidthSplit4, rec1AB.Y + rec1AB.Height);
  739. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31CB_1, p31CB_2);
  740. Rectangle rec4CB_1 = new Rectangle(p31CB_1.X + (ColumnWidthSplit5 - FtWidth) / 2, p31CB_1.Y + TopAdd, ColumnWidthSplit5, RowHeight);
  741. g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4CB_1);
  742. Point p41CB_1 = new Point(p31CB_1.X + ColumnWidthSplit5, rec1AB.Y);
  743. Point p41CB_2 = new Point(p31CB_1.X + ColumnWidthSplit5, rec1AB.Y + rec1AB.Height);
  744. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41CB_1, p41CB_2);
  745. Rectangle rec1DB_1 = new Rectangle(p41CB_1.X + (ColumnWidthSplit5 - FtWidth) / 2, p41CB_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit5 * 2, RowHeight);
  746. g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1DB_1);
  747. Point p11DB_1 = new Point(p41CB_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1AB.Y);
  748. Point p11DB_2 = new Point(p41CB_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1AB.Y + rec1AB.Height);
  749. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11DB_1, p11DB_2);
  750. Rectangle rec2DB_1 = new Rectangle(p11DB_1.X + (ColumnWidthSplit6 - FtWidth) / 2, p11DB_1.Y + TopAdd, ColumnWidthSplit6, RowHeight);
  751. g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2DB_1);
  752. Point p21DB_1 = new Point(p11DB_1.X + ColumnWidthSplit6, rec1AB.Y);
  753. Point p21DB_2 = new Point(p11DB_1.X + ColumnWidthSplit6, rec1AB.Y + rec1AB.Height);
  754. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21DB_1, p21DB_2);
  755. Rectangle rec3DB_1 = new Rectangle(p21DB_1.X + (ColumnWidthSplit6 - FtWidth) / 2, p21DB_1.Y + TopAdd, ColumnWidth6 - ColumnWidthSplit6 * 2, RowHeight);
  756. g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3DB_1);
  757. Point p31DB_1 = new Point(p21DB_1.X + ColumnWidthSplit6, rec1AB.Y);
  758. Point p31DB_2 = new Point(p21DB_1.X + ColumnWidthSplit6, rec1AB.Y + rec1AB.Height);
  759. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31DB_1, p31DB_2);
  760. Rectangle rec4DB_1 = new Rectangle(p31DB_1.X + (ColumnWidthSplit6 - FtWidth) / 2, p31DB_1.Y + TopAdd, ColumnWidth6 - ColumnWidthSplit6 * 2, RowHeight);
  761. g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4DB_1);
  762. }
  763. #endregion
  764. #region 内容
  765. DataRow[] dtRowCount = dtOrderCount.Select("Ord_Type = '" + item.Key.ToString().Trim() + "'");
  766. DataRow[] dtRowCountDb = dtOrderCountDb.Select("Ord_Type = '" + item.Key.ToString().Trim() + "'");
  767. Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad + RowHeight * forCount, TableWidth, RowHeight);
  768. g.DrawRectangle(p, rec1A);//画标题矩形
  769. Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
  770. if ((forCount % 2) > 0)
  771. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
  772. else
  773. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
  774. Rectangle rec1A_1 = new Rectangle(rec1A.X + 10, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
  775. g.DrawString(item.Value.ToString().Trim(), ft11b, b, rec1A_1);
  776. Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
  777. Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
  778. g.DrawLine(p, p11A_1, p11A_2);
  779. #region 订单数
  780. decimal OrderCount = 0;
  781. decimal OrderCountDb = 0;
  782. if (dtRowCount.Length > 0)
  783. { OrderCount = Convert.ToDecimal(dtRowCount[0]["CountID"]); }
  784. if (dtRowCountDb.Length > 0)
  785. { OrderCountDb = Convert.ToDecimal(dtRowCountDb[0]["CountID"]); }
  786. TotalOrderCount += OrderCount;
  787. TotalOrderCountDb += OrderCountDb;
  788. StrViewText += OrderCount + "|";
  789. StrViewTextDb += OrderCountDb + "|";
  790. Rectangle rec2A_1 = new Rectangle(p11A_1.X + 3, p11A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  791. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(OrderCount), ft11, b, rec2A_1);
  792. Point p21A_1 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y);
  793. Point p21A_2 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
  794. g.DrawLine(p, p21A_1, p21A_2);
  795. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "消费次数", rec2A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  796. Rectangle rec3A_1 = new Rectangle(p21A_1.X + 3, p21A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  797. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(OrderCountDb), ft11, b, rec3A_1);
  798. Point p31A_1 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y);
  799. Point p31A_2 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
  800. g.DrawLine(p, p31A_1, p31A_2);
  801. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "消费次数", rec3A_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
  802. string StrPercentage = "";
  803. if (OrderCountDb > 0)
  804. { StrPercentage = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((OrderCount - OrderCountDb) / OrderCountDb * 100).ToString("0.00")) + "%"; }
  805. Rectangle rec4A_1 = new Rectangle(p31A_1.X + 3, p31A_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
  806. g.DrawString(StrPercentage.Trim(), ft11, b, rec4A_1);
  807. Point p41A_1 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y);
  808. Point p41A_2 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y + rec1A.Height);
  809. g.DrawLine(p, p41A_1, p41A_2);
  810. #endregion
  811. #region 业绩
  812. decimal SeriesAmount = 0;
  813. decimal SeriesAmountDb = 0;
  814. if (dtRowCount.Length > 0)
  815. {
  816. if (!string.IsNullOrEmpty(dtRowCount[0]["SeriesAmount"].ToString().Trim()))
  817. { SeriesAmount = Convert.ToDecimal(dtRowCount[0]["SeriesAmount"]); }
  818. }
  819. if (dtRowCountDb.Length > 0)
  820. {
  821. if (!string.IsNullOrEmpty(dtRowCountDb[0]["SeriesAmount"].ToString().Trim()))
  822. { SeriesAmountDb = Convert.ToDecimal(dtRowCountDb[0]["SeriesAmount"]); }
  823. }
  824. TotalSeriesAmount += SeriesAmount;
  825. TotalSeriesAmountDb += SeriesAmountDb;
  826. StrViewText += SeriesAmount + "|";
  827. StrViewTextDb += SeriesAmountDb + "|";
  828. Rectangle rec1B_1 = new Rectangle(p41A_1.X + 3, p41A_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  829. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmount), ft11, b, rec1B_1);
  830. Point p11B_1 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y);
  831. Point p11B_2 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
  832. g.DrawLine(p, p11B_1, p11B_2);
  833. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "业绩", rec1B_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  834. Rectangle rec2B_1 = new Rectangle(p11B_1.X + 3, p11B_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  835. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmountDb), ft11, b, rec2B_1);
  836. Point p21B_1 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y);
  837. Point p21B_2 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
  838. g.DrawLine(p, p21B_1, p21B_2);
  839. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "业绩", rec2B_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
  840. string StrPercentage2 = "";
  841. if (SeriesAmountDb > 0)
  842. { StrPercentage2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((SeriesAmount - SeriesAmountDb) / SeriesAmountDb * 100).ToString("0.00")) + "%"; }
  843. Rectangle rec3B_1 = new Rectangle(p21B_1.X + 3, p21B_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
  844. g.DrawString(StrPercentage2, ft11, b, rec3B_1);
  845. Point p31B_1 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y);
  846. Point p31B_2 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y + rec1A.Height);
  847. g.DrawLine(p, p31B_1, p31B_2);
  848. #endregion
  849. #region 均值
  850. decimal AverageValue = 0;
  851. decimal AverageValueDb = 0;
  852. if (OrderCount > 0)
  853. { AverageValue = Convert.ToDecimal((SeriesAmount / OrderCount).ToString("0.00")); }
  854. if (OrderCountDb > 0)
  855. { AverageValueDb = Convert.ToDecimal((SeriesAmountDb / OrderCountDb).ToString("0.00")); }
  856. StrViewText += AverageValue + "|";
  857. StrViewTextDb += AverageValueDb + "|";
  858. Rectangle rec4B_1 = new Rectangle(p31B_1.X + 3, p31B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  859. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(AverageValue), ft11, b, rec4B_1);
  860. Point p41B_1 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y);
  861. Point p41B_2 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  862. g.DrawLine(p, p41B_1, p41B_2);
  863. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "均价", rec4B_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  864. Rectangle rec1C_1 = new Rectangle(p41B_1.X + 3, p41B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  865. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(AverageValueDb), ft11, b, rec1C_1);
  866. Point p11C_1 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y);
  867. Point p11C_2 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  868. g.DrawLine(p, p11C_1, p11C_2);
  869. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "均价", rec1C_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
  870. string StrPercentage3 = "";
  871. if (AverageValueDb > 0)
  872. { StrPercentage3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((AverageValue - AverageValueDb) / AverageValueDb * 100).ToString("0.00")) + "%"; }
  873. Rectangle rec2C_1 = new Rectangle(p11C_1.X + 3, p11C_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
  874. g.DrawString(StrPercentage3, ft11, b, rec2C_1);
  875. Point p21C_1 = new Point(p11C_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1A.Y);
  876. Point p21C_2 = new Point(p11C_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1A.Y + rec1A.Height);
  877. g.DrawLine(p, p21C_1, p21C_2);
  878. #endregion
  879. #region 实收
  880. decimal PaidAmount = 0;
  881. decimal PaidAmountDb = 0;
  882. if (dtRowCount.Length > 0)
  883. {
  884. if (!string.IsNullOrEmpty(dtRowCount[0]["PaidAmount"].ToString().Trim()))
  885. { PaidAmount = Convert.ToDecimal(dtRowCount[0]["PaidAmount"]); }
  886. }
  887. if (dtRowCountDb.Length > 0)
  888. {
  889. if (!string.IsNullOrEmpty(dtRowCountDb[0]["PaidAmount"].ToString().Trim()))
  890. { PaidAmountDb = Convert.ToDecimal(dtRowCountDb[0]["PaidAmount"]); }
  891. }
  892. TotalPaidAmount += PaidAmount;
  893. TotalPaidAmountDb += PaidAmountDb;
  894. StrViewText += PaidAmount + "|";
  895. StrViewTextDb += PaidAmountDb + "|";
  896. Rectangle rec3C_1 = new Rectangle(p21C_1.X + 3, p21C_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  897. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(PaidAmount), ft11, b, rec3C_1);
  898. Point p31C_1 = new Point(p21C_1.X + ColumnWidthSplit4, rec1A.Y);
  899. Point p31C_2 = new Point(p21C_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  900. g.DrawLine(p, p31C_1, p31C_2);
  901. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "实收", rec3C_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  902. Rectangle rec4C_1 = new Rectangle(p31C_1.X + 3, p31C_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  903. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(PaidAmountDb), ft11, b, rec4C_1);
  904. Point p41C_1 = new Point(p31C_1.X + ColumnWidthSplit4, rec1A.Y);
  905. Point p41C_2 = new Point(p31C_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  906. g.DrawLine(p, p41C_1, p41C_2);
  907. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "实收", rec4C_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
  908. string StrPercentage4 = "";
  909. if (PaidAmountDb > 0)
  910. { StrPercentage4 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((PaidAmount - PaidAmountDb) / PaidAmountDb * 100).ToString("0.00")) + "%"; }
  911. Rectangle rec1D_1 = new Rectangle(p41C_1.X + 3, p41C_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit5 * 2, RowHeight);
  912. g.DrawString(StrPercentage4, ft11, b, rec1D_1);
  913. Point p11D_1 = new Point(p41C_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1A.Y);
  914. Point p11D_2 = new Point(p41C_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1A.Y + rec1A.Height);
  915. g.DrawLine(p, p11D_1, p11D_2);
  916. #endregion
  917. #region 余款
  918. decimal ArrearsAmount = SeriesAmount - PaidAmount;
  919. decimal ArrearsAmountDb = SeriesAmountDb - PaidAmountDb;
  920. TotalArrearsAmount += ArrearsAmount;
  921. TotalArrearsAmountDb += ArrearsAmountDb;
  922. StrViewText += ArrearsAmount + "|";
  923. StrViewTextDb += ArrearsAmountDb + "|";
  924. Rectangle rec2D_1 = new Rectangle(p11D_1.X + 3, p11D_1.Y + TopAdd, ColumnWidthSplit6, RowHeight);
  925. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11, b, rec2D_1);
  926. Point p21D_1 = new Point(p11D_1.X + ColumnWidthSplit6, rec1A.Y);
  927. Point p21D_2 = new Point(p11D_1.X + ColumnWidthSplit6, rec1A.Y + rec1A.Height);
  928. g.DrawLine(p, p21D_1, p21D_2);
  929. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "余款", rec2D_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
  930. Rectangle rec3D_1 = new Rectangle(p21D_1.X + 3, p21D_1.Y + TopAdd, ColumnWidth6 - ColumnWidthSplit6 * 2, RowHeight);
  931. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmountDb), ft11, b, rec3D_1);
  932. Point p31D_1 = new Point(p21D_1.X + ColumnWidthSplit6, rec1A.Y);
  933. Point p31D_2 = new Point(p21D_1.X + ColumnWidthSplit6, rec1A.Y + rec1A.Height);
  934. g.DrawLine(p, p31D_1, p31D_2);
  935. SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "余款", rec3D_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
  936. string StrPercentage5 = "";
  937. if (ArrearsAmountDb > 0)
  938. { StrPercentage5 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((ArrearsAmount - ArrearsAmountDb) / ArrearsAmountDb * 100).ToString("0.00")) + "%"; }
  939. Rectangle rec4D_1 = new Rectangle(p31D_1.X + 3, p31D_1.Y + TopAdd, ColumnWidth6 - ColumnWidthSplit6 * 2, RowHeight);
  940. g.DrawString(StrPercentage5, ft11, b, rec4D_1);
  941. #endregion
  942. forCount++;
  943. #endregion
  944. htDataView[item.Value.ToString().Trim()] = StrViewText.TrimEnd('|');
  945. htDataViewDb[item.Value.ToString().Trim()] = StrViewTextDb.TrimEnd('|');
  946. }
  947. if (htData.Count > 1)
  948. {
  949. this.panelEx3.Visible = true;
  950. this.panelEx2.Dock = DockStyle.Top;
  951. #region 总结
  952. Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad + RowHeight * htData.Count, TableWidth, RowHeight);
  953. g.DrawRectangle(p, rec1A);//画标题矩形
  954. Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
  955. if ((htData.Count % 2) > 0)
  956. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
  957. else
  958. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
  959. Rectangle rec1A_1 = new Rectangle(rec1A.X + 10, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
  960. g.DrawString("总" + StrTypeTextNull + "计", ft11b, b, rec1A_1);
  961. Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
  962. Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
  963. g.DrawLine(p, p11A_1, p11A_2);
  964. #region 订单数
  965. Rectangle rec2A_1 = new Rectangle(p11A_1.X + 3, p11A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  966. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalOrderCount), ft11, b, rec2A_1);
  967. Point p21A_1 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y);
  968. Point p21A_2 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
  969. g.DrawLine(p, p21A_1, p21A_2);
  970. Rectangle rec3A_1 = new Rectangle(p21A_1.X + 3, p21A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  971. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalOrderCountDb), ft11, b, rec3A_1);
  972. Point p31A_1 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y);
  973. Point p31A_2 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
  974. g.DrawLine(p, p31A_1, p31A_2);
  975. string StrPercentage = "";
  976. if (TotalOrderCountDb > 0)
  977. { StrPercentage = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((TotalOrderCount - TotalOrderCountDb) / TotalOrderCountDb * 100).ToString("0.00")) + "%"; }
  978. Rectangle rec4A_1 = new Rectangle(p31A_1.X + 3, p31A_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
  979. g.DrawString(StrPercentage.Trim(), ft11, b, rec4A_1);
  980. Point p41A_1 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y);
  981. Point p41A_2 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y + rec1A.Height);
  982. g.DrawLine(p, p41A_1, p41A_2);
  983. #endregion
  984. #region 业绩
  985. Rectangle rec1B_1 = new Rectangle(p41A_1.X + 3, p41A_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  986. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11, b, rec1B_1);
  987. Point p11B_1 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y);
  988. Point p11B_2 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
  989. g.DrawLine(p, p11B_1, p11B_2);
  990. Rectangle rec2B_1 = new Rectangle(p11B_1.X + 3, p11B_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  991. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmountDb), ft11, b, rec2B_1);
  992. Point p21B_1 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y);
  993. Point p21B_2 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
  994. g.DrawLine(p, p21B_1, p21B_2);
  995. string StrPercentage2 = "";
  996. if (TotalSeriesAmountDb > 0)
  997. { StrPercentage2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((TotalSeriesAmount - TotalSeriesAmountDb) / TotalSeriesAmountDb * 100).ToString("0.00")) + "%"; }
  998. Rectangle rec3B_1 = new Rectangle(p21B_1.X + 3, p21B_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
  999. g.DrawString(StrPercentage2, ft11, b, rec3B_1);
  1000. Point p31B_1 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y);
  1001. Point p31B_2 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y + rec1A.Height);
  1002. g.DrawLine(p, p31B_1, p31B_2);
  1003. #endregion
  1004. #region 均值
  1005. decimal strValueA = 0;
  1006. if (Convert.ToInt32(TotalOrderCount) > 0)
  1007. { strValueA = TotalSeriesAmount / Convert.ToInt32(TotalOrderCount); }
  1008. Rectangle rec4B_1 = new Rectangle(p31B_1.X + 3, p31B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  1009. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(strValueA.ToString("0.00")), ft11, b, rec4B_1);
  1010. Point p41B_1 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y);
  1011. Point p41B_2 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  1012. g.DrawLine(p, p41B_1, p41B_2);
  1013. decimal strValueB = 0;
  1014. if (Convert.ToInt32(TotalOrderCountDb) > 0)
  1015. { strValueB = TotalSeriesAmountDb / Convert.ToInt32(TotalOrderCountDb); }
  1016. Rectangle rec1C_1 = new Rectangle(p41B_1.X + 3, p41B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  1017. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(strValueB.ToString("0.00")), ft11, b, rec1C_1);
  1018. Point p11C_1 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y);
  1019. Point p11C_2 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  1020. g.DrawLine(p, p11C_1, p11C_2);
  1021. string StrPercentage3 = "";
  1022. if (strValueB > 0)
  1023. { StrPercentage3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((strValueA - strValueB) / strValueB * 100).ToString("0.00")) + "%"; }
  1024. Rectangle rec2C_1 = new Rectangle(p11C_1.X + 3, p11C_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
  1025. g.DrawString(StrPercentage3, ft11, b, rec2C_1);
  1026. Point p21C_1 = new Point(p11C_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1A.Y);
  1027. Point p21C_2 = new Point(p11C_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1A.Y + rec1A.Height);
  1028. g.DrawLine(p, p21C_1, p21C_2);
  1029. #endregion
  1030. #region 实收
  1031. Rectangle rec3C_1 = new Rectangle(p21C_1.X + 3, p21C_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  1032. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalPaidAmount), ft11, b, rec3C_1);
  1033. Point p31C_1 = new Point(p21C_1.X + ColumnWidthSplit4, rec1A.Y);
  1034. Point p31C_2 = new Point(p21C_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  1035. g.DrawLine(p, p31C_1, p31C_2);
  1036. Rectangle rec4C_1 = new Rectangle(p31C_1.X + 3, p31C_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  1037. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalPaidAmountDb), ft11, b, rec4C_1);
  1038. Point p41C_1 = new Point(p31C_1.X + ColumnWidthSplit4, rec1A.Y);
  1039. Point p41C_2 = new Point(p31C_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  1040. g.DrawLine(p, p41C_1, p41C_2);
  1041. string StrPercentage4 = "";
  1042. if (TotalPaidAmountDb > 0)
  1043. { StrPercentage4 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((TotalPaidAmount - TotalPaidAmountDb) / TotalPaidAmountDb * 100).ToString("0.00")) + "%"; }
  1044. Rectangle rec1D_1 = new Rectangle(p41C_1.X + 3, p41C_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit5 * 2, RowHeight);
  1045. g.DrawString(StrPercentage4, ft11, b, rec1D_1);
  1046. Point p11D_1 = new Point(p41C_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1A.Y);
  1047. Point p11D_2 = new Point(p41C_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1A.Y + rec1A.Height);
  1048. g.DrawLine(p, p11D_1, p11D_2);
  1049. #endregion
  1050. #region 余款
  1051. Rectangle rec2D_1 = new Rectangle(p11D_1.X + 3, p11D_1.Y + TopAdd, ColumnWidthSplit6, RowHeight);
  1052. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11, b, rec2D_1);
  1053. Point p21D_1 = new Point(p11D_1.X + ColumnWidthSplit6, rec1A.Y);
  1054. Point p21D_2 = new Point(p11D_1.X + ColumnWidthSplit6, rec1A.Y + rec1A.Height);
  1055. g.DrawLine(p, p21D_1, p21D_2);
  1056. Rectangle rec3D_1 = new Rectangle(p21D_1.X + 3, p21D_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit6 * 2, RowHeight);
  1057. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmountDb), ft11, b, rec3D_1);
  1058. Point p31D_1 = new Point(p21D_1.X + ColumnWidthSplit6, rec1A.Y);
  1059. Point p31D_2 = new Point(p21D_1.X + ColumnWidthSplit6, rec1A.Y + rec1A.Height);
  1060. g.DrawLine(p, p31D_1, p31D_2);
  1061. string StrPercentage5 = "";
  1062. if (TotalArrearsAmountDb > 0)
  1063. { StrPercentage5 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((TotalArrearsAmount - TotalArrearsAmountDb) / TotalArrearsAmountDb * 100).ToString("0.00")) + "%"; }
  1064. Rectangle rec4D_1 = new Rectangle(p31D_1.X + 3, p31D_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit6 * 2, RowHeight);
  1065. g.DrawString(StrPercentage5, ft11, b, rec4D_1);
  1066. #endregion
  1067. #endregion
  1068. }
  1069. else
  1070. {
  1071. this.panelEx3.Visible = false;
  1072. this.panelEx2.Dock = DockStyle.Fill;
  1073. }
  1074. #endregion
  1075. }
  1076. this.PictImage.Image = newBmp;
  1077. this.PublicFunctionView();
  1078. }
  1079. void SetPostionData(string ordType,string columType, Rectangle rectangle, string startTime,string endTime,LYFZ.ComponentLibrary.ComboBoxTreeViewEx divideShopCode)
  1080. {
  1081. ModelImagePostionAction actionModel=null;
  1082. string SqlSelect = "";
  1083. string sqlWhere = "";
  1084. switch(ordType)
  1085. {
  1086. case "订单":
  1087. SqlSelect += @" with t AS
  1088. (
  1089. select Pay_OrdNumber,sum(Pay_AmountOf) AS Pay_AmountOf,Sc_ClassName from tb_ErpPayment inner join tb_ErpSystemCategory on Sc_ClassCode=Pay_PaymentMethod where Pay_Type = 0 And Pay_Category in ('全款','预约收款','预约补款') Group By Pay_OrdNumber ,Sc_ClassName
  1090. ) ";
  1091. SqlSelect += @" select '订单' AS 类型,Sc_ClassName as 付款方式,Cus_Name as '客户名称',Cus_Telephone as '联系电话',Ord_SeriesName as '套系名称',
  1092. (tb_ErpOrder.Ord_Number) AS 订单号,
  1093. sum(isnull(Ord_SeriesPrice,0)) AS 业绩,
  1094. sum(isnull(Pay_AmountOf,0)) AS 实收 ,
  1095. ( sum(isnull(Ord_SeriesPrice,0)) - sum(isnull(Pay_AmountOf,0)) ) as 余款
  1096. from tb_ErpOrder inner join tempTB_AggregationCustomer on GP_OrderNumber=Ord_Number Left Join t on Pay_OrdNumber = Ord_Number
  1097. ";
  1098. sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_SaveOrderDateTime", startTime, endTime, ConnectWord: "") +
  1099. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop") ;
  1100. sqlWhere += " group by Ord_Number,t.Sc_ClassName,Cus_Name,Cus_Telephone,Ord_SeriesName";
  1101. break;
  1102. case "选片":
  1103. SqlSelect += @" select
  1104. '选片' AS 类型,
  1105. Cus_Name as '客户名称',Cus_Telephone as '联系电话',Ord_SeriesName as '套系名称',
  1106. Ordv_Number as 订单号,Sc_ClassName as 付款方式,
  1107. (select sum(isnull(Plu_Amount,0)) from tb_ErpPlusPickItems where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ') as 业绩,
  1108. isnull( Pay_AmountOf,0) as 实收,
  1109. 0 as 余款
  1110. from tb_ErpOrderDigital inner join
  1111. tb_ErpPlusPickItems on Plu_OrdNumber = Ordv_Number Left Join
  1112. tb_ErpPayment on
  1113. Plu_Number = Pay_PlusPickNumber left join tb_ErpSystemCategory on Sc_ClassCode=Pay_PaymentMethod
  1114. inner join tempTB_AggregationCustomer on GP_OrderNumber=Ordv_Number
  1115. inner join tb_ErpOrder on Ord_Number = Ordv_Number
  1116. ";
  1117. sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_FilmSelectionTime", startTime, endTime, ConnectWord: "") +
  1118. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "plu_dividedshop") + " And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ' ";
  1119. sqlWhere += " group by Ordv_Number,Sc_ClassName,Cus_Name,Cus_Telephone,Ord_SeriesName,Pay_AmountOf";
  1120. break;
  1121. case "散客消费":
  1122. SqlSelect += @" select
  1123. '散客消费' AS 类型,
  1124. Cus_Name as '客户名称', Cus_Telephone as '联系电话',Ord_SeriesName as '套系名称',
  1125. (tb_ErpTwoSalesOrder.Tsorder_Number) AS 订单号,
  1126. isnull(Sum(Tsorder_Money),0) AS 业绩,
  1127. isnull(Sum(Pay_AmountOf),0) AS 实收 ,
  1128. (sum(isnull(Tsorder_Money,0)) - sum(isnull(Pay_AmountOf,0)) ) as 余款
  1129. from tb_ErpTwoSalesOrder Left Join tb_ErpPayment on Pay_OrdNumber = Tsorder_Number And Pay_Type = 1 left join tb_ErpSystemCategory on Sc_ClassCode=Pay_PaymentMethod
  1130. left join tempTB_AggregationCustomer on GP_OrderNumber=Tsorder_Number
  1131. left join tb_ErpOrder on Ord_Number = Tsorder_Number
  1132. ";
  1133. sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Tsorder_CreateDatetime", startTime, endTime, ConnectWord: "") +
  1134. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "tsorder_dividedshop");
  1135. sqlWhere += " group by Tsorder_Number,Sc_ClassName,Cus_Name,Cus_Telephone,Ord_SeriesName";
  1136. break;
  1137. case "礼服租售":
  1138. SqlSelect += @"select
  1139. '礼服租售' AS 类型,
  1140. (Dsro_Number) AS 订单号,
  1141. isnull(Sum(Dsro_Amount),0) AS 业绩,
  1142. isnull(Sum(Pay_AmountOf),0) AS 实收 ,
  1143. (sum(isnull(Dsro_Amount,0)) - sum(isnull(Pay_AmountOf,0)) ) as 余款
  1144. from tb_ErpDressSaleRentalOrder Left Join tb_ErpPayment on Pay_OrdNumber = Dsro_Number And Pay_Type = 2 left join tb_ErpSystemCategory on Sc_ClassCode=Pay_PaymentMethod
  1145. ";
  1146. sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Dsro_CreateDateTime", startTime, endTime, ConnectWord: "") +
  1147. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "dsro_dividedshop");
  1148. sqlWhere += " group by Dsro_Number,Sc_ClassName";
  1149. break;
  1150. }
  1151. switch (columType)
  1152. {
  1153. case "消费次数":
  1154. actionModel = new ModelImagePostionAction()
  1155. {
  1156. OrdType=ordType,
  1157. ColumType= columType,
  1158. MouseX = rectangle.X,
  1159. MouseY = rectangle.Y,
  1160. MouseWidth = rectangle.Width,
  1161. MouseHeight = rectangle.Height,
  1162. SqlData = SqlSelect + " where " + sqlWhere
  1163. };
  1164. break;
  1165. case "业绩":
  1166. actionModel = new ModelImagePostionAction()
  1167. {
  1168. OrdType = ordType,
  1169. ColumType = columType,
  1170. MouseX = rectangle.X,
  1171. MouseY = rectangle.Y,
  1172. MouseWidth = rectangle.Width,
  1173. MouseHeight = rectangle.Height,
  1174. SqlData = SqlSelect + " where " + sqlWhere
  1175. };
  1176. break;
  1177. case "均价":
  1178. actionModel = new ModelImagePostionAction()
  1179. {
  1180. OrdType = ordType,
  1181. ColumType = columType,
  1182. MouseX = rectangle.X,
  1183. MouseY = rectangle.Y,
  1184. MouseWidth = rectangle.Width,
  1185. MouseHeight = rectangle.Height,
  1186. SqlData = SqlSelect + " where " + sqlWhere
  1187. };
  1188. break;
  1189. case "实收":
  1190. actionModel = new ModelImagePostionAction()
  1191. {
  1192. OrdType = ordType,
  1193. ColumType = columType,
  1194. MouseX = rectangle.X,
  1195. MouseY = rectangle.Y,
  1196. MouseWidth = rectangle.Width,
  1197. MouseHeight = rectangle.Height,
  1198. SqlData = SqlSelect + " where " + sqlWhere
  1199. };
  1200. break;
  1201. case "余款":
  1202. actionModel = new ModelImagePostionAction()
  1203. {
  1204. OrdType = ordType,
  1205. ColumType = columType,
  1206. MouseX = rectangle.X,
  1207. MouseY = rectangle.Y,
  1208. MouseWidth = rectangle.Width,
  1209. MouseHeight = rectangle.Height,
  1210. SqlData = SqlSelect + " where " + sqlWhere
  1211. };
  1212. break;
  1213. }
  1214. actionModel.OrdTitle = this.UcNavigationTool.LabTitle;
  1215. if (actionModel != null)
  1216. {
  1217. actionList.Add(actionModel);
  1218. }
  1219. }
  1220. /// <summary>
  1221. /// 创建图表
  1222. /// </summary>
  1223. private void PublicFunctionView()
  1224. {
  1225. this.chart1.Titles.Clear();
  1226. this.chart1.Series.Clear();
  1227. this.chart2.Series.Clear();
  1228. this.chart2.Titles.Clear();
  1229. Series tempseries = null;
  1230. if (this.htDataView.Count > 1)
  1231. {
  1232. #region 无启用对比
  1233. if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Column")
  1234. {
  1235. this.chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;
  1236. #region 柱状图
  1237. this.chart1.Legends["Legend1"].Enabled = true;
  1238. int forCount = 0;
  1239. foreach (DictionaryEntry item in htDataView)
  1240. {
  1241. string[] StrArray = item.Value.ToString().Trim().Split('|');
  1242. string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
  1243. if (Convert.ToDecimal(StrValue) != 0)
  1244. {
  1245. tempseries = new Series(item.Key.ToString().Trim());
  1246. tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
  1247. this.chart1.Series.Add(tempseries);
  1248. this.chart1.Series[forCount].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
  1249. this.chart1.Series[forCount].Points.Clear();
  1250. this.chart1.Series[forCount].ToolTip = item.Key.ToString().Trim();
  1251. this.chart1.ChartAreas["ChartArea1"].AxisX.Interval = htDataView.Count;//x轴数据显示间隔
  1252. tempseries.Points.AddXY("0", StrValue);
  1253. if (Convert.ToDecimal(StrValue) > 0)
  1254. { tempseries.Points[0].IsValueShownAsLabel = true; }
  1255. forCount++;
  1256. }
  1257. }
  1258. #endregion
  1259. }
  1260. else if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Pie")
  1261. {
  1262. this.chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
  1263. #region 饼形图
  1264. if (this.chkComparedStartUp.Checked)
  1265. {
  1266. string StrTitlesDb = this.dtDataTimeStart.DateValue.Trim() + " — " + this.dtDataTimeEnd.DateValue.Trim() + " 图表";
  1267. this.chart1.Titles.Add(StrTitlesDb);
  1268. }
  1269. this.chart1.Legends["Legend1"].Enabled = true;
  1270. tempseries = new Series();
  1271. tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
  1272. this.chart1.Series.Add(tempseries);
  1273. this.chart1.Series[0]["PieLabelStyle"] = "Outside";//将文字移到外侧
  1274. this.chart1.Series[0]["PieLineColor"] = "Black";//绘制黑色的连线。
  1275. List<string> xData = new List<string>();
  1276. List<double> yData = new List<double>();
  1277. int forCount = 0;
  1278. foreach (DictionaryEntry item in htDataView)
  1279. {
  1280. string[] StrArray = item.Value.ToString().Trim().Split('|');
  1281. string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
  1282. if (Convert.ToDecimal(StrValue) != 0)
  1283. {
  1284. this.chart1.Series[0].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
  1285. this.chart1.Series[0].Points.Clear();
  1286. this.chart1.Series[0].ToolTip = item.Key.ToString().Trim()+ ":" + StrValue;
  1287. xData.Add(item.Key.ToString().Trim() + ":" + StrValue);
  1288. yData.Add(Convert.ToDouble(StrValue));
  1289. forCount++;
  1290. }
  1291. }
  1292. this.chart1.Series[0].Points.DataBindXY(xData, yData);
  1293. #endregion
  1294. }
  1295. #endregion
  1296. }
  1297. if (this.chkComparedStartUp.Checked)
  1298. {
  1299. if (this.htDataViewDb.Count > 1)
  1300. {
  1301. #region 启用对比
  1302. if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Column")
  1303. {
  1304. this.chart2.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;
  1305. #region 柱状图
  1306. this.chart2.Legends["Legend1"].Enabled = true;
  1307. int forCount = 0;
  1308. foreach (DictionaryEntry item in htDataViewDb)
  1309. {
  1310. string[] StrArray = item.Value.ToString().Trim().Split('|');
  1311. string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
  1312. if (Convert.ToDecimal(StrValue) != 0)
  1313. {
  1314. tempseries = new Series(item.Key.ToString().Trim());
  1315. tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
  1316. this.chart2.Series.Add(tempseries);
  1317. this.chart2.Series[forCount].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
  1318. this.chart2.Series[forCount].Points.Clear();
  1319. this.chart2.Series[forCount].ToolTip = item.Key.ToString().Trim();
  1320. this.chart2.ChartAreas["ChartArea1"].AxisX.Interval = htDataViewDb.Count;//x轴数据显示间隔
  1321. tempseries.Points.AddXY("0", StrValue);
  1322. if (Convert.ToDecimal(StrValue) > 0)
  1323. { tempseries.Points[0].IsValueShownAsLabel = true; }
  1324. forCount++;
  1325. }
  1326. }
  1327. #endregion
  1328. }
  1329. else if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Pie")
  1330. {
  1331. this.chart2.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
  1332. #region 饼形图
  1333. string StrTitlesDb = this.dtDataTimeStartCompared.DateValue.Trim() + " — " + this.dtDateTimeEndCompared.DateValue.Trim() + " 图表";
  1334. this.chart2.Titles.Add(StrTitlesDb);
  1335. this.chart2.Legends["Legend1"].Enabled = true;
  1336. tempseries = new Series();
  1337. tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
  1338. this.chart2.Series.Add(tempseries);
  1339. this.chart2.Series[0]["PieLabelStyle"] = "Outside";//将文字移到外侧
  1340. this.chart2.Series[0]["PieLineColor"] = "Black";//绘制黑色的连线。
  1341. List<string> xData = new List<string>();
  1342. List<double> yData = new List<double>();
  1343. int forCount = 0;
  1344. foreach (DictionaryEntry item in htDataViewDb)
  1345. {
  1346. string[] StrArray = item.Value.ToString().Trim().Split('|');
  1347. string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
  1348. if (Convert.ToDecimal(StrValue) != 0)
  1349. {
  1350. this.chart2.Series[0].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
  1351. this.chart2.Series[0].Points.Clear();
  1352. this.chart2.Series[0].ToolTip = item.Key.ToString().Trim()+ ":" + StrValue;
  1353. xData.Add(item.Key.ToString().Trim() + ":" + StrValue);
  1354. yData.Add(Convert.ToDouble(StrValue));
  1355. forCount++;
  1356. }
  1357. }
  1358. this.chart2.Series[0].Points.DataBindXY(xData, yData);
  1359. #endregion
  1360. }
  1361. #endregion
  1362. }
  1363. }
  1364. }
  1365. }
  1366. }