12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097 |
- using LYFZ.Model;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Windows.Forms.DataVisualization.Charting;
- namespace LYFZ.Software.MainBusiness.DecisionAssistant
- {
- public partial class AnalyzedOrderRetakeFormMain : LYFZ.Software.UI.DecisionAssistant.AnalyzedOrderRetakeFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- List<ModelImagePostionAction> actionList = new List<ModelImagePostionAction>();
- public AnalyzedOrderRetakeFormMain()
- {
- this.Load += AnalyzedOrderRetakeFormMain_Load;
- this.Shown += AnalyzedOrderRetakeFormMain_Shown;
- this.btnQuery.Click += btnQuery_Click;
- this.btnQueryCompared.Click += btnQueryCompared_Click;
- this.btnSaveAs.Click += btnSaveAs_Click;
- this.btnCloseed.Click += btnCloseed_Click;
- this.chkComparedStartUp.Click += chkComparedStartUp_Click;
- this.dtDataTimeStart.Leave += dtDataTimeStart_Leave;
- this.dtDataTimeStartCompared.Leave += dtDataTimeStartCompared_Leave;
- this.cmbtreevDisplayItem.ComboBoxTree_NodeMouseClick += cmbtreevDisplayItem_ComboBoxTree_NodeMouseClick;
- this.cmbtreevDisplayMethod.ComboBoxTree_NodeMouseClick += cmbtreevDisplayMethod_ComboBoxTree_NodeMouseClick;
- this.Resize += AnalyzedOrderRetakeFormMain_Resize;
- this.PictImage.MouseDoubleClick += PictImage_MouseDoubleClick;
- }
- void PictImage_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- ModelImagePostionAction action = actionList.Find(p => p.MouseX <= e.Location.X && e.Location.X <= (p.MouseX + p.MouseWidth)
- &&
- p.MouseY <= e.Location.Y && e.Location.Y <= (p.MouseY + p.MouseHeight));
- if (action != null)
- {
- LYFZ.Software.MainBusiness.DecisionAssistant.SetSmallForm.AnalyzedOrderDetailSmallForm detailForm = new SetSmallForm.AnalyzedOrderDetailSmallForm();
- detailForm.BindDataGridView3(action);
- detailForm.ShowDialog();
- //MessageBox.Show("内容!");
- }
- }
- void SetPostionData(string ordType, string columType, Rectangle rectangle, string where, string startTime, string endTime)
- {
- ModelImagePostionAction actionModel = null;
- string SqlSelect = @"";
- string sqlWhere = "";
- 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 " +
- "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordrr_DateTime", startTime, endTime, ConnectWord: "") + " " +
- " UNION ALL " +
- "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 " +
- "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordpg_PhotographyTime", startTime, endTime, ConnectWord: "") + " )";
- SqlSelect += " select 摄影师,摄影助理,化妆师,化妆助理,引导师,引导助理,重拍责任人,时间 from tt ";
- sqlWhere += " 摄影师 in ('" + columType + "') or 摄影助理 in ('" + columType + "') or 化妆师 in ('" + columType + "') or 化妆助理 in ('" + columType + "') or 引导师 in ('" + columType + "') or 引导助理 in ('" + columType + "') ";
-
- actionModel = new ModelImagePostionAction()
- {
- OrdType = ordType,
- ColumType = columType,
- MouseX = rectangle.X,
- MouseY = rectangle.Y,
- MouseWidth = rectangle.Width,
- MouseHeight = rectangle.Height,
- SqlData = SqlSelect + " where " + sqlWhere
- };
- actionModel.OrdTitle = this.UcNavigationTool.LabTitle;
- if (actionModel != null)
- {
- actionList.Add(actionModel);
- }
- }
- bool IsFristLoad = true;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderRetakeFormMain_Load(object sender, EventArgs e)
- {
- this.panelQueryCompared.Visible = false;
- this.dtDataTimeStart.DateValue = SDateTime.Now.ToString("yyyy-MM") + "-01";
- this.dtDataTimeEnd.DateValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevDisplayItem, "0:拍摄次数,1:重拍次数,2:重拍率", IsSplit: true);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevDisplayMethod, "Pie:饼形图,Column:柱状图", IsSplit: true);
- this.cmbtreevDisplayItem.TagFindText("0");
- this.cmbtreevDisplayMethod.TagFindText("Pie");
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbtreevOrdersPerson, IsShowResign: false);
- if (this.cmbtreevOrdersPerson.Nodes[0].Nodes.Count > 0)
- { this.cmbtreevOrdersPerson.Nodes[0].Nodes[0].Expand(); }
- else
- { this.cmbtreevOrdersPerson.Nodes[0].Expand(); }
- if (cmbtreevOrdersPerson.GetNodeItem_TextToTag("门市部") == null)
- {
- this.cmbtreevOrdersPerson.TextFindTag(this.cmbtreevOrdersPerson.Nodes[0].Text.Trim());
- this.cmbtreevOrdersPerson.SelectedNode = this.cmbtreevOrdersPerson.GetNodeItem_TextToTag(this.cmbtreevOrdersPerson.Nodes[0].Text.Trim());
- }
- else
- {
- this.cmbtreevOrdersPerson.TextFindTag("门市部");
- this.cmbtreevOrdersPerson.SelectedNode = this.cmbtreevOrdersPerson.GetNodeItem_TextToTag("门市部");
- }
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderRetakeFormMain_Shown(object sender, EventArgs e)
- {
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.决策助手重拍分析);
- if (!b)
- {
- this.Close();
- return;
- }
- this.chart1.Focus();
- this.chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
- this.chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
- this.chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
- this.chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;//将滚动内嵌到坐标轴中
- this.chart1.ChartAreas["ChartArea1"].AxisX.ScrollBar.Size = 20;// 设置滚动条的大小
- this.chart1.ChartAreas["ChartArea1"].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;// 设置滚动条的按钮的风格,下面代码是将所有滚动条上的按钮都显示出来
- this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollSize = double.NaN;// 设置自动放大与缩小的最小量
- this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollMinSize = 2;
- this.chart2.Focus();
- this.chart2.ChartAreas[0].CursorX.IsUserEnabled = true;
- this.chart2.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
- this.chart2.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
- this.chart2.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;//将滚动内嵌到坐标轴中
- this.chart2.ChartAreas["ChartArea1"].AxisX.ScrollBar.Size = 20;// 设置滚动条的大小
- this.chart2.ChartAreas["ChartArea1"].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;// 设置滚动条的按钮的风格,下面代码是将所有滚动条上的按钮都显示出来
- this.chart2.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollSize = double.NaN;// 设置自动放大与缩小的最小量
- this.chart2.ChartAreas["ChartArea1"].AxisX.ScaleView.SmallScrollMinSize = 2;
- this.PublicFunctionRows();
- this.IsFristLoad = false;
-
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 对比查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQueryCompared_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 另存为
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSaveAs_Click(object sender, EventArgs e)
- {
- string StrFilleName = Convert.ToDateTime(this.dtDataTimeStart.DateValue).ToString("yyyy年MM月dd日") + " — " + Convert.ToDateTime(this.dtDataTimeEnd.DateValue).ToString("yyyy年MM月dd日") + " 重拍统计分析表";
- if (this.chkComparedStartUp.Checked)
- { StrFilleName = this.dtDataTimeStart.DateValue.Trim() + "—" + this.dtDataTimeEnd.DateValue.Trim() + " 与 " + this.dtDataTimeStartCompared.DateValue.Trim() + "—" + this.dtDateTimeEndCompared.DateValue.Trim() + " 重拍统计分析表"; }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DownloadSaveAs(this.PictImage.Image, StrFilleName: StrFilleName);
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnCloseed_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 启动对比
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkComparedStartUp_Click(object sender, EventArgs e)
- {
- if (this.chkComparedStartUp.Checked)
- {
- this.panelCloseed.Visible = false;
- this.panelSaveAs.Visible = false;
- this.panelQueryCompared.Visible = true;
- this.panelSaveAs.Visible = true;
- this.panelCloseed.Visible = true;
- if (!string.IsNullOrEmpty(this.dtDataTimeStartCompared.DateValue.Trim()) && !string.IsNullOrEmpty(this.dtDateTimeEndCompared.DateValue.Trim()))
- { this.PublicFunctionRows(); }
- }
- else
- {
- this.panelQueryCompared.Visible = false;
- this.PublicFunctionRows();
- }
- }
- /// <summary>
- /// 开始日期离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dtDataTimeStart_Leave(object sender, EventArgs e)
- {
- this.dtDataTimeEnd.DateValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
- }
- /// <summary>
- /// 开始日期离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dtDataTimeStartCompared_Leave(object sender, EventArgs e)
- {
- this.dtDateTimeEndCompared.DateValue = Convert.ToDateTime(this.dtDataTimeStartCompared.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
- }
- /// <summary>
- /// 显示项目
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevDisplayItem_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- this.PublicFunctionView();
- }
- /// <summary>
- /// 显示方式
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevDisplayMethod_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- this.PublicFunctionView();
- }
- /// <summary>
- /// 窗体大小发生变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderRetakeFormMain_Resize(object sender, EventArgs e)
- {
- switch (this.panelCloseed.Location.Y)
- {
- case 1: this.flowLayoutPanel1.Height = 35; break;
- case 35: this.flowLayoutPanel1.Height = 70; break;
- }
- if (this.IsFristLoad)
- {
- this.panelEx4.Width = this.panelEx6.Width / 2;
- }
- }
- Hashtable htDataView = new Hashtable();
- Hashtable htDataViewDb = new Hashtable();
- /// <summary>
- /// 创建行
- /// </summary>
- private void PublicFunctionRows()
- {
- actionList.Clear();
- #region 处理数据前判断
- if (this.chkComparedStartUp.Checked)
- {
- if (string.IsNullOrEmpty(this.dtDataTimeStart.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDataTimeEnd.DateValue.Trim()))
- { MessageBoxCustom.Show("对比前日期段不能为空"); return; }
- if (Convert.ToDateTime(this.dtDataTimeEnd.DateValue) < Convert.ToDateTime(this.dtDataTimeStart.DateValue))
- { MessageBoxCustom.Show("对比前开始日期不能大于结束日期"); return; }
- if (string.IsNullOrEmpty(this.dtDataTimeStartCompared.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDateTimeEndCompared.DateValue.Trim()))
- { MessageBoxCustom.Show("对比后日期段不能为空"); return; }
- if (Convert.ToDateTime(this.dtDateTimeEndCompared.DateValue) < Convert.ToDateTime(this.dtDataTimeStartCompared.DateValue))
- { MessageBoxCustom.Show("对比后开始日期不能大于结束日期"); return; }
- if (Convert.ToDateTime(this.dtDateTimeEndCompared.DateValue.Trim()) > Convert.ToDateTime(this.dtDataTimeStart.DateValue.Trim()))
- { MessageBoxCustom.Show("对比后的结束日期不能大于对比前的开始日期"); return; }
- }
- else
- {
- if (string.IsNullOrEmpty(this.dtDataTimeStart.DateValue.Trim()) && string.IsNullOrEmpty(this.dtDataTimeEnd.DateValue.Trim()))
- { MessageBoxCustom.Show("日期段不能为空"); return; }
- if (Convert.ToDateTime(this.dtDataTimeEnd.DateValue) < Convert.ToDateTime(this.dtDataTimeStart.DateValue))
- { MessageBoxCustom.Show("开始日期不能大于结束日期"); return; }
- }
- this.IsFristLoad = true;
- this.AnalyzedOrderRetakeFormMain_Resize(this, null);
- this.IsFristLoad = false;
- this.htDataView.Clear();
- this.htDataViewDb.Clear();
- this.actionList.Clear();
- #endregion
- Bitmap newBmp = new Bitmap(this.PictImage.Width, 900);
- Graphics g = Graphics.FromImage(newBmp);
- g.Clear(System.Drawing.Color.White);
- Brush b = Brushes.Black;
- Pen p = LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.PenborderColor;
- Font ft12b = new Font("微软雅黑", 12);
- Font ft11b = new Font("微软雅黑", 11);
- Font ft11 = new Font("微软雅黑", 11, FontStyle.Italic);
- if (this.chkComparedStartUp.Checked)
- {
- ft12b = new Font("微软雅黑", 11);
- ft11b = new Font("微软雅黑", 10);
- ft11 = new Font("微软雅黑", 10, FontStyle.Italic);
- }
- Font ft15 = new Font("微软雅黑", 15);
- int TopAdd = 7;
- int LeftWidth = 30;
- int TableWidth = newBmp.Width - LeftWidth * 2;
- int ColumnWidth1 = TableWidth / 4;
- if (this.chkComparedStartUp.Checked)
- { ColumnWidth1 = 200; }
- int ColumnWidth2 = (TableWidth - ColumnWidth1) / 3;
- int ColumnWidth3 = (TableWidth - ColumnWidth1) / 3;
- int ColumnWidth4 = (TableWidth - ColumnWidth1) / 3;
- int TableHeoght = 300 - 60;
- int RowHeight = TableHeoght / 7;
- string StrTypeTextNull = " ";
- if (this.chkComparedStartUp.Checked)
- { StrTypeTextNull = " "; }
- string StrTimeStrat = this.dtDataTimeStart.DateValue.Trim();
- string StrTimeEnd = this.dtDataTimeEnd.DateValue.Trim();
- string StrOrdersPerson = "";
- string StrOrdersPersoning = "";
- if (this.cmbtreevOrdersPerson.Tag != null)
- {
- if (this.cmbtreevOrdersPerson.StrGetName.Trim() == "User")
- {
- StrOrdersPerson = " in ('" + this.cmbtreevOrdersPerson.Tag.ToString().Trim() + "')";
- StrOrdersPersoning += this.cmbtreevOrdersPerson.Tag.ToString().Trim() + ",";
- }
- else if (this.cmbtreevOrdersPerson.StrGetName.Trim() == "Department")
- {
- for (int i = 0; i < this.cmbtreevOrdersPerson.SelectedNode.Nodes.Count; i++)
- {
- StrOrdersPerson += "'" + this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Tag.ToString().Trim() + "',";
- StrOrdersPersoning += this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Tag.ToString().Trim() + ",";
- }
- if (!string.IsNullOrEmpty(StrOrdersPerson))
- { StrOrdersPerson = " in (" + StrOrdersPerson.TrimEnd(',') + ")"; }
- }
- else if (this.cmbtreevOrdersPerson.StrGetName.Trim() == "StoreName")
- {
- for (int i = 0; i < this.cmbtreevOrdersPerson.SelectedNode.Nodes.Count; i++)
- {
- if (this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Name.Trim() == "Department" && this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Nodes.Count > 0)
- {
- for (int j = 0; j < this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Nodes.Count; j++)
- {
- StrOrdersPerson += "'" + this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Nodes[j].Tag.ToString().Trim() + "',";
- StrOrdersPersoning += this.cmbtreevOrdersPerson.SelectedNode.Nodes[i].Nodes[j].Tag.ToString().Trim() + ",";
- }
- }
- }
- if (!string.IsNullOrEmpty(StrOrdersPerson))
- { StrOrdersPerson = " in (" + StrOrdersPerson.TrimEnd(',') + ")"; }
- }
- }
- 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 " +
- "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 + ")" +
- " UNION ALL " +
- "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 " +
- "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 + ")";
- DataSet dsData = orbll.GetView_Custom(ExecuteSql);
- DataTable dt_table = dsData.Tables["ds"];
- if (!this.chkComparedStartUp.Checked)
- {
- this.panelEx4.Visible = false;
- #region 无启动对比
- int ForTopLoad = 15;
- string StrValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).ToString("yyyy年MM月dd日") + " — " + Convert.ToDateTime(this.dtDataTimeEnd.DateValue).ToString("yyyy年MM月dd日") + " 重拍分析表";
- SizeF sizef = g.MeasureString(StrValue, ft15);
- int FtHeigth = Convert.ToInt32(sizef.Height);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec = new Rectangle(TableWidth / 2 - FtWidth / 2, ForTopLoad, FtWidth, FtHeigth);
- g.DrawString(StrValue, ft15, b, rec);//画消费法规
- ForTopLoad = rec.Y + rec.Height;
- #region 标题
- Rectangle rec1 = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
- g.DrawRectangle(p, rec1);//画标题矩形
- Rectangle recBackColor1 = new Rectangle(rec1.X + 1, rec1.Y + 1, rec1.Width - 1, rec1.Height - 1);
- g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.backColortitle, recBackColor1);//画标题矩形
- Rectangle rec1_1 = new Rectangle(rec1.X, rec1.Y + TopAdd, ColumnWidth1, RowHeight);
- g.DrawString("", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1_1);
- Point p11_1 = new Point(rec1.X + ColumnWidth1, rec1.Y);
- Point p11_2 = new Point(rec1.X + ColumnWidth1, rec1.Y + rec1.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11_1, p11_2);
- Rectangle rec2_1 = new Rectangle(p11_1.X + ColumnWidth2 / 2 - 26, p11_1.Y + TopAdd, ColumnWidth2, RowHeight);
- g.DrawString("拍摄次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2_1);
- Point p21_1 = new Point(p11_1.X + ColumnWidth2, rec1.Y);
- Point p21_2 = new Point(p11_1.X + ColumnWidth2, rec1.Y + rec1.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21_1, p21_2);
- Rectangle rec3_1 = new Rectangle(p21_1.X + ColumnWidth3 / 2 - 20, p21_1.Y + TopAdd, ColumnWidth3, RowHeight);
- g.DrawString("重拍次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3_1);
- Point p31_1 = new Point(p21_1.X + ColumnWidth3, rec1.Y);
- Point p31_2 = new Point(p21_1.X + ColumnWidth3, rec1.Y + rec1.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31_1, p31_2);
- Rectangle rec4_1 = new Rectangle(p31_1.X + ColumnWidth4 / 2 - 20, p31_1.Y + TopAdd, ColumnWidth4, RowHeight);
- g.DrawString("重拍率", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4_1);
- ForTopLoad += rec1.Height;
- #endregion
- int TotalOrderCount = 0;
- decimal TotalSeriesAmount = 0;
- string[] StrArray = StrOrdersPersoning.Trim().TrimEnd(',').Split(',');
- int SingleOrDouble = 0;
- for (int i = 0; i < StrArray.Length; i++)
- {
- 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() + "'");
- if (dtRows.Length > 0)
- {
- #region 内容
- string StrViewText = "";
- Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
- g.DrawRectangle(p, rec1A);//画标题矩形
- Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
- if ((SingleOrDouble % 2) > 0)
- { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
- else
- { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
- SingleOrDouble++;
- string StrPersonText = "";
- DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrArray[i].Trim());
- if (dtRow != null)
- {
- if (!string.IsNullOrEmpty(dtRow["User_Name"].ToString().Trim()))
- { StrPersonText = dtRow["User_Name"].ToString().Trim(); }
- }
- Rectangle rec1A_1 = new Rectangle(rec1A.X + 35, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
- g.DrawString(StrPersonText.Trim(), ft11b, b, rec1A_1);
- Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
- Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11A_1, p11A_2);
- SetPostionData(
- dtRow["User_Name"].ToString(),
- StrArray[i].Trim(), rec1A_1, "", StrTimeStrat, StrTimeEnd);
- string OrderCount = dtRows.Length.ToString().Trim();
- TotalOrderCount += Convert.ToInt32(OrderCount);
- Rectangle rec2A_1 = new Rectangle(p11A_1.X + ColumnWidth2 / 2 - 8, p11A_1.Y + TopAdd, ColumnWidth2, RowHeight);
- g.DrawString(OrderCount, ft11, b, rec2A_1);
- Point p21A_1 = new Point(p11A_1.X + ColumnWidth2, rec1A.Y);
- Point p21A_2 = new Point(p11A_1.X + ColumnWidth2, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21A_1, p21A_2);
- StrViewText += OrderCount + "|";
- SetPostionData(
- dtRow["User_Name"].ToString(),
- StrArray[i].Trim(), rec2A_1, "", StrTimeStrat, StrTimeEnd);
- int intRetakeCount = 0;
- for (int j = 0; j < dtRows.Length; j++)
- {
- if (dtRows[j]["Ordrr_Type"].ToString().Trim() == "0")
- { intRetakeCount++; }
- }
- TotalSeriesAmount += intRetakeCount;
- Rectangle rec3A_1 = new Rectangle(p21A_1.X + ColumnWidth3 / 2 - 8, p21A_1.Y + TopAdd, ColumnWidth3, RowHeight);
- g.DrawString(intRetakeCount.ToString().Trim(), ft11, b, rec3A_1);
- Point p31A_1 = new Point(p21A_1.X + ColumnWidth3, rec1A.Y);
- Point p31A_2 = new Point(p21A_1.X + ColumnWidth3, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31A_1, p31A_2);
- StrViewText += intRetakeCount + "|";
- SetPostionData(
- dtRow["User_Name"].ToString(),
- StrArray[i].Trim(), rec3A_1, "", StrTimeStrat, StrTimeEnd);
- string strValue = "";
- if (dtRows.Length > 0)
- { strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero((Convert.ToDecimal(intRetakeCount) / Convert.ToDecimal(dtRows.Length) * 100).ToString("0.00")) + "%"; }
- sizef = g.MeasureString(strValue.Trim(), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec4A_1 = new Rectangle(p31A_1.X + ColumnWidth4 - FtWidth - ColumnWidth4 / 3, p31A_1.Y + TopAdd, ColumnWidth4, RowHeight);
- g.DrawString(strValue, ft11, b, rec4A_1);
- ForTopLoad += rec1A.Height;
- htDataView[StrPersonText] = StrViewText.TrimEnd('|');
- #endregion
- }
- }
- if (SingleOrDouble > 1)
- {
- this.panelEx6.Visible = true;
- this.panelEx5.Dock = DockStyle.Top;
- #region 总结
- Rectangle rec1B = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
- g.DrawRectangle(p, rec1B);//画标题矩形
- Rectangle rec1BColor1 = new Rectangle(rec1B.X + 1, rec1B.Y + 1, rec1B.Width - 1, rec1B.Height - 1);
- if ((SingleOrDouble % 2) > 0)
- { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1BColor1); }
- else
- { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1BColor1); }
- Rectangle rec1B_1 = new Rectangle(rec1B.X + 35, rec1B.Y + TopAdd, ColumnWidth1, RowHeight);
- g.DrawString("总计", ft11b, b, rec1B_1);
- Point p11B_1 = new Point(rec1B.X + ColumnWidth1, rec1B.Y);
- Point p11B_2 = new Point(rec1B.X + ColumnWidth1, rec1B.Y + rec1B.Height);
- g.DrawLine(p, p11B_1, p11B_2);
- //拍摄次数
- Rectangle rec2B_1 = new Rectangle(p11B_1.X + ColumnWidth2 / 2 - 8, p11B_1.Y + TopAdd, ColumnWidth2, RowHeight);
- g.DrawString(TotalOrderCount.ToString().Trim(), ft11, b, rec2B_1);
- Point p21B_1 = new Point(p11B_1.X + ColumnWidth2, rec1B.Y);
- Point p21B_2 = new Point(p11B_1.X + ColumnWidth2, rec1B.Y + rec1B.Height);
- g.DrawLine(p, p21B_1, p21B_2);
- //重拍次数
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec3B_1 = new Rectangle(p21B_1.X + ColumnWidth3 / 2 - 8, p21B_1.Y + TopAdd, ColumnWidth3, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11, b, rec3B_1);
- Point p31B_1 = new Point(p21B_1.X + ColumnWidth3, rec1B.Y);
- Point p31B_2 = new Point(p21B_1.X + ColumnWidth3, rec1B.Y + rec1B.Height);
- g.DrawLine(p, p31B_1, p31B_2);
- //重拍率
- string strValue = "";
- if (TotalOrderCount > 0)
- { strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero((TotalSeriesAmount / Convert.ToDecimal(TotalOrderCount) * 100).ToString("0.00")) + "%"; }
- sizef = g.MeasureString(strValue.Trim(), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec4B_1 = new Rectangle(p31B_1.X + ColumnWidth4 - FtWidth - (ColumnWidth4 / 6) * 2, p31B_1.Y + TopAdd, ColumnWidth4, RowHeight);
- g.DrawString(strValue.Trim(), ft11, b, rec4B_1);
- #endregion
- }
- else
- {
- this.panelEx6.Visible = false;
- this.panelEx5.Dock = DockStyle.Fill;
- }
- #endregion
- }
- else
- {
- this.panelEx4.Visible = true;
- string StrTimeStratDb = this.dtDataTimeStartCompared.DateValue.Trim();
- string StrTimeEndDb = this.dtDateTimeEndCompared.DateValue.Trim();
- 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 " +
- "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 + ")" +
- " UNION ALL " +
- "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 " +
- "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 + ")";
- DataSet dsDataDb = orbll.GetView_Custom(ExecuteSql);
- DataTable dt_tableDb = dsDataDb.Tables["ds"];
- #region 启动对比
- int ColumnWidthSplit2 = ColumnWidth2 / 3;
- int ColumnWidthSplit3 = ColumnWidth3 / 3;
- int ColumnWidthSplit4 = ColumnWidth4 / 3;
- int ForTopLoad = 13;
- string StrValue = StrTimeStrat + "—" + StrTimeEnd + " 与 " + StrTimeStratDb + "—" + StrTimeEndDb + " 订单情况对比分析表";
- SizeF sizef = g.MeasureString(StrValue, ft15);
- int FtHeigth = Convert.ToInt32(sizef.Height);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec = new Rectangle(TableWidth / 2 - FtWidth / 2, ForTopLoad, FtWidth, FtHeigth);
- g.DrawString(StrValue, ft15, b, rec);//画消费法规
- ForTopLoad += rec.Height;
- #region 标题
- Rectangle rec1 = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight * 2);
- g.DrawRectangle(p, rec1);//画标题矩形
- Rectangle recBackColor1 = new Rectangle(rec1.X + 1, rec1.Y + 1, rec1.Width - 1, rec1.Height - 1);
- g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.backColortitle, recBackColor1);//画标题矩形
- Point p1_1 = new Point(rec1.X + ColumnWidth1, rec1.Y + RowHeight);
- Point p1_2 = new Point(rec1.X + TableWidth, rec1.Y + RowHeight);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p1_1, p1_2);
- Rectangle rec1_1 = new Rectangle(rec1.X, rec1.Y + TopAdd, ColumnWidth1, RowHeight);
- g.DrawString("", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1_1);
- Point p11_1 = new Point(rec1.X + ColumnWidth1, rec1.Y);
- Point p11_2 = new Point(rec1.X + ColumnWidth1, rec1.Y + RowHeight);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11_1, p11_2);
- Rectangle rec2_1 = new Rectangle(p11_1.X + ColumnWidth2 / 2 - 26, p11_1.Y + TopAdd, ColumnWidth2, RowHeight);
- g.DrawString("拍摄次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2_1);
- Point p21_1 = new Point(p11_1.X + ColumnWidth2, rec1.Y);
- Point p21_2 = new Point(p11_1.X + ColumnWidth2, rec1.Y + RowHeight);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21_1, p21_2);
- Rectangle rec3_1 = new Rectangle(p21_1.X + ColumnWidth3 / 2 - 20, p21_1.Y + TopAdd, ColumnWidth3, RowHeight);
- g.DrawString("重拍次数", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3_1);
- Point p31_1 = new Point(p21_1.X + ColumnWidth3, rec1.Y);
- Point p31_2 = new Point(p21_1.X + ColumnWidth3, rec1.Y + RowHeight);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31_1, p31_2);
- Rectangle rec4_1 = new Rectangle(p31_1.X + ColumnWidth4 / 2 - 20, p31_1.Y + TopAdd, ColumnWidth4, RowHeight);
- g.DrawString("重拍率", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4_1);
- sizef = g.MeasureString("测试测", ft11b);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec1AB = new Rectangle(p1_1.X, p1_1.Y, TableWidth - ColumnWidth1 + 1, RowHeight);
- g.DrawRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, rec1AB);//画标题矩形
- Rectangle rec2AB_1 = new Rectangle(rec1AB.X + (ColumnWidthSplit2 - FtWidth) / 2, rec1AB.Y + TopAdd, ColumnWidthSplit2, RowHeight);
- g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2AB_1);
- Point p21AB_1 = new Point(rec1AB.X + ColumnWidthSplit2, rec1AB.Y);
- Point p21AB_2 = new Point(rec1AB.X + ColumnWidthSplit2, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21AB_1, p21AB_2);
- Rectangle rec3AB_1 = new Rectangle(p21AB_1.X + (ColumnWidthSplit2 - FtWidth) / 2, p21AB_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
- g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3AB_1);
- Point p31AB_1 = new Point(p21AB_1.X + ColumnWidthSplit2, rec1AB.Y);
- Point p31AB_2 = new Point(p21AB_1.X + ColumnWidthSplit2, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31AB_1, p31AB_2);
- Rectangle rec4AB_1 = new Rectangle(p31AB_1.X + (ColumnWidthSplit2 - FtWidth) / 2, p31AB_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
- g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4AB_1);
- Point p41AB_1 = new Point(p31AB_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1AB.Y);
- Point p41AB_2 = new Point(p31AB_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41AB_1, p41AB_2);
- Rectangle rec1BB_1 = new Rectangle(p41AB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p41AB_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
- g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1BB_1);
- Point p11BB_1 = new Point(p41AB_1.X + ColumnWidthSplit3, rec1AB.Y);
- Point p11BB_2 = new Point(p41AB_1.X + ColumnWidthSplit3, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11BB_1, p11BB_2);
- Rectangle rec2BB_1 = new Rectangle(p11BB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p11BB_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
- g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2BB_1);
- Point p21BB_1 = new Point(p11BB_1.X + ColumnWidthSplit3, rec1AB.Y);
- Point p21BB_2 = new Point(p11BB_1.X + ColumnWidthSplit3, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21BB_1, p21BB_2);
- Rectangle rec3BB_1 = new Rectangle(p21BB_1.X + (ColumnWidthSplit3 - FtWidth) / 2, p21BB_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
- g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3BB_1);
- Point p31BB_1 = new Point(p21BB_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1AB.Y);
- Point p31BB_2 = new Point(p21BB_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31BB_1, p31BB_2);
- Rectangle rec4BB_1 = new Rectangle(p31BB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p31BB_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4BB_1);
- Point p41BB_1 = new Point(p31BB_1.X + ColumnWidthSplit4, rec1AB.Y);
- Point p41BB_2 = new Point(p31BB_1.X + ColumnWidthSplit4, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41BB_1, p41BB_2);
- Rectangle rec1CB_1 = new Rectangle(p41BB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p41BB_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1CB_1);
- Point p11CB_1 = new Point(p41BB_1.X + ColumnWidthSplit4, rec1AB.Y);
- Point p11CB_2 = new Point(p41BB_1.X + ColumnWidthSplit4, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11CB_1, p11CB_2);
- Rectangle rec2CB_1 = new Rectangle(p11CB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p11CB_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
- g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2CB_1);
- ForTopLoad += rec1.Height;
- #endregion
- int TotalOrderCount = 0;
- int TotalSeriesAmount = 0;
- int TotalOrderCountDb = 0;
- int TotalSeriesAmountDb = 0;
- string[] StrArray = StrOrdersPersoning.Trim().TrimEnd(',').Split(',');
- int SingleOrDouble = 0;
- for (int i = 0; i < StrArray.Length; i++)
- {
- string StrViewText = "";
- string StrViewTextDb = "";
- #region 内容
- 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() + "'");
- 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() + "'");
- if (dtRows.Length > 0 || dtRowsDb.Length > 0)
- {
- Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
- g.DrawRectangle(p, rec1A);//画标题矩形
- Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
- if ((SingleOrDouble % 2) > 0)
- { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
- else
- { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
- SingleOrDouble++;
- string StrPersonText = "";
- DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrArray[i].Trim());
- if (dtRow != null)
- {
- if (!string.IsNullOrEmpty(dtRow["User_Name"].ToString().Trim()))
- { StrPersonText = dtRow["User_Name"].ToString().Trim(); }
- }
- Rectangle rec1A_1 = new Rectangle(rec1A.X + 10, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
- g.DrawString(StrPersonText.Trim(), ft11b, b, rec1A_1);
- Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
- Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11A_1, p11A_2);
- #region 拍摄次数
- TotalOrderCount += dtRows.Length;
- TotalOrderCountDb += dtRowsDb.Length;
- StrViewText += dtRows.Length + "|";
- StrViewTextDb += dtRowsDb.Length + "|";
- Rectangle rec2A_1 = new Rectangle(p11A_1.X + 3, p11A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
- g.DrawString(dtRows.Length.ToString().Trim(), ft11, b, rec2A_1);
- Point p21A_1 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y);
- Point p21A_2 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21A_1, p21A_2);
- SetPostionData(
- dtRow["User_Name"].ToString(),
- StrArray[i].Trim(), rec2A_1, "", StrTimeStrat, StrTimeEnd);
- Rectangle rec3A_1 = new Rectangle(p21A_1.X + 3, p21A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dtRowsDb.Length), ft11, b, rec3A_1);
- Point p31A_1 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y);
- Point p31A_2 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31A_1, p31A_2);
- SetPostionData(
- dtRow["User_Name"].ToString(),
- StrArray[i].Trim(), rec3A_1, "", StrTimeStratDb, StrTimeEndDb);
- string StrPercentage = "";
- if (dtRowsDb.Length > 0)
- { StrPercentage = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((dtRows.Length - dtRowsDb.Length) / dtRowsDb.Length * 100).ToString("0.00")) + "%"; }
- Rectangle rec4A_1 = new Rectangle(p31A_1.X + 3, p31A_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
- g.DrawString(StrPercentage.Trim(), ft11, b, rec4A_1);
- Point p41A_1 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y);
- Point p41A_2 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p41A_1, p41A_2);
- #endregion
- #region 重拍次数
- int RetakeCount = 0;
- int RetakeCountDb = 0;
- for (int j = 0; j < dtRows.Length; j++)
- {
- if (dtRows[j]["Ordrr_Type"].ToString().Trim() == "0")
- { RetakeCount++; }
- }
- for (int j = 0; j < dtRowsDb.Length; j++)
- {
- if (dtRowsDb[j]["Ordrr_Type"].ToString().Trim() == "0")
- { RetakeCountDb++; }
- }
- TotalSeriesAmount += RetakeCount;
- TotalSeriesAmountDb += RetakeCountDb;
- StrViewText += RetakeCount + "|";
- StrViewTextDb += RetakeCountDb + "|";
- Rectangle rec1B_1 = new Rectangle(p41A_1.X + 3, p41A_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
- g.DrawString(RetakeCount.ToString().Trim(), ft11, b, rec1B_1);
- Point p11B_1 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y);
- Point p11B_2 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11B_1, p11B_2);
- SetPostionData(
- dtRow["User_Name"].ToString(),
- StrArray[i].Trim(), rec1B_1, "", StrTimeStrat, StrTimeEnd);
- Rectangle rec2B_1 = new Rectangle(p11B_1.X + 3, p11B_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
- g.DrawString(RetakeCountDb.ToString().Trim(), ft11, b, rec2B_1);
- Point p21B_1 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y);
- Point p21B_2 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21B_1, p21B_2);
- SetPostionData(
- dtRow["User_Name"].ToString(),
- StrArray[i].Trim(), rec2B_1, "", StrTimeStratDb, StrTimeEndDb);
- string StrPercentage2 = "";
- if (RetakeCountDb > 0)
- { StrPercentage2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((RetakeCount - RetakeCountDb) / RetakeCountDb * 100).ToString("0.00")) + "%"; }
- Rectangle rec3B_1 = new Rectangle(p21B_1.X + 3, p21B_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
- g.DrawString(StrPercentage2, ft11, b, rec3B_1);
- Point p31B_1 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y);
- Point p31B_2 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31B_1, p31B_2);
- #endregion
- #region 重拍率
- decimal AverageValue = 0;
- decimal AverageValueDb = 0;
- if (dtRows.Length > 0)
- { AverageValue = Convert.ToDecimal(((RetakeCount / dtRows.Length) * 100).ToString("0.00")); }
- string StrA = "";
- if (AverageValue != 0)
- { StrA = AverageValue + "%"; }
- if (dtRowsDb.Length > 0)
- { AverageValueDb = Convert.ToDecimal(((RetakeCountDb / dtRowsDb.Length) * 100).ToString("0.00")); }
- string StrB = "";
- if (AverageValueDb != 0)
- { StrB = AverageValueDb + "%"; }
- StrViewText += AverageValue + "|";
- StrViewTextDb += AverageValueDb + "|";
- Rectangle rec4B_1 = new Rectangle(p31B_1.X + 3, p31B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StrA), ft11, b, rec4B_1);
- Point p41B_1 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y);
- Point p41B_2 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p41B_1, p41B_2);
- Rectangle rec1C_1 = new Rectangle(p41B_1.X + 3, p41B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StrB), ft11, b, rec1C_1);
- Point p11C_1 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y);
- Point p11C_2 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11C_1, p11C_2);
- string StrPercentage3 = "";
- if (AverageValueDb > 0)
- { StrPercentage3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((AverageValue - AverageValueDb) / AverageValueDb * 100).ToString("0.00")) + "%"; }
- Rectangle rec2C_1 = new Rectangle(p11C_1.X + 3, p11C_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
- g.DrawString(StrPercentage3, ft11, b, rec2C_1);
- #endregion
- ForTopLoad += rec1A.Height;
- htDataView[StrPersonText.Trim()] = StrViewText.TrimEnd('|');
- htDataViewDb[StrPersonText.Trim()] = StrViewTextDb.TrimEnd('|');
- }
- #endregion
- }
- if (SingleOrDouble > 1)
- {
- this.panelEx6.Visible = true;
- this.panelEx5.Dock = DockStyle.Top;
- #region 总结
- Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad, TableWidth, RowHeight);
- g.DrawRectangle(p, rec1A);//画标题矩形
- Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
- if (((SingleOrDouble) % 2) > 0)
- { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1); }
- else
- { g.FillRectangle(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brDouble, rec1AColor1); }
- Rectangle rec1A_1 = new Rectangle(rec1A.X + 10, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
- g.DrawString("总计", ft11b, b, rec1A_1);
- Point p11A_1 = new Point(rec1A.X + ColumnWidth1, rec1A.Y);
- Point p11A_2 = new Point(rec1A.X + ColumnWidth1, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11A_1, p11A_2);
- #region 拍摄次数
- Rectangle rec2A_1 = new Rectangle(p11A_1.X + 3, p11A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalOrderCount), ft11, b, rec2A_1);
- Point p21A_1 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y);
- Point p21A_2 = new Point(p11A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21A_1, p21A_2);
- Rectangle rec3A_1 = new Rectangle(p21A_1.X + 3, p21A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalOrderCountDb), ft11, b, rec3A_1);
- Point p31A_1 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y);
- Point p31A_2 = new Point(p21A_1.X + ColumnWidthSplit2, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31A_1, p31A_2);
- string StrPercentage = "";
- if (TotalOrderCountDb > 0)
- { StrPercentage = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((Convert.ToDecimal(TotalOrderCount) - Convert.ToDecimal(TotalOrderCountDb)) / Convert.ToDecimal(TotalOrderCountDb) * 100).ToString("0.00")) + "%"; }
- Rectangle rec4A_1 = new Rectangle(p31A_1.X + 3, p31A_1.Y + TopAdd, ColumnWidth2 - ColumnWidthSplit2 * 2, RowHeight);
- g.DrawString(StrPercentage.Trim(), ft11, b, rec4A_1);
- Point p41A_1 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y);
- Point p41A_2 = new Point(p31A_1.X + ColumnWidth2 - ColumnWidthSplit2 * 2, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p41A_1, p41A_2);
- #endregion
- #region 重拍次数
- Rectangle rec1B_1 = new Rectangle(p41A_1.X + 3, p41A_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmount), ft11, b, rec1B_1);
- Point p11B_1 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y);
- Point p11B_2 = new Point(p41A_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11B_1, p11B_2);
- Rectangle rec2B_1 = new Rectangle(p11B_1.X + 3, p11B_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalSeriesAmountDb), ft11, b, rec2B_1);
- Point p21B_1 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y);
- Point p21B_2 = new Point(p11B_1.X + ColumnWidthSplit3, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21B_1, p21B_2);
- string StrPercentage2 = "";
- if (TotalSeriesAmountDb > 0)
- { StrPercentage2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((Convert.ToDecimal(TotalSeriesAmount) - Convert.ToDecimal(TotalSeriesAmountDb)) / Convert.ToDecimal(TotalSeriesAmountDb) * 100).ToString("0.00")) + "%"; }
- Rectangle rec3B_1 = new Rectangle(p21B_1.X + 3, p21B_1.Y + TopAdd, ColumnWidth3 - ColumnWidthSplit3 * 2, RowHeight);
- g.DrawString(StrPercentage2, ft11, b, rec3B_1);
- Point p31B_1 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y);
- Point p31B_2 = new Point(p21B_1.X + (ColumnWidth3 - ColumnWidthSplit3 * 2), rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31B_1, p31B_2);
- #endregion
- #region 重拍率
- decimal strValueA = 0;
- if (Convert.ToInt32(TotalOrderCount) > 0)
- { strValueA = Convert.ToDecimal((Convert.ToDecimal(TotalSeriesAmount) / Convert.ToDecimal(TotalOrderCount) * 100).ToString("0.00")); }
- string StrA = "";
- if (strValueA != 0)
- { StrA = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(strValueA) + "%"; }
- Rectangle rec4B_1 = new Rectangle(p31B_1.X + 3, p31B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StrA), ft11, b, rec4B_1);
- Point p41B_1 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y);
- Point p41B_2 = new Point(p31B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p41B_1, p41B_2);
- decimal strValueB = 0;
- if (Convert.ToInt32(TotalOrderCountDb) > 0)
- { strValueB = Convert.ToDecimal((Convert.ToDecimal(TotalSeriesAmountDb) / Convert.ToInt32(TotalOrderCountDb) * 100).ToString("0.00")); }
- string StrB = "";
- if (strValueB != 0)
- { StrB = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(strValueB) + "%"; }
- Rectangle rec1C_1 = new Rectangle(p41B_1.X + 3, p41B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StrB), ft11, b, rec1C_1);
- Point p11C_1 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y);
- Point p11C_2 = new Point(p41B_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11C_1, p11C_2);
- string StrPercentage3 = "";
- if (strValueB > 0)
- { StrPercentage3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((strValueA - strValueB) / strValueB * 100).ToString("0.00")) + "%"; }
- Rectangle rec2C_1 = new Rectangle(p11C_1.X + 3, p11C_1.Y + TopAdd, ColumnWidth4 - ColumnWidthSplit4 * 2, RowHeight);
- g.DrawString(StrPercentage3, ft11, b, rec2C_1);
- #endregion
- #endregion
- }
- else
- {
- this.panelEx6.Visible = false;
- this.panelEx5.Dock = DockStyle.Fill;
- }
- #endregion
- }
- this.PictImage.Image = newBmp;
- this.PublicFunctionView();
- }
- /// <summary>
- /// 创建图表
- /// </summary>
- private void PublicFunctionView()
- {
- this.chart1.Titles.Clear();
- this.chart1.Series.Clear();
- this.chart2.Series.Clear();
- this.chart2.Titles.Clear();
- Series tempseries = null;
- if (this.htDataView.Count > 1)
- {
- #region 无启用对比
- if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Column")
- {
- #region 柱状图
- this.chart1.Legends["Legend1"].Enabled = true;
- int forCount = 0;
- foreach (DictionaryEntry item in htDataView)
- {
- string[] StrArray = item.Value.ToString().Trim().Split('|');
- string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
- if (Convert.ToDecimal(StrValue) != 0)
- {
- tempseries = new Series(item.Key.ToString().Trim());
- tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
- this.chart1.Series.Add(tempseries);
- this.chart1.Series[forCount].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
- this.chart1.Series[forCount].Points.Clear();
- this.chart1.Series[forCount].ToolTip = item.Key.ToString().Trim();
- this.chart1.ChartAreas["ChartArea1"].AxisX.Interval = htDataView.Count;//x轴数据显示间隔
- tempseries.Points.AddXY("0", StrValue);
- if (Convert.ToDecimal(StrValue) > 0)
- { tempseries.Points[0].IsValueShownAsLabel = true; }
- forCount++;
- }
- }
- #endregion
- }
- else if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Pie")
- {
- #region 饼形图
- if (this.chkComparedStartUp.Checked)
- {
- string StrTitlesDb = this.dtDataTimeStart.DateValue.Trim() + " — " + this.dtDataTimeEnd.DateValue.Trim() + " 图表";
- this.chart1.Titles.Add(StrTitlesDb);
- }
- this.chart1.Legends["Legend1"].Enabled = false;
- tempseries = new Series();
- tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
- this.chart1.Series.Add(tempseries);
- this.chart1.Series[0]["PieLabelStyle"] = "Outside";//将文字移到外侧
- this.chart1.Series[0]["PieLineColor"] = "Black";//绘制黑色的连线。
- List<string> xData = new List<string>();
- List<double> yData = new List<double>();
- int forCount = 0;
- foreach (DictionaryEntry item in htDataView)
- {
- string[] StrArray = item.Value.ToString().Trim().Split('|');
- string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
- if (Convert.ToDecimal(StrValue) != 0)
- {
- this.chart1.Series[0].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
- this.chart1.Series[0].Points.Clear();
- this.chart1.Series[0].ToolTip = item.Key.ToString().Trim();
- xData.Add(item.Key.ToString().Trim() + ":" + StrValue);
- yData.Add(Convert.ToDouble(StrValue));
- forCount++;
- }
- }
- this.chart1.Series[0].Points.DataBindXY(xData, yData);
- #endregion
- }
- #endregion
- }
- if (this.chkComparedStartUp.Checked)
- {
- if (this.htDataViewDb.Count > 1)
- {
- #region 启用对比
- if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Column")
- {
- #region 柱状图
- this.chart2.Legends["Legend1"].Enabled = true;
- int forCount = 0;
- foreach (DictionaryEntry item in htDataViewDb)
- {
- string[] StrArray = item.Value.ToString().Trim().Split('|');
- string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
- if (Convert.ToDecimal(StrValue) != 0)
- {
- tempseries = new Series(item.Key.ToString().Trim());
- tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
- this.chart2.Series.Add(tempseries);
- this.chart2.Series[forCount].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
- this.chart2.Series[forCount].Points.Clear();
- this.chart2.Series[forCount].ToolTip = item.Key.ToString().Trim();
- this.chart2.ChartAreas["ChartArea1"].AxisX.Interval = htDataViewDb.Count;//x轴数据显示间隔
- tempseries.Points.AddXY("0", StrValue);
- if (Convert.ToDecimal(StrValue) > 0)
- { tempseries.Points[0].IsValueShownAsLabel = true; }
- forCount++;
- }
- }
- #endregion
- }
- else if (this.cmbtreevDisplayMethod.Tag.ToString().Trim() == "Pie")
- {
- #region 饼形图
- string StrTitlesDb = this.dtDataTimeStartCompared.DateValue.Trim() + " — " + this.dtDateTimeEndCompared.DateValue.Trim() + " 图表";
- this.chart2.Titles.Add(StrTitlesDb);
- this.chart2.Legends["Legend1"].Enabled = false;
- tempseries = new Series();
- tempseries.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.cmbtreevDisplayMethod.Tag.ToString());
- this.chart2.Series.Add(tempseries);
- this.chart2.Series[0]["PieLabelStyle"] = "Outside";//将文字移到外侧
- this.chart2.Series[0]["PieLineColor"] = "Black";//绘制黑色的连线。
- List<string> xData = new List<string>();
- List<double> yData = new List<double>();
- int forCount = 0;
- foreach (DictionaryEntry item in htDataViewDb)
- {
- string[] StrArray = item.Value.ToString().Trim().Split('|');
- string StrValue = StrArray[Convert.ToInt32(this.cmbtreevDisplayItem.Tag)].Trim();
- if (Convert.ToDecimal(StrValue) != 0)
- {
- this.chart2.Series[0].Color = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.myChartsColor[forCount];
- this.chart2.Series[0].Points.Clear();
- this.chart2.Series[0].ToolTip = item.Key.ToString().Trim();
- xData.Add(item.Key.ToString().Trim() + ":" + StrValue);
- yData.Add(Convert.ToDouble(StrValue));
- forCount++;
- }
- }
- this.chart2.Series[0].Points.DataBindXY(xData, yData);
- #endregion
- }
- #endregion
- }
- }
- }
- }
- }
|