AnalyzedOrderRetakeFormMain.cs 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  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 AnalyzedOrderRetakeFormMain : LYFZ.Software.UI.DecisionAssistant.AnalyzedOrderRetakeFormMain
  15. {
  16. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  17. List<ModelImagePostionAction> actionList = new List<ModelImagePostionAction>();
  18. public AnalyzedOrderRetakeFormMain()
  19. {
  20. this.Load += AnalyzedOrderRetakeFormMain_Load;
  21. this.Shown += AnalyzedOrderRetakeFormMain_Shown;
  22. this.btnQuery.Click += btnQuery_Click;
  23. this.btnQueryCompared.Click += btnQueryCompared_Click;
  24. this.btnSaveAs.Click += btnSaveAs_Click;
  25. this.btnCloseed.Click += btnCloseed_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 += AnalyzedOrderRetakeFormMain_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.BindDataGridView3(action);
  43. detailForm.ShowDialog();
  44. //MessageBox.Show("内容!");
  45. }
  46. }
  47. void SetPostionData(string ordType, string columType, Rectangle rectangle, string where, string startTime, string endTime)
  48. {
  49. ModelImagePostionAction actionModel = null;
  50. string SqlSelect = @"";
  51. string sqlWhere = "";
  52. SqlSelect = "with tt as ( select Ordrr_Person1 as 摄影师,Ordrr_Person2 as 摄影助理,Ordrr_Person3 as 化妆师,Ordrr_Person4 as 化妆助理,Ordrr_Person5 as 引导师,Ordrr_Person6 as 引导助理,Ordrr_RetakePerson as 重拍责任人,Ordrr_DateTime 时间,0 AS Ordrr_Type from tb_ErpOrderRetakeRecord " +
  53. "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordrr_DateTime", startTime, endTime, ConnectWord: "") + " " +
  54. " UNION ALL " +
  55. "select Ordpg_Photographer as 摄影师,Ordpg_PhotographyAssistant as 摄影助理,Ordpg_MakeupArtist as 化妆师,Ordpg_MakeupAssistant as 化妆助理,Ordpg_BootDivision as 引导师,Ordpg_BootDivisionAssistant as 引导助理,'' AS 重拍责任人,Ordpg_PhotographyTime as 时间,1 AS Ordrr_Type from tb_ErpOrdersPhotography " +
  56. "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordpg_PhotographyTime", startTime, endTime, ConnectWord: "") + " )";
  57. SqlSelect += " select 摄影师,摄影助理,化妆师,化妆助理,引导师,引导助理,重拍责任人,时间 from tt ";
  58. sqlWhere += " 摄影师 in ('" + columType + "') or 摄影助理 in ('" + columType + "') or 化妆师 in ('" + columType + "') or 化妆助理 in ('" + columType + "') or 引导师 in ('" + columType + "') or 引导助理 in ('" + columType + "') ";
  59. actionModel = new ModelImagePostionAction()
  60. {
  61. OrdType = ordType,
  62. ColumType = columType,
  63. MouseX = rectangle.X,
  64. MouseY = rectangle.Y,
  65. MouseWidth = rectangle.Width,
  66. MouseHeight = rectangle.Height,
  67. SqlData = SqlSelect + " where " + sqlWhere
  68. };
  69. actionModel.OrdTitle = this.UcNavigationTool.LabTitle;
  70. if (actionModel != null)
  71. {
  72. actionList.Add(actionModel);
  73. }
  74. }
  75. bool IsFristLoad = true;
  76. /// <summary>
  77. /// 窗体加载事件
  78. /// </summary>
  79. /// <param name="sender"></param>
  80. /// <param name="e"></param>
  81. void AnalyzedOrderRetakeFormMain_Load(object sender, EventArgs e)
  82. {
  83. this.panelQueryCompared.Visible = false;
  84. this.dtDataTimeStart.DateValue = SDateTime.Now.ToString("yyyy-MM") + "-01";
  85. this.dtDataTimeEnd.DateValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
  86. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevDisplayItem, "0:拍摄次数,1:重拍次数,2:重拍率", IsSplit: true);
  87. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevDisplayMethod, "Pie:饼形图,Column:柱状图", IsSplit: true);
  88. this.cmbtreevDisplayItem.TagFindText("0");
  89. this.cmbtreevDisplayMethod.TagFindText("Pie");
  90. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbtreevOrdersPerson, IsShowResign: false);
  91. if (this.cmbtreevOrdersPerson.Nodes[0].Nodes.Count > 0)
  92. { this.cmbtreevOrdersPerson.Nodes[0].Nodes[0].Expand(); }
  93. else
  94. { this.cmbtreevOrdersPerson.Nodes[0].Expand(); }
  95. if (cmbtreevOrdersPerson.GetNodeItem_TextToTag("门市部") == null)
  96. {
  97. this.cmbtreevOrdersPerson.TextFindTag(this.cmbtreevOrdersPerson.Nodes[0].Text.Trim());
  98. this.cmbtreevOrdersPerson.SelectedNode = this.cmbtreevOrdersPerson.GetNodeItem_TextToTag(this.cmbtreevOrdersPerson.Nodes[0].Text.Trim());
  99. }
  100. else
  101. {
  102. this.cmbtreevOrdersPerson.TextFindTag("门市部");
  103. this.cmbtreevOrdersPerson.SelectedNode = this.cmbtreevOrdersPerson.GetNodeItem_TextToTag("门市部");
  104. }
  105. }
  106. /// <summary>
  107. /// 窗体加载事件
  108. /// </summary>
  109. /// <param name="sender"></param>
  110. /// <param name="e"></param>
  111. void AnalyzedOrderRetakeFormMain_Shown(object sender, EventArgs e)
  112. {
  113. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.决策助手重拍分析);
  114. if (!b)
  115. {
  116. this.Close();
  117. return;
  118. }
  119. this.chart1.Focus();
  120. this.chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
  121. this.chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
  122. this.chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
  123. this.chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;//将滚动内嵌到坐标轴中
  124. this.chart1.ChartAreas["ChartArea1"].AxisX.ScrollBar.Size = 20;// 设置滚动条的大小
  125. this.chart1.ChartAreas["ChartArea1"].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;// 设置滚动条的按钮的风格,下面代码是将所有滚动条上的按钮都显示出来
  126. this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollSize = double.NaN;// 设置自动放大与缩小的最小量
  127. this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollMinSize = 2;
  128. this.chart2.Focus();
  129. this.chart2.ChartAreas[0].CursorX.IsUserEnabled = true;
  130. this.chart2.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
  131. this.chart2.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
  132. this.chart2.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;//将滚动内嵌到坐标轴中
  133. this.chart2.ChartAreas["ChartArea1"].AxisX.ScrollBar.Size = 20;// 设置滚动条的大小
  134. this.chart2.ChartAreas["ChartArea1"].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;// 设置滚动条的按钮的风格,下面代码是将所有滚动条上的按钮都显示出来
  135. this.chart2.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollSize = double.NaN;// 设置自动放大与缩小的最小量
  136. this.chart2.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollMinSize = 2;
  137. this.PublicFunctionRows();
  138. this.IsFristLoad = false;
  139. }
  140. /// <summary>
  141. /// 查询
  142. /// </summary>
  143. /// <param name="sender"></param>
  144. /// <param name="e"></param>
  145. void btnQuery_Click(object sender, EventArgs e)
  146. {
  147. this.PublicFunctionRows();
  148. }
  149. /// <summary>
  150. /// 对比查询
  151. /// </summary>
  152. /// <param name="sender"></param>
  153. /// <param name="e"></param>
  154. void btnQueryCompared_Click(object sender, EventArgs e)
  155. {
  156. this.PublicFunctionRows();
  157. }
  158. /// <summary>
  159. /// 另存为
  160. /// </summary>
  161. /// <param name="sender"></param>
  162. /// <param name="e"></param>
  163. void btnSaveAs_Click(object sender, EventArgs e)
  164. {
  165. string StrFilleName = Convert.ToDateTime(this.dtDataTimeStart.DateValue).ToString("yyyy年MM月dd日") + " — " + Convert.ToDateTime(this.dtDataTimeEnd.DateValue).ToString("yyyy年MM月dd日") + " 重拍统计分析表";
  166. if (this.chkComparedStartUp.Checked)
  167. { StrFilleName = this.dtDataTimeStart.DateValue.Trim() + "—" + this.dtDataTimeEnd.DateValue.Trim() + " 与 " + this.dtDataTimeStartCompared.DateValue.Trim() + "—" + this.dtDateTimeEndCompared.DateValue.Trim() + " 重拍统计分析表"; }
  168. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DownloadSaveAs(this.PictImage.Image, StrFilleName: StrFilleName);
  169. }
  170. /// <summary>
  171. /// 关闭
  172. /// </summary>
  173. /// <param name="sender"></param>
  174. /// <param name="e"></param>
  175. void btnCloseed_Click(object sender, EventArgs e)
  176. {
  177. this.Close();
  178. }
  179. /// <summary>
  180. /// 启动对比
  181. /// </summary>
  182. /// <param name="sender"></param>
  183. /// <param name="e"></param>
  184. void chkComparedStartUp_Click(object sender, EventArgs e)
  185. {
  186. if (this.chkComparedStartUp.Checked)
  187. {
  188. this.panelCloseed.Visible = false;
  189. this.panelSaveAs.Visible = false;
  190. this.panelQueryCompared.Visible = true;
  191. this.panelSaveAs.Visible = true;
  192. this.panelCloseed.Visible = true;
  193. if (!string.IsNullOrEmpty(this.dtDataTimeStartCompared.DateValue.Trim()) && !string.IsNullOrEmpty(this.dtDateTimeEndCompared.DateValue.Trim()))
  194. { this.PublicFunctionRows(); }
  195. }
  196. else
  197. {
  198. this.panelQueryCompared.Visible = false;
  199. this.PublicFunctionRows();
  200. }
  201. }
  202. /// <summary>
  203. /// 开始日期离开事件
  204. /// </summary>
  205. /// <param name="sender"></param>
  206. /// <param name="e"></param>
  207. void dtDataTimeStart_Leave(object sender, EventArgs e)
  208. {
  209. this.dtDataTimeEnd.DateValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
  210. }
  211. /// <summary>
  212. /// 开始日期离开事件
  213. /// </summary>
  214. /// <param name="sender"></param>
  215. /// <param name="e"></param>
  216. void dtDataTimeStartCompared_Leave(object sender, EventArgs e)
  217. {
  218. this.dtDateTimeEndCompared.DateValue = Convert.ToDateTime(this.dtDataTimeStartCompared.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
  219. }
  220. /// <summary>
  221. /// 显示项目
  222. /// </summary>
  223. /// <param name="sender"></param>
  224. /// <param name="e"></param>
  225. void cmbtreevDisplayItem_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  226. {
  227. this.PublicFunctionView();
  228. }
  229. /// <summary>
  230. /// 显示方式
  231. /// </summary>
  232. /// <param name="sender"></param>
  233. /// <param name="e"></param>
  234. void cmbtreevDisplayMethod_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  235. {
  236. this.PublicFunctionView();
  237. }
  238. /// <summary>
  239. /// 窗体大小发生变化
  240. /// </summary>
  241. /// <param name="sender"></param>
  242. /// <param name="e"></param>
  243. void AnalyzedOrderRetakeFormMain_Resize(object sender, EventArgs e)
  244. {
  245. switch (this.panelCloseed.Location.Y)
  246. {
  247. case 1: this.flowLayoutPanel1.Height = 35; break;
  248. case 35: this.flowLayoutPanel1.Height = 70; break;
  249. }
  250. if (this.IsFristLoad)
  251. {
  252. this.panelEx4.Width = this.panelEx6.Width / 2;
  253. }
  254. }
  255. Hashtable htDataView = new Hashtable();
  256. Hashtable htDataViewDb = new Hashtable();
  257. /// <summary>
  258. /// 创建行
  259. /// </summary>
  260. private void PublicFunctionRows()
  261. {
  262. actionList.Clear();
  263. #region 处理数据前判断
  264. if (this.chkComparedStartUp.Checked)
  265. {
  266. if (string.IsNullOrEmpty(this.dtDataTimeStart.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDataTimeEnd.DateValue.Trim()))
  267. { MessageBoxCustom.Show("对比前日期段不能为空"); return; }
  268. if (Convert.ToDateTime(this.dtDataTimeEnd.DateValue) < Convert.ToDateTime(this.dtDataTimeStart.DateValue))
  269. { MessageBoxCustom.Show("对比前开始日期不能大于结束日期"); return; }
  270. if (string.IsNullOrEmpty(this.dtDataTimeStartCompared.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDateTimeEndCompared.DateValue.Trim()))
  271. { MessageBoxCustom.Show("对比后日期段不能为空"); return; }
  272. if (Convert.ToDateTime(this.dtDateTimeEndCompared.DateValue) < Convert.ToDateTime(this.dtDataTimeStartCompared.DateValue))
  273. { MessageBoxCustom.Show("对比后开始日期不能大于结束日期"); return; }
  274. if (Convert.ToDateTime(this.dtDateTimeEndCompared.DateValue.Trim()) > Convert.ToDateTime(this.dtDataTimeStart.DateValue.Trim()))
  275. { MessageBoxCustom.Show("对比后的结束日期不能大于对比前的开始日期"); return; }
  276. }
  277. else
  278. {
  279. if (string.IsNullOrEmpty(this.dtDataTimeStart.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDataTimeEnd.DateValue.Trim()))
  280. { MessageBoxCustom.Show("日期段不能为空"); return; }
  281. if (Convert.ToDateTime(this.dtDataTimeEnd.DateValue) < Convert.ToDateTime(this.dtDataTimeStart.DateValue))
  282. { MessageBoxCustom.Show("开始日期不能大于结束日期"); return; }
  283. }
  284. this.IsFristLoad = true;
  285. this.AnalyzedOrderRetakeFormMain_Resize(this, null);
  286. this.IsFristLoad = false;
  287. this.htDataView.Clear();
  288. this.htDataViewDb.Clear();
  289. this.actionList.Clear();
  290. #endregion
  291. Bitmap newBmp = new Bitmap(this.PictImage.Width, 900);
  292. Graphics g = Graphics.FromImage(newBmp);
  293. g.Clear(System.Drawing.Color.White);
  294. Brush b = Brushes.Black;
  295. Pen p = LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.PenborderColor;
  296. Font ft12b = new Font("微软雅黑", 12);
  297. Font ft11b = new Font("微软雅黑", 11);
  298. Font ft11 = new Font("微软雅黑", 11, FontStyle.Italic);
  299. if (this.chkComparedStartUp.Checked)
  300. {
  301. ft12b = new Font("微软雅黑", 11);
  302. ft11b = new Font("微软雅黑", 10);
  303. ft11 = new Font("微软雅黑", 10, FontStyle.Italic);
  304. }
  305. Font ft15 = new Font("微软雅黑", 15);
  306. int TopAdd = 7;
  307. int LeftWidth = 30;
  308. int TableWidth = newBmp.Width - LeftWidth * 2;
  309. int ColumnWidth1 = TableWidth / 4;
  310. if (this.chkComparedStartUp.Checked)
  311. { ColumnWidth1 = 200; }
  312. int ColumnWidth2 = (TableWidth - ColumnWidth1) / 3;
  313. int ColumnWidth3 = (TableWidth - ColumnWidth1) / 3;
  314. int ColumnWidth4 = (TableWidth - ColumnWidth1) / 3;
  315. int TableHeoght = 300 - 60;
  316. int RowHeight = TableHeoght / 7;
  317. string StrTypeTextNull = " ";
  318. if (this.chkComparedStartUp.Checked)
  319. { StrTypeTextNull = " "; }
  320. string StrTimeStrat = this.dtDataTimeStart.DateValue.Trim();
  321. string StrTimeEnd = this.dtDataTimeEnd.DateValue.Trim();
  322. string StrOrdersPerson = "";
  323. string StrOrdersPersoning = "";
  324. if (this.cmbtreevOrdersPerson.Tag != null)
  325. {
  326. if (this.cmbtreevOrdersPerson.StrGetName.Trim() == "User")
  327. {
  328. StrOrdersPerson = " in ('" + this.cmbtreevOrdersPerson.Tag.ToString().Trim() + "')";
  329. StrOrdersPersoning += this.cmbtreevOrdersPerson.Tag.ToString().Trim() + ",";
  330. }
  331. else if (this.cmbtreevOrdersPerson.StrGetName.Trim() == "Department")
  332. {
  333. for (int i = 0; i < this.cmbtreevOrdersPerson.SelectedNode.Nodes.Count; i++)
  334. {
  335. StrOrdersPerson += "'" + this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Tag.ToString().Trim() + "',";
  336. StrOrdersPersoning += this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Tag.ToString().Trim() + ",";
  337. }
  338. if (!string.IsNullOrEmpty(StrOrdersPerson))
  339. { StrOrdersPerson = " in (" + StrOrdersPerson.TrimEnd(',') + ")"; }
  340. }
  341. else if (this.cmbtreevOrdersPerson.StrGetName.Trim() == "StoreName")
  342. {
  343. for (int i = 0; i < this.cmbtreevOrdersPerson.SelectedNode.Nodes.Count; i++)
  344. {
  345. if (this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Name.Trim() == "Department" && this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Nodes.Count > 0)
  346. {
  347. for (int j = 0; j < this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Nodes.Count; j++)
  348. {
  349. StrOrdersPerson += "'" + this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Nodes[j].Tag.ToString().Trim() + "',";
  350. StrOrdersPersoning += this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Nodes[j].Tag.ToString().Trim() + ",";
  351. }
  352. }
  353. }
  354. if (!string.IsNullOrEmpty(StrOrdersPerson))
  355. { StrOrdersPerson = " in (" + StrOrdersPerson.TrimEnd(',') + ")"; }
  356. }
  357. }
  358. string ExecuteSql = "select Ordrr_Person1,Ordrr_Person2,Ordrr_Person3,Ordrr_Person4,Ordrr_Person5,Ordrr_Person6,Ordrr_RetakePerson,Ordrr_DateTime,0 AS Ordrr_Type from tb_ErpOrderRetakeRecord " +
  359. "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordrr_DateTime", StrTimeStrat, StrTimeEnd, ConnectWord: "") + " And (Ordrr_Person1" + StrOrdersPerson + " or Ordrr_Person2" + StrOrdersPerson + " or Ordrr_Person3" + StrOrdersPerson + " or Ordrr_Person4" + StrOrdersPerson + " or Ordrr_Person5" + StrOrdersPerson + " or Ordrr_Person6" + StrOrdersPerson + ")" +
  360. " UNION ALL " +
  361. "select Ordpg_Photographer,Ordpg_PhotographyAssistant,Ordpg_MakeupArtist,Ordpg_MakeupAssistant,Ordpg_BootDivision,Ordpg_BootDivisionAssistant,'' AS Ordrr_RetakePerson,Ordpg_PhotographyTime,1 AS Ordrr_Type from tb_ErpOrdersPhotography " +
  362. "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordpg_PhotographyTime", StrTimeStrat, StrTimeEnd, ConnectWord: "") + " And (Ordpg_Photographer" + StrOrdersPerson + " or Ordpg_PhotographyAssistant" + StrOrdersPerson + " or Ordpg_MakeupArtist" + StrOrdersPerson + " or Ordpg_MakeupAssistant" + StrOrdersPerson + " or Ordpg_BootDivision" + StrOrdersPerson + " or Ordpg_BootDivisionAssistant" + StrOrdersPerson + ")";
  363. DataSet dsData = orbll.GetView_Custom(ExecuteSql);
  364. DataTable dt_table = dsData.Tables["ds"];
  365. if (!this.chkComparedStartUp.Checked)
  366. {
  367. this.panelEx4.Visible = false;
  368. #region 无启动对比
  369. int ForTopLoad = 15;
  370. string StrValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).ToString("yyyy年MM月dd日") + " — " + Convert.ToDateTime(this.dtDataTimeEnd.DateValue).ToString("yyyy年MM月dd日") + " 重拍分析表";
  371. SizeF sizef = g.MeasureString(StrValue, ft15);
  372. int FtHeigth = Convert.ToInt32(sizef.Height);
  373. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  374. Rectangle rec = new Rectangle(TableWidth / 2 - FtWidth / 2, ForTopLoad, FtWidth, FtHeigth);
  375. g.DrawString(StrValue, ft15, b, rec);//画消费法规
  376. ForTopLoad = rec.Y + rec.Height;
  377. #region 标题
  378. Rectangle rec1 = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
  379. g.DrawRectangle(p, rec1);//画标题矩形
  380. Rectangle recBackColor1 = new Rectangle(rec1.X + 1, rec1.Y + 1, rec1.Width - 1, rec1.Height - 1);
  381. g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.backColortitle, recBackColor1);//画标题矩形
  382. Rectangle rec1_1 = new Rectangle(rec1.X, rec1.Y + TopAdd, ColumnWidth1, RowHeight);
  383. g.DrawString("", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1_1);
  384. Point p11_1 = new Point(rec1.X + ColumnWidth1, rec1.Y);
  385. Point p11_2 = new Point(rec1.X + ColumnWidth1, rec1.Y + rec1.Height);
  386. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11_1, p11_2);
  387. Rectangle rec2_1 = new Rectangle(p11_1.X + ColumnWidth2 / 2 - 26, p11_1.Y + TopAdd, ColumnWidth2, RowHeight);
  388. g.DrawString("拍摄次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2_1);
  389. Point p21_1 = new Point(p11_1.X + ColumnWidth2, rec1.Y);
  390. Point p21_2 = new Point(p11_1.X + ColumnWidth2, rec1.Y + rec1.Height);
  391. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21_1, p21_2);
  392. Rectangle rec3_1 = new Rectangle(p21_1.X + ColumnWidth3 / 2 - 20, p21_1.Y + TopAdd, ColumnWidth3, RowHeight);
  393. g.DrawString("重拍次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3_1);
  394. Point p31_1 = new Point(p21_1.X + ColumnWidth3, rec1.Y);
  395. Point p31_2 = new Point(p21_1.X + ColumnWidth3, rec1.Y + rec1.Height);
  396. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31_1, p31_2);
  397. Rectangle rec4_1 = new Rectangle(p31_1.X + ColumnWidth4 / 2 - 20, p31_1.Y + TopAdd, ColumnWidth4, RowHeight);
  398. g.DrawString("重拍率", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4_1);
  399. ForTopLoad += rec1.Height;
  400. #endregion
  401. int TotalOrderCount = 0;
  402. decimal TotalSeriesAmount = 0;
  403. string[] StrArray = StrOrdersPersoning.Trim().TrimEnd(',').Split(',');
  404. int SingleOrDouble = 0;
  405. for (int i = 0; i < StrArray.Length; i++)
  406. {
  407. DataRow[] dtRows = dt_table.Select("Ordrr_Person1 = '" + StrArray[i].Trim() + "' or Ordrr_Person2 = '" + StrArray[i].Trim() + "' or Ordrr_Person3 = '" + StrArray[i].Trim() + "' or Ordrr_Person4 = '" + StrArray[i].Trim() + "' or Ordrr_Person5 = '" + StrArray[i].Trim() + "' or Ordrr_Person6 = '" + StrArray[i].Trim() + "'");
  408. if (dtRows.Length > 0)
  409. {
  410. #region 内容
  411. string StrViewText = "";
  412. Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
  413. g.DrawRectangle(p, rec1A);//画标题矩形
  414. Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
  415. if ((SingleOrDouble % 2) > 0)
  416. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
  417. else
  418. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
  419. SingleOrDouble++;
  420. string StrPersonText = "";
  421. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrArray[i].Trim());
  422. if (dtRow != null)
  423. {
  424. if (!string.IsNullOrEmpty(dtRow["User_Name"].ToString().Trim()))
  425. { StrPersonText = dtRow["User_Name"].ToString().Trim(); }
  426. }
  427. Rectangle rec1A_1 = new Rectangle(rec1A.X + 35, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
  428. g.DrawString(StrPersonText.Trim(), ft11b, b, rec1A_1);
  429. Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
  430. Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
  431. g.DrawLine(p, p11A_1, p11A_2);
  432. SetPostionData(
  433. dtRow["User_Name"].ToString(),
  434. StrArray[i].Trim(), rec1A_1, "", StrTimeStrat, StrTimeEnd);
  435. string OrderCount = dtRows.Length.ToString().Trim();
  436. TotalOrderCount += Convert.ToInt32(OrderCount);
  437. Rectangle rec2A_1 = new Rectangle(p11A_1.X + ColumnWidth2 / 2 - 8, p11A_1.Y + TopAdd, ColumnWidth2, RowHeight);
  438. g.DrawString(OrderCount, ft11, b, rec2A_1);
  439. Point p21A_1 = new Point(p11A_1.X + ColumnWidth2, rec1A.Y);
  440. Point p21A_2 = new Point(p11A_1.X + ColumnWidth2, rec1A.Y + rec1A.Height);
  441. g.DrawLine(p, p21A_1, p21A_2);
  442. StrViewText += OrderCount + "|";
  443. SetPostionData(
  444. dtRow["User_Name"].ToString(),
  445. StrArray[i].Trim(), rec2A_1, "", StrTimeStrat, StrTimeEnd);
  446. int intRetakeCount = 0;
  447. for (int j = 0; j < dtRows.Length; j++)
  448. {
  449. if (dtRows[j]["Ordrr_Type"].ToString().Trim() == "0")
  450. { intRetakeCount++; }
  451. }
  452. TotalSeriesAmount += intRetakeCount;
  453. Rectangle rec3A_1 = new Rectangle(p21A_1.X + ColumnWidth3 / 2 - 8, p21A_1.Y + TopAdd, ColumnWidth3, RowHeight);
  454. g.DrawString(intRetakeCount.ToString().Trim(), ft11, b, rec3A_1);
  455. Point p31A_1 = new Point(p21A_1.X + ColumnWidth3, rec1A.Y);
  456. Point p31A_2 = new Point(p21A_1.X + ColumnWidth3, rec1A.Y + rec1A.Height);
  457. g.DrawLine(p, p31A_1, p31A_2);
  458. StrViewText += intRetakeCount + "|";
  459. SetPostionData(
  460. dtRow["User_Name"].ToString(),
  461. StrArray[i].Trim(), rec3A_1, "", StrTimeStrat, StrTimeEnd);
  462. string strValue = "";
  463. if (dtRows.Length > 0)
  464. { strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero((Convert.ToDecimal(intRetakeCount) / Convert.ToDecimal(dtRows.Length) * 100).ToString("0.00")) + "%"; }
  465. sizef = g.MeasureString(strValue.Trim(), ft11);
  466. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  467. Rectangle rec4A_1 = new Rectangle(p31A_1.X + ColumnWidth4 - FtWidth - ColumnWidth4 / 3, p31A_1.Y + TopAdd, ColumnWidth4, RowHeight);
  468. g.DrawString(strValue, ft11, b, rec4A_1);
  469. ForTopLoad += rec1A.Height;
  470. htDataView[StrPersonText] = StrViewText.TrimEnd('|');
  471. #endregion
  472. }
  473. }
  474. if (SingleOrDouble > 1)
  475. {
  476. this.panelEx6.Visible = true;
  477. this.panelEx5.Dock = DockStyle.Top;
  478. #region 总结
  479. Rectangle rec1B = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
  480. g.DrawRectangle(p, rec1B);//画标题矩形
  481. Rectangle rec1BColor1 = new Rectangle(rec1B.X + 1, rec1B.Y + 1, rec1B.Width - 1, rec1B.Height - 1);
  482. if ((SingleOrDouble % 2) > 0)
  483. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1BColor1); }
  484. else
  485. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1BColor1); }
  486. Rectangle rec1B_1 = new Rectangle(rec1B.X + 35, rec1B.Y + TopAdd, ColumnWidth1, RowHeight);
  487. g.DrawString("总计", ft11b, b, rec1B_1);
  488. Point p11B_1 = new Point(rec1B.X + ColumnWidth1, rec1B.Y);
  489. Point p11B_2 = new Point(rec1B.X + ColumnWidth1, rec1B.Y + rec1B.Height);
  490. g.DrawLine(p, p11B_1, p11B_2);
  491. //拍摄次数
  492. Rectangle rec2B_1 = new Rectangle(p11B_1.X + ColumnWidth2 / 2 - 8, p11B_1.Y + TopAdd, ColumnWidth2, RowHeight);
  493. g.DrawString(TotalOrderCount.ToString().Trim(), ft11, b, rec2B_1);
  494. Point p21B_1 = new Point(p11B_1.X + ColumnWidth2, rec1B.Y);
  495. Point p21B_2 = new Point(p11B_1.X + ColumnWidth2, rec1B.Y + rec1B.Height);
  496. g.DrawLine(p, p21B_1, p21B_2);
  497. //重拍次数
  498. sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11);
  499. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  500. Rectangle rec3B_1 = new Rectangle(p21B_1.X + ColumnWidth3 / 2 - 8, p21B_1.Y + TopAdd, ColumnWidth3, RowHeight);
  501. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11, b, rec3B_1);
  502. Point p31B_1 = new Point(p21B_1.X + ColumnWidth3, rec1B.Y);
  503. Point p31B_2 = new Point(p21B_1.X + ColumnWidth3, rec1B.Y + rec1B.Height);
  504. g.DrawLine(p, p31B_1, p31B_2);
  505. //重拍率
  506. string strValue = "";
  507. if (TotalOrderCount > 0)
  508. { strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero((TotalSeriesAmount / Convert.ToDecimal(TotalOrderCount) * 100).ToString("0.00")) + "%"; }
  509. sizef = g.MeasureString(strValue.Trim(), ft11);
  510. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  511. Rectangle rec4B_1 = new Rectangle(p31B_1.X + ColumnWidth4 - FtWidth - (ColumnWidth4 / 6) * 2, p31B_1.Y + TopAdd, ColumnWidth4, RowHeight);
  512. g.DrawString(strValue.Trim(), ft11, b, rec4B_1);
  513. #endregion
  514. }
  515. else
  516. {
  517. this.panelEx6.Visible = false;
  518. this.panelEx5.Dock = DockStyle.Fill;
  519. }
  520. #endregion
  521. }
  522. else
  523. {
  524. this.panelEx4.Visible = true;
  525. string StrTimeStratDb = this.dtDataTimeStartCompared.DateValue.Trim();
  526. string StrTimeEndDb = this.dtDateTimeEndCompared.DateValue.Trim();
  527. ExecuteSql = "select Ordrr_Person1,Ordrr_Person2,Ordrr_Person3,Ordrr_Person4,Ordrr_Person5,Ordrr_Person6,Ordrr_RetakePerson,Ordrr_DateTime,0 AS Ordrr_Type from tb_ErpOrderRetakeRecord " +
  528. "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordrr_DateTime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") + " And (Ordrr_Person1" + StrOrdersPerson + " or Ordrr_Person2" + StrOrdersPerson + " or Ordrr_Person3" + StrOrdersPerson + " or Ordrr_Person4" + StrOrdersPerson + " or Ordrr_Person5" + StrOrdersPerson + " or Ordrr_Person6" + StrOrdersPerson + ")" +
  529. " UNION ALL " +
  530. "select Ordpg_Photographer,Ordpg_PhotographyAssistant,Ordpg_MakeupArtist,Ordpg_MakeupAssistant,Ordpg_BootDivision,Ordpg_BootDivisionAssistant,'' AS Ordrr_RetakePerson,Ordpg_PhotographyTime,1 AS Ordrr_Type from tb_ErpOrdersPhotography " +
  531. "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordpg_PhotographyTime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") + " And (Ordpg_Photographer" + StrOrdersPerson + " or Ordpg_PhotographyAssistant" + StrOrdersPerson + " or Ordpg_MakeupArtist" + StrOrdersPerson + " or Ordpg_MakeupAssistant" + StrOrdersPerson + " or Ordpg_BootDivision" + StrOrdersPerson + " or Ordpg_BootDivisionAssistant" + StrOrdersPerson + ")";
  532. DataSet dsDataDb = orbll.GetView_Custom(ExecuteSql);
  533. DataTable dt_tableDb = dsDataDb.Tables["ds"];
  534. #region 启动对比
  535. int ColumnWidthSplit2 = ColumnWidth2 / 3;
  536. int ColumnWidthSplit3 = ColumnWidth3 / 3;
  537. int ColumnWidthSplit4 = ColumnWidth4 / 3;
  538. int ForTopLoad = 13;
  539. string StrValue = StrTimeStrat + "—" + StrTimeEnd + " 与 " + StrTimeStratDb + "—" + StrTimeEndDb + " 订单情况对比分析表";
  540. SizeF sizef = g.MeasureString(StrValue, ft15);
  541. int FtHeigth = Convert.ToInt32(sizef.Height);
  542. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  543. Rectangle rec = new Rectangle(TableWidth / 2 - FtWidth / 2, ForTopLoad, FtWidth, FtHeigth);
  544. g.DrawString(StrValue, ft15, b, rec);//画消费法规
  545. ForTopLoad += rec.Height;
  546. #region 标题
  547. Rectangle rec1 = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight * 2);
  548. g.DrawRectangle(p, rec1);//画标题矩形
  549. Rectangle recBackColor1 = new Rectangle(rec1.X + 1, rec1.Y + 1, rec1.Width - 1, rec1.Height - 1);
  550. g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.backColortitle, recBackColor1);//画标题矩形
  551. Point p1_1 = new Point(rec1.X + ColumnWidth1, rec1.Y + RowHeight);
  552. Point p1_2 = new Point(rec1.X + TableWidth, rec1.Y + RowHeight);
  553. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p1_1, p1_2);
  554. Rectangle rec1_1 = new Rectangle(rec1.X, rec1.Y + TopAdd, ColumnWidth1, RowHeight);
  555. g.DrawString("", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1_1);
  556. Point p11_1 = new Point(rec1.X + ColumnWidth1, rec1.Y);
  557. Point p11_2 = new Point(rec1.X + ColumnWidth1, rec1.Y + RowHeight);
  558. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11_1, p11_2);
  559. Rectangle rec2_1 = new Rectangle(p11_1.X + ColumnWidth2 / 2 - 26, p11_1.Y + TopAdd, ColumnWidth2, RowHeight);
  560. g.DrawString("拍摄次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2_1);
  561. Point p21_1 = new Point(p11_1.X + ColumnWidth2, rec1.Y);
  562. Point p21_2 = new Point(p11_1.X + ColumnWidth2, rec1.Y + RowHeight);
  563. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21_1, p21_2);
  564. Rectangle rec3_1 = new Rectangle(p21_1.X + ColumnWidth3 / 2 - 20, p21_1.Y + TopAdd, ColumnWidth3, RowHeight);
  565. g.DrawString("重拍次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3_1);
  566. Point p31_1 = new Point(p21_1.X + ColumnWidth3, rec1.Y);
  567. Point p31_2 = new Point(p21_1.X + ColumnWidth3, rec1.Y + RowHeight);
  568. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31_1, p31_2);
  569. Rectangle rec4_1 = new Rectangle(p31_1.X + ColumnWidth4 / 2 - 20, p31_1.Y + TopAdd, ColumnWidth4, RowHeight);
  570. g.DrawString("重拍率", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4_1);
  571. sizef = g.MeasureString("测试测", ft11b);
  572. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  573. Rectangle rec1AB = new Rectangle(p1_1.X, p1_1.Y, TableWidth - ColumnWidth1 + 1, RowHeight);
  574. g.DrawRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, rec1AB);//画标题矩形
  575. Rectangle rec2AB_1 = new Rectangle(rec1AB.X + (ColumnWidthSplit2 - FtWidth) / 2, rec1AB.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  576. g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2AB_1);
  577. Point p21AB_1 = new Point(rec1AB.X + ColumnWidthSplit2, rec1AB.Y);
  578. Point p21AB_2 = new Point(rec1AB.X + ColumnWidthSplit2, rec1AB.Y + rec1AB.Height);
  579. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21AB_1, p21AB_2);
  580. Rectangle rec3AB_1 = new Rectangle(p21AB_1.X + (ColumnWidthSplit2 - FtWidth) / 2, p21AB_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  581. g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3AB_1);
  582. Point p31AB_1 = new Point(p21AB_1.X + ColumnWidthSplit2, rec1AB.Y);
  583. Point p31AB_2 = new Point(p21AB_1.X + ColumnWidthSplit2, rec1AB.Y + rec1AB.Height);
  584. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31AB_1, p31AB_2);
  585. Rectangle rec4AB_1 = new Rectangle(p31AB_1.X + (ColumnWidthSplit2 - FtWidth) / 2, p31AB_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
  586. g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4AB_1);
  587. Point p41AB_1 = new Point(p31AB_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1AB.Y);
  588. Point p41AB_2 = new Point(p31AB_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1AB.Y + rec1AB.Height);
  589. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41AB_1, p41AB_2);
  590. Rectangle rec1BB_1 = new Rectangle(p41AB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p41AB_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  591. g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1BB_1);
  592. Point p11BB_1 = new Point(p41AB_1.X + ColumnWidthSplit3, rec1AB.Y);
  593. Point p11BB_2 = new Point(p41AB_1.X + ColumnWidthSplit3, rec1AB.Y + rec1AB.Height);
  594. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11BB_1, p11BB_2);
  595. Rectangle rec2BB_1 = new Rectangle(p11BB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p11BB_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  596. g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2BB_1);
  597. Point p21BB_1 = new Point(p11BB_1.X + ColumnWidthSplit3, rec1AB.Y);
  598. Point p21BB_2 = new Point(p11BB_1.X + ColumnWidthSplit3, rec1AB.Y + rec1AB.Height);
  599. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21BB_1, p21BB_2);
  600. Rectangle rec3BB_1 = new Rectangle(p21BB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p21BB_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
  601. g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3BB_1);
  602. Point p31BB_1 = new Point(p21BB_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1AB.Y);
  603. Point p31BB_2 = new Point(p21BB_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1AB.Y + rec1AB.Height);
  604. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31BB_1, p31BB_2);
  605. Rectangle rec4BB_1 = new Rectangle(p31BB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p31BB_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  606. g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4BB_1);
  607. Point p41BB_1 = new Point(p31BB_1.X + ColumnWidthSplit4, rec1AB.Y);
  608. Point p41BB_2 = new Point(p31BB_1.X + ColumnWidthSplit4, rec1AB.Y + rec1AB.Height);
  609. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41BB_1, p41BB_2);
  610. Rectangle rec1CB_1 = new Rectangle(p41BB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p41BB_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  611. g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1CB_1);
  612. Point p11CB_1 = new Point(p41BB_1.X + ColumnWidthSplit4, rec1AB.Y);
  613. Point p11CB_2 = new Point(p41BB_1.X + ColumnWidthSplit4, rec1AB.Y + rec1AB.Height);
  614. g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11CB_1, p11CB_2);
  615. Rectangle rec2CB_1 = new Rectangle(p11CB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p11CB_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
  616. g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2CB_1);
  617. ForTopLoad += rec1.Height;
  618. #endregion
  619. int TotalOrderCount = 0;
  620. int TotalSeriesAmount = 0;
  621. int TotalOrderCountDb = 0;
  622. int TotalSeriesAmountDb = 0;
  623. string[] StrArray = StrOrdersPersoning.Trim().TrimEnd(',').Split(',');
  624. int SingleOrDouble = 0;
  625. for (int i = 0; i < StrArray.Length; i++)
  626. {
  627. string StrViewText = "";
  628. string StrViewTextDb = "";
  629. #region 内容
  630. DataRow[] dtRows = dt_table.Select("Ordrr_Person1 = '" + StrArray[i].Trim() + "' or Ordrr_Person2 = '" + StrArray[i].Trim() + "' or Ordrr_Person3 = '" + StrArray[i].Trim() + "' or Ordrr_Person4 = '" + StrArray[i].Trim() + "' or Ordrr_Person5 = '" + StrArray[i].Trim() + "' or Ordrr_Person6 = '" + StrArray[i].Trim() + "'");
  631. DataRow[] dtRowsDb = dt_tableDb.Select("Ordrr_Person1 = '" + StrArray[i].Trim() + "' or Ordrr_Person2 = '" + StrArray[i].Trim() + "' or Ordrr_Person3 = '" + StrArray[i].Trim() + "' or Ordrr_Person4 = '" + StrArray[i].Trim() + "' or Ordrr_Person5 = '" + StrArray[i].Trim() + "' or Ordrr_Person6 = '" + StrArray[i].Trim() + "'");
  632. if (dtRows.Length > 0 || dtRowsDb.Length > 0)
  633. {
  634. Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
  635. g.DrawRectangle(p, rec1A);//画标题矩形
  636. Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
  637. if ((SingleOrDouble % 2) > 0)
  638. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
  639. else
  640. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
  641. SingleOrDouble++;
  642. string StrPersonText = "";
  643. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrArray[i].Trim());
  644. if (dtRow != null)
  645. {
  646. if (!string.IsNullOrEmpty(dtRow["User_Name"].ToString().Trim()))
  647. { StrPersonText = dtRow["User_Name"].ToString().Trim(); }
  648. }
  649. Rectangle rec1A_1 = new Rectangle(rec1A.X + 10, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
  650. g.DrawString(StrPersonText.Trim(), ft11b, b, rec1A_1);
  651. Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
  652. Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
  653. g.DrawLine(p, p11A_1, p11A_2);
  654. #region 拍摄次数
  655. TotalOrderCount += dtRows.Length;
  656. TotalOrderCountDb += dtRowsDb.Length;
  657. StrViewText += dtRows.Length + "|";
  658. StrViewTextDb += dtRowsDb.Length + "|";
  659. Rectangle rec2A_1 = new Rectangle(p11A_1.X + 3, p11A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  660. g.DrawString(dtRows.Length.ToString().Trim(), ft11, b, rec2A_1);
  661. Point p21A_1 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y);
  662. Point p21A_2 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
  663. g.DrawLine(p, p21A_1, p21A_2);
  664. SetPostionData(
  665. dtRow["User_Name"].ToString(),
  666. StrArray[i].Trim(), rec2A_1, "", StrTimeStrat, StrTimeEnd);
  667. Rectangle rec3A_1 = new Rectangle(p21A_1.X + 3, p21A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  668. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dtRowsDb.Length), ft11, b, rec3A_1);
  669. Point p31A_1 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y);
  670. Point p31A_2 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
  671. g.DrawLine(p, p31A_1, p31A_2);
  672. SetPostionData(
  673. dtRow["User_Name"].ToString(),
  674. StrArray[i].Trim(), rec3A_1, "", StrTimeStratDb, StrTimeEndDb);
  675. string StrPercentage = "";
  676. if (dtRowsDb.Length > 0)
  677. { StrPercentage = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((dtRows.Length - dtRowsDb.Length) / dtRowsDb.Length * 100).ToString("0.00")) + "%"; }
  678. Rectangle rec4A_1 = new Rectangle(p31A_1.X + 3, p31A_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
  679. g.DrawString(StrPercentage.Trim(), ft11, b, rec4A_1);
  680. Point p41A_1 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y);
  681. Point p41A_2 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y + rec1A.Height);
  682. g.DrawLine(p, p41A_1, p41A_2);
  683. #endregion
  684. #region 重拍次数
  685. int RetakeCount = 0;
  686. int RetakeCountDb = 0;
  687. for (int j = 0; j < dtRows.Length; j++)
  688. {
  689. if (dtRows[j]["Ordrr_Type"].ToString().Trim() == "0")
  690. { RetakeCount++; }
  691. }
  692. for (int j = 0; j < dtRowsDb.Length; j++)
  693. {
  694. if (dtRowsDb[j]["Ordrr_Type"].ToString().Trim() == "0")
  695. { RetakeCountDb++; }
  696. }
  697. TotalSeriesAmount += RetakeCount;
  698. TotalSeriesAmountDb += RetakeCountDb;
  699. StrViewText += RetakeCount + "|";
  700. StrViewTextDb += RetakeCountDb + "|";
  701. Rectangle rec1B_1 = new Rectangle(p41A_1.X + 3, p41A_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  702. g.DrawString(RetakeCount.ToString().Trim(), ft11, b, rec1B_1);
  703. Point p11B_1 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y);
  704. Point p11B_2 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
  705. g.DrawLine(p, p11B_1, p11B_2);
  706. SetPostionData(
  707. dtRow["User_Name"].ToString(),
  708. StrArray[i].Trim(), rec1B_1, "", StrTimeStrat, StrTimeEnd);
  709. Rectangle rec2B_1 = new Rectangle(p11B_1.X + 3, p11B_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  710. g.DrawString(RetakeCountDb.ToString().Trim(), ft11, b, rec2B_1);
  711. Point p21B_1 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y);
  712. Point p21B_2 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
  713. g.DrawLine(p, p21B_1, p21B_2);
  714. SetPostionData(
  715. dtRow["User_Name"].ToString(),
  716. StrArray[i].Trim(), rec2B_1, "", StrTimeStratDb, StrTimeEndDb);
  717. string StrPercentage2 = "";
  718. if (RetakeCountDb > 0)
  719. { StrPercentage2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((RetakeCount - RetakeCountDb) / RetakeCountDb * 100).ToString("0.00")) + "%"; }
  720. Rectangle rec3B_1 = new Rectangle(p21B_1.X + 3, p21B_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
  721. g.DrawString(StrPercentage2, ft11, b, rec3B_1);
  722. Point p31B_1 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y);
  723. Point p31B_2 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y + rec1A.Height);
  724. g.DrawLine(p, p31B_1, p31B_2);
  725. #endregion
  726. #region 重拍率
  727. decimal AverageValue = 0;
  728. decimal AverageValueDb = 0;
  729. if (dtRows.Length > 0)
  730. { AverageValue = Convert.ToDecimal(((RetakeCount / dtRows.Length) * 100).ToString("0.00")); }
  731. string StrA = "";
  732. if (AverageValue != 0)
  733. { StrA = AverageValue + "%"; }
  734. if (dtRowsDb.Length > 0)
  735. { AverageValueDb = Convert.ToDecimal(((RetakeCountDb / dtRowsDb.Length) * 100).ToString("0.00")); }
  736. string StrB = "";
  737. if (AverageValueDb != 0)
  738. { StrB = AverageValueDb + "%"; }
  739. StrViewText += AverageValue + "|";
  740. StrViewTextDb += AverageValueDb + "|";
  741. Rectangle rec4B_1 = new Rectangle(p31B_1.X + 3, p31B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  742. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StrA), ft11, b, rec4B_1);
  743. Point p41B_1 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y);
  744. Point p41B_2 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  745. g.DrawLine(p, p41B_1, p41B_2);
  746. Rectangle rec1C_1 = new Rectangle(p41B_1.X + 3, p41B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  747. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StrB), ft11, b, rec1C_1);
  748. Point p11C_1 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y);
  749. Point p11C_2 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  750. g.DrawLine(p, p11C_1, p11C_2);
  751. string StrPercentage3 = "";
  752. if (AverageValueDb > 0)
  753. { StrPercentage3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((AverageValue - AverageValueDb) / AverageValueDb * 100).ToString("0.00")) + "%"; }
  754. Rectangle rec2C_1 = new Rectangle(p11C_1.X + 3, p11C_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
  755. g.DrawString(StrPercentage3, ft11, b, rec2C_1);
  756. #endregion
  757. ForTopLoad += rec1A.Height;
  758. htDataView[StrPersonText.Trim()] = StrViewText.TrimEnd('|');
  759. htDataViewDb[StrPersonText.Trim()] = StrViewTextDb.TrimEnd('|');
  760. }
  761. #endregion
  762. }
  763. if (SingleOrDouble > 1)
  764. {
  765. this.panelEx6.Visible = true;
  766. this.panelEx5.Dock = DockStyle.Top;
  767. #region 总结
  768. Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
  769. g.DrawRectangle(p, rec1A);//画标题矩形
  770. Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
  771. if (((SingleOrDouble) % 2) > 0)
  772. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
  773. else
  774. { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
  775. Rectangle rec1A_1 = new Rectangle(rec1A.X + 10, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
  776. g.DrawString("总计", ft11b, b, rec1A_1);
  777. Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
  778. Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
  779. g.DrawLine(p, p11A_1, p11A_2);
  780. #region 拍摄次数
  781. Rectangle rec2A_1 = new Rectangle(p11A_1.X + 3, p11A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  782. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalOrderCount), ft11, b, rec2A_1);
  783. Point p21A_1 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y);
  784. Point p21A_2 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
  785. g.DrawLine(p, p21A_1, p21A_2);
  786. Rectangle rec3A_1 = new Rectangle(p21A_1.X + 3, p21A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
  787. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalOrderCountDb), ft11, b, rec3A_1);
  788. Point p31A_1 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y);
  789. Point p31A_2 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
  790. g.DrawLine(p, p31A_1, p31A_2);
  791. string StrPercentage = "";
  792. if (TotalOrderCountDb > 0)
  793. { StrPercentage = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((Convert.ToDecimal(TotalOrderCount) - Convert.ToDecimal(TotalOrderCountDb)) / Convert.ToDecimal(TotalOrderCountDb) * 100).ToString("0.00")) + "%"; }
  794. Rectangle rec4A_1 = new Rectangle(p31A_1.X + 3, p31A_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
  795. g.DrawString(StrPercentage.Trim(), ft11, b, rec4A_1);
  796. Point p41A_1 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y);
  797. Point p41A_2 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y + rec1A.Height);
  798. g.DrawLine(p, p41A_1, p41A_2);
  799. #endregion
  800. #region 重拍次数
  801. Rectangle rec1B_1 = new Rectangle(p41A_1.X + 3, p41A_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  802. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11, b, rec1B_1);
  803. Point p11B_1 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y);
  804. Point p11B_2 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
  805. g.DrawLine(p, p11B_1, p11B_2);
  806. Rectangle rec2B_1 = new Rectangle(p11B_1.X + 3, p11B_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
  807. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmountDb), ft11, b, rec2B_1);
  808. Point p21B_1 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y);
  809. Point p21B_2 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
  810. g.DrawLine(p, p21B_1, p21B_2);
  811. string StrPercentage2 = "";
  812. if (TotalSeriesAmountDb > 0)
  813. { StrPercentage2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((Convert.ToDecimal(TotalSeriesAmount) - Convert.ToDecimal(TotalSeriesAmountDb)) / Convert.ToDecimal(TotalSeriesAmountDb) * 100).ToString("0.00")) + "%"; }
  814. Rectangle rec3B_1 = new Rectangle(p21B_1.X + 3, p21B_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
  815. g.DrawString(StrPercentage2, ft11, b, rec3B_1);
  816. Point p31B_1 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y);
  817. Point p31B_2 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y + rec1A.Height);
  818. g.DrawLine(p, p31B_1, p31B_2);
  819. #endregion
  820. #region 重拍率
  821. decimal strValueA = 0;
  822. if (Convert.ToInt32(TotalOrderCount) > 0)
  823. { strValueA = Convert.ToDecimal((Convert.ToDecimal(TotalSeriesAmount) / Convert.ToDecimal(TotalOrderCount) * 100).ToString("0.00")); }
  824. string StrA = "";
  825. if (strValueA != 0)
  826. { StrA = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(strValueA) + "%"; }
  827. Rectangle rec4B_1 = new Rectangle(p31B_1.X + 3, p31B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  828. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StrA), ft11, b, rec4B_1);
  829. Point p41B_1 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y);
  830. Point p41B_2 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  831. g.DrawLine(p, p41B_1, p41B_2);
  832. decimal strValueB = 0;
  833. if (Convert.ToInt32(TotalOrderCountDb) > 0)
  834. { strValueB = Convert.ToDecimal((Convert.ToDecimal(TotalSeriesAmountDb) / Convert.ToInt32(TotalOrderCountDb) * 100).ToString("0.00")); }
  835. string StrB = "";
  836. if (strValueB != 0)
  837. { StrB = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(strValueB) + "%"; }
  838. Rectangle rec1C_1 = new Rectangle(p41B_1.X + 3, p41B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
  839. g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StrB), ft11, b, rec1C_1);
  840. Point p11C_1 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y);
  841. Point p11C_2 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
  842. g.DrawLine(p, p11C_1, p11C_2);
  843. string StrPercentage3 = "";
  844. if (strValueB > 0)
  845. { StrPercentage3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((strValueA - strValueB) / strValueB * 100).ToString("0.00")) + "%"; }
  846. Rectangle rec2C_1 = new Rectangle(p11C_1.X + 3, p11C_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
  847. g.DrawString(StrPercentage3, ft11, b, rec2C_1);
  848. #endregion
  849. #endregion
  850. }
  851. else
  852. {
  853. this.panelEx6.Visible = false;
  854. this.panelEx5.Dock = DockStyle.Fill;
  855. }
  856. #endregion
  857. }
  858. this.PictImage.Image = newBmp;
  859. this.PublicFunctionView();
  860. }
  861. /// <summary>
  862. /// 创建图表
  863. /// </summary>
  864. private void PublicFunctionView()
  865. {
  866. this.chart1.Titles.Clear();
  867. this.chart1.Series.Clear();
  868. this.chart2.Series.Clear();
  869. this.chart2.Titles.Clear();
  870. Series tempseries = null;
  871. if (this.htDataView.Count > 1)
  872. {
  873. #region 无启用对比
  874. if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Column")
  875. {
  876. #region 柱状图
  877. this.chart1.Legends["Legend1"].Enabled = true;
  878. int forCount = 0;
  879. foreach (DictionaryEntry item in htDataView)
  880. {
  881. string[] StrArray = item.Value.ToString().Trim().Split('|');
  882. string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
  883. if (Convert.ToDecimal(StrValue) != 0)
  884. {
  885. tempseries = new Series(item.Key.ToString().Trim());
  886. tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
  887. this.chart1.Series.Add(tempseries);
  888. this.chart1.Series[forCount].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
  889. this.chart1.Series[forCount].Points.Clear();
  890. this.chart1.Series[forCount].ToolTip = item.Key.ToString().Trim();
  891. this.chart1.ChartAreas["ChartArea1"].AxisX.Interval = htDataView.Count;//x轴数据显示间隔
  892. tempseries.Points.AddXY("0", StrValue);
  893. if (Convert.ToDecimal(StrValue) > 0)
  894. { tempseries.Points[0].IsValueShownAsLabel = true; }
  895. forCount++;
  896. }
  897. }
  898. #endregion
  899. }
  900. else if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Pie")
  901. {
  902. #region 饼形图
  903. if (this.chkComparedStartUp.Checked)
  904. {
  905. string StrTitlesDb = this.dtDataTimeStart.DateValue.Trim() + " — " + this.dtDataTimeEnd.DateValue.Trim() + " 图表";
  906. this.chart1.Titles.Add(StrTitlesDb);
  907. }
  908. this.chart1.Legends["Legend1"].Enabled = false;
  909. tempseries = new Series();
  910. tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
  911. this.chart1.Series.Add(tempseries);
  912. this.chart1.Series[0]["PieLabelStyle"] = "Outside";//将文字移到外侧
  913. this.chart1.Series[0]["PieLineColor"] = "Black";//绘制黑色的连线。
  914. List<string> xData = new List<string>();
  915. List<double> yData = new List<double>();
  916. int forCount = 0;
  917. foreach (DictionaryEntry item in htDataView)
  918. {
  919. string[] StrArray = item.Value.ToString().Trim().Split('|');
  920. string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
  921. if (Convert.ToDecimal(StrValue) != 0)
  922. {
  923. this.chart1.Series[0].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
  924. this.chart1.Series[0].Points.Clear();
  925. this.chart1.Series[0].ToolTip = item.Key.ToString().Trim();
  926. xData.Add(item.Key.ToString().Trim() + ":" + StrValue);
  927. yData.Add(Convert.ToDouble(StrValue));
  928. forCount++;
  929. }
  930. }
  931. this.chart1.Series[0].Points.DataBindXY(xData, yData);
  932. #endregion
  933. }
  934. #endregion
  935. }
  936. if (this.chkComparedStartUp.Checked)
  937. {
  938. if (this.htDataViewDb.Count > 1)
  939. {
  940. #region 启用对比
  941. if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Column")
  942. {
  943. #region 柱状图
  944. this.chart2.Legends["Legend1"].Enabled = true;
  945. int forCount = 0;
  946. foreach (DictionaryEntry item in htDataViewDb)
  947. {
  948. string[] StrArray = item.Value.ToString().Trim().Split('|');
  949. string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
  950. if (Convert.ToDecimal(StrValue) != 0)
  951. {
  952. tempseries = new Series(item.Key.ToString().Trim());
  953. tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
  954. this.chart2.Series.Add(tempseries);
  955. this.chart2.Series[forCount].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
  956. this.chart2.Series[forCount].Points.Clear();
  957. this.chart2.Series[forCount].ToolTip = item.Key.ToString().Trim();
  958. this.chart2.ChartAreas["ChartArea1"].AxisX.Interval = htDataViewDb.Count;//x轴数据显示间隔
  959. tempseries.Points.AddXY("0", StrValue);
  960. if (Convert.ToDecimal(StrValue) > 0)
  961. { tempseries.Points[0].IsValueShownAsLabel = true; }
  962. forCount++;
  963. }
  964. }
  965. #endregion
  966. }
  967. else if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Pie")
  968. {
  969. #region 饼形图
  970. string StrTitlesDb = this.dtDataTimeStartCompared.DateValue.Trim() + " — " + this.dtDateTimeEndCompared.DateValue.Trim() + " 图表";
  971. this.chart2.Titles.Add(StrTitlesDb);
  972. this.chart2.Legends["Legend1"].Enabled = false;
  973. tempseries = new Series();
  974. tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
  975. this.chart2.Series.Add(tempseries);
  976. this.chart2.Series[0]["PieLabelStyle"] = "Outside";//将文字移到外侧
  977. this.chart2.Series[0]["PieLineColor"] = "Black";//绘制黑色的连线。
  978. List<string> xData = new List<string>();
  979. List<double> yData = new List<double>();
  980. int forCount = 0;
  981. foreach (DictionaryEntry item in htDataViewDb)
  982. {
  983. string[] StrArray = item.Value.ToString().Trim().Split('|');
  984. string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
  985. if (Convert.ToDecimal(StrValue) != 0)
  986. {
  987. this.chart2.Series[0].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
  988. this.chart2.Series[0].Points.Clear();
  989. this.chart2.Series[0].ToolTip = item.Key.ToString().Trim();
  990. xData.Add(item.Key.ToString().Trim() + ":" + StrValue);
  991. yData.Add(Convert.ToDouble(StrValue));
  992. forCount++;
  993. }
  994. }
  995. this.chart2.Series[0].Points.DataBindXY(xData, yData);
  996. #endregion
  997. }
  998. #endregion
  999. }
  1000. }
  1001. }
  1002. }
  1003. }