AnalyzedOrderSelectionFilmFormMain.cs 90 KB

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