12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496 |
- 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 AnalyzedOrderOperatingFormMain : LYFZ.Software.UI.DecisionAssistant.AnalyzedOrderOperatingFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- List<ModelImagePostionAction> actionList = new List<ModelImagePostionAction>();
- public AnalyzedOrderOperatingFormMain()
- {
- this.Load += AnalyzedOrderOperatingFormMain_Load;
- this.Shown += AnalyzedOrderOperatingFormMain_Shown;
- this.btnQuery.Click += btnQuery_Click;
- this.btnQueryCompared.Click += btnQueryCompared_Click;
- this.btnSaveAs.Click += btnSaveAs_Click;
- this.btnColseed.Click += btnColseed_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 += AnalyzedOrderOperatingFormMain_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.BindDataGridView(action);
- detailForm.ShowDialog();
- //MessageBox.Show("内容!");
- }
- }
- bool IsFristLoad = true;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderOperatingFormMain_Load(object sender, EventArgs e)
- {
- this.panelQueryCompared.Visible = false;
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "stA10", StrKeyCode: "stA11", IsShowAllText: 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:均价,3:实收,4:余款", IsSplit: true);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevDisplayMethod, "Pie:饼形图,Column:柱状图", IsSplit: true);
- this.cmbtreevDisplayItem.TagFindText("0");
- this.cmbtreevDisplayMethod.TagFindText("Pie");
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderOperatingFormMain_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 btnColseed_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 AnalyzedOrderOperatingFormMain_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.panelEx6.Width = this.panelEx3.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.AnalyzedOrderOperatingFormMain_Resize(this, null);
- this.IsFristLoad = false;
- this.htDataView.Clear();
- this.htDataViewDb.Clear();
- 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 = 130;
- if (this.chkComparedStartUp.Checked)
- { ColumnWidth1 = 75; }
- int ColumnWidth2 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked? 6: 5);
- int ColumnWidth3 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
- int ColumnWidth4 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
- int ColumnWidth5 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
- int ColumnWidth6 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
- int ColumnWidth7 = (TableWidth - ColumnWidth1) / (cbxStoredCard.Checked ? 6 : 5);
- int TableHeoght = 300 - 60;
- int RowHeight = TableHeoght / 7;
- string StrTypeTextNull = " ";
- if (this.chkComparedStartUp.Checked)
- { StrTypeTextNull = " "; }
- string StoreWhere = "";
- if(!cbxStoredCard.Checked)
- {
- StoreWhere = " and Pay_PaymentMethod != 'BEBACCAFEGECFBJFD' ";
- }
- string StrTimeStrat = this.dtDataTimeStart.DateValue.Trim();
- string StrTimeEnd = this.dtDataTimeEnd.DateValue.Trim();
- string ExecuteSql = "with t AS " +
- "(" +
- "select Pay_OrdNumber,sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPayment where Pay_Type = 0 And Pay_Category in ('全款','预约收款','预约补款') Group By Pay_OrdNumber " +
- ")," +
- " t1 AS " +
- "(" +
- "select Pay_OrdNumber as Pay_OrdStoreNumber,sum(Pay_AmountOf) AS Pay_StoreAmountOf,Pay_Type as Pay_StoreType from tb_ErpPayment where Pay_PaymentMethod = 'BEBACCAFEGECFBJFD' Group By Pay_OrdNumber,Pay_Type " +
- ")" +
- "select 0 AS Ord_Type,'订 单' AS Ord_TypeText,Count(tb_ErpOrder.ID) AS CountID,isnull(Sum(Ord_SeriesPrice),0) AS SeriesAmount," +
- "isnull(Sum(Pay_AmountOf),0) AS PaidAmount, isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf from tb_ErpOrder Left Join t on Pay_OrdNumber = Ord_Number left join t1 on Pay_OrdStoreNumber = Ord_Number and Pay_StoreType = 0 ";
-
- ExecuteSql +=
- "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_SaveOrderDateTime", StrTimeStrat, StrTimeEnd, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop") + " " +
- "UNION ALL " +
- "select 1 AS Ord_Type,'选 片' AS Ord_TypeText,Count(ID) AS CountID,isnull(Sum(Ord_SeriesPrice), 0) SeriesAmount,isnull(Sum(Pay_AmountOf), 0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf), 0) AS Pay_StoreAmountOf " +
- "from (select tb_ErpOrderDigital.ID,isnull((select sum(Plu_Amount) from tb_ErpPlusPickItems where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ'),0) AS Ord_SeriesPrice," +
- "isnull((select Sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPlusPickItems Left Join tb_ErpPayment on Plu_Number = Pay_PlusPickNumber Where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ'),0) AS Pay_AmountOf, " +
- "isnull((select Sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPlusPickItems Left Join tb_ErpPayment on Plu_Number = Pay_PlusPickNumber Where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ' and Pay_PaymentMethod = 'BEBACCAFEGECFBJFD' ),0) AS Pay_StoreAmountOf " +
- "from tb_ErpOrderDigital Left Join tb_ErpUser on User_EmployeeID = Ordv_FilmSelectionName ";
- ExecuteSql +=
- "Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_FilmSelectionTime", StrTimeStrat, StrTimeEnd, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "User_DividedShop") + ") AS tb " +
- "UNION ALL " +
- "select 2 AS Ord_Type,'散客消费' AS Ord_TypeText,Count(tb_ErpTwoSalesOrder.ID) AS CountID,isnull(Sum(Tsorder_Money),0) AS SeriesAmount,isnull(Sum(Pay_AmountOf),0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf " +
- "from tb_ErpTwoSalesOrder Left Join tb_ErpPayment on Pay_OrdNumber = Tsorder_Number And Pay_Type = 1 left join t1 on Pay_OrdStoreNumber = Tsorder_Number and Pay_StoreType = 1 ";
- ExecuteSql +=" Where " +
- "" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Tsorder_CreateDatetime", StrTimeStrat, StrTimeEnd, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Tsorder_DividedShop") + " " +
- "UNION ALL " +
- "select 3 AS Ord_Type,'礼服租售' AS Ord_TypeText,Count(tb_ErpDressSaleRentalOrder.ID) AS CountID,isnull(Sum(Dsro_Amount),0) AS SeriesAmount,isnull(Sum(Pay_AmountOf),0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf " +
- "from tb_ErpDressSaleRentalOrder Left Join tb_ErpPayment on Pay_OrdNumber = Dsro_Number And Pay_Type = 2 left join t1 on Pay_OrdStoreNumber = Dsro_Number and Pay_StoreType = 2 ";
- ExecuteSql += "Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Dsro_CreateDateTime", StrTimeStrat, StrTimeEnd, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Dsro_DividedShop") + " ";
- DataSet dsData = orbll.GetView_Custom(ExecuteSql);
- DataTable dtOrderCount = dsData.Tables["ds"];
- if (!this.chkComparedStartUp.Checked)
- {
- this.panelEx6.Visible = false;
- #region 无启动对比
- int ForTopLoad = 30;
- 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;
- int TotalOrderCount = 0;
- decimal TotalSeriesAmount = 0;
- decimal TotalPaidAmount = 0;
- decimal TotalArrearsAmount = 0;
- decimal TotalStoreAmount = 0;
-
- for (int i = 0; i < dtOrderCount.Rows.Count; i++)
- {
- string StrViewText = "";
- #region 标题
- if (i == 0)
- {
- 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 - 30, 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);
- Point p41_1 = new Point(p31_1.X + ColumnWidth4, rec1.Y);
- Point p41_2 = new Point(p31_1.X + ColumnWidth4, rec1.Y + rec1.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41_1, p41_2);
- Rectangle rec5_1 = new Rectangle(p41_1.X + ColumnWidth5 / 2 - 20, p41_1.Y + TopAdd, ColumnWidth5, RowHeight);
- g.DrawString("实收", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec5_1);
- Point p51_1 = new Point(p41_1.X + ColumnWidth5, rec1.Y);
- Point p51_2 = new Point(p41_1.X + ColumnWidth5, rec1.Y + rec1.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p51_1, p51_2);
- if(cbxStoredCard.Checked)
- {
- Rectangle rec6_1 = new Rectangle(p51_1.X + ColumnWidth6 / 2 - 20, p51_1.Y + TopAdd, ColumnWidth6, RowHeight);
- g.DrawString("余款", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec6_1);
- Point p61_1 = new Point(p51_1.X + ColumnWidth6, rec1.Y);
- Point p61_2 = new Point(p51_1.X + ColumnWidth6, rec1.Y + rec1.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p61_1, p61_2);
- Rectangle rec7_1 = new Rectangle(p61_1.X + ColumnWidth7 / 2 - 20, p61_1.Y + TopAdd, ColumnWidth7, RowHeight);
- g.DrawString("储值卡扣款", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec7_1);
- }
- else
- {
- Rectangle rec6_1 = new Rectangle(p51_1.X + ColumnWidth6 / 2 - 20, p51_1.Y + TopAdd, ColumnWidth6, RowHeight);
- g.DrawString("余款", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec6_1);
- }
-
- }
- #endregion
- #region 内容
- Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad + RowHeight * (i + 1), TableWidth, RowHeight);
- g.DrawRectangle(p, rec1A);//画标题矩形
- Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
- if ((i % 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 + 35, rec1A.Y + TopAdd, ColumnWidth1, RowHeight);
- g.DrawString(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().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);
- //消费次数
- string OrderCount = dtOrderCount.Rows[i]["CountID"].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(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "消费次数", rec2A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- //业绩
- decimal SeriesAmount = Convert.ToDecimal(dtOrderCount.Rows[i]["SeriesAmount"]);
- decimal PaidAmount = Convert.ToDecimal(dtOrderCount.Rows[i]["PaidAmount"]);
- decimal StoreAmount = Convert.ToDecimal(dtOrderCount.Rows[i]["Pay_StoreAmountOf"]);
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- TotalSeriesAmount += SeriesAmount;
- Rectangle rec3A_1 = new Rectangle(p21A_1.X + ColumnWidth3 - FtWidth - ColumnWidth3 / 3, p21A_1.Y + TopAdd, ColumnWidth3, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmount), 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 += LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmount) + "|";
- SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "业绩", rec3A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- //均价
- string strValue = "0";
- if (Convert.ToInt32(OrderCount) > 0)
- { strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero((SeriesAmount / Convert.ToInt32(OrderCount)).ToString("0.00")); }
- sizef = g.MeasureString(strValue.ToString().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);
- Point p41A_1 = new Point(p31A_1.X + ColumnWidth4, rec1A.Y);
- Point p41A_2 = new Point(p31A_1.X + ColumnWidth4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p41A_1, p41A_2);
- StrViewText += strValue + "|";
- SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "均价", rec4A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- //实收
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(PaidAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- TotalPaidAmount += PaidAmount;
- Rectangle rec5A_1 = new Rectangle(p41A_1.X + ColumnWidth5 - FtWidth - ColumnWidth5 / 3, p41A_1.Y + TopAdd, ColumnWidth5, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(PaidAmount), ft11, b, rec5A_1);
- Point p51A_1 = new Point(p41A_1.X + ColumnWidth5, rec1A.Y);
- Point p51A_2 = new Point(p41A_1.X + ColumnWidth5, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p51A_1, p51A_2);
- StrViewText += PaidAmount + "|";
- SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "实收", rec5A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- if (cbxStoredCard.Checked)
- {
- //余款
- decimal ArrearsAmount = SeriesAmount - PaidAmount;
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- TotalArrearsAmount += ArrearsAmount;
- Rectangle rec6A_1 = new Rectangle(p51A_1.X + ColumnWidth6 - FtWidth - ColumnWidth6 / 3, p51A_1.Y + TopAdd, ColumnWidth6, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11, b, rec6A_1);
- Point p61A_1 = new Point(p51A_1.X + ColumnWidth6, rec1A.Y);
- Point p61A_2 = new Point(p51A_1.X + ColumnWidth6, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p61A_1, p61A_2);
- StrViewText += ArrearsAmount + "|";
- SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "余款", rec6A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StoreAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec7A_1 = new Rectangle(p61A_1.X + ColumnWidth7 - FtWidth - ColumnWidth7 / 3, p61A_1.Y + TopAdd, ColumnWidth7, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(StoreAmount), ft11, b, rec7A_1);
- StrViewText += ArrearsAmount + "|";
- TotalStoreAmount += StoreAmount;
- }
- else
- {
- //余款
- decimal ArrearsAmount = SeriesAmount - PaidAmount;
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- TotalArrearsAmount += ArrearsAmount;
- Rectangle rec6A_1 = new Rectangle(p51A_1.X + ColumnWidth6 - FtWidth - ColumnWidth6 / 3, p51A_1.Y + TopAdd, ColumnWidth6, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11, b, rec6A_1);
- StrViewText += ArrearsAmount + "|";
- SetPostionData(dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim().Replace(" ", ""), "余款", rec6A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- }
- htDataView[dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim()] = StrViewText.TrimEnd('|');
- #endregion
- }
- if (dtOrderCount.Rows.Count > 1)
- {
- this.panelEx3.Visible = true;
- this.panelEx2.Dock = DockStyle.Top;
- #region 总结
- Rectangle rec1B = new Rectangle(LeftWidth, ForTopLoad + RowHeight * (dtOrderCount.Rows.Count + 1), TableWidth, RowHeight);
- g.DrawRectangle(p, rec1B);//画标题矩形
- Rectangle rec1BColor1 = new Rectangle(rec1B.X + 1, rec1B.Y + 1, rec1B.Width - 1, rec1B.Height - 1);
- if ((dtOrderCount.Rows.Count % 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 + 34, rec1B.Y + TopAdd, ColumnWidth1, RowHeight);
- g.DrawString("总" + StrTypeTextNull + "计", 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 - FtWidth - (ColumnWidth3 / 6) * 2, 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 = "0";
- if (Convert.ToInt32(TotalOrderCount) > 0)
- { strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero((TotalSeriesAmount / Convert.ToInt32(TotalOrderCount)).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);
- Point p41B_1 = new Point(p31B_1.X + ColumnWidth4, rec1B.Y);
- Point p41B_2 = new Point(p31B_1.X + ColumnWidth4, rec1B.Y + rec1B.Height);
- g.DrawLine(p, p41B_1, p41B_2);
- //实收
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalPaidAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec5B_1 = new Rectangle(p41B_1.X + ColumnWidth5 - FtWidth - (ColumnWidth5 / 6) * 2, p41B_1.Y + TopAdd, ColumnWidth5, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalPaidAmount), ft11, b, rec5B_1);
- Point p51B_1 = new Point(p41B_1.X + ColumnWidth5, rec1B.Y);
- Point p51B_2 = new Point(p41B_1.X + ColumnWidth5, rec1B.Y + rec1B.Height);
- g.DrawLine(p, p51B_1, p51B_2);
- if (cbxStoredCard.Checked)
- {
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec6B_1 = new Rectangle(p51B_1.X + ColumnWidth6 - FtWidth - (ColumnWidth6 / 6) * 2, p51B_1.Y + TopAdd, ColumnWidth6, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11, b, rec6B_1);
- Point p61B_1 = new Point(p51B_1.X + ColumnWidth6, rec1B.Y);
- Point p61B_2 = new Point(p51B_1.X + ColumnWidth6, rec1B.Y + rec1B.Height);
- g.DrawLine(p, p61B_1, p61B_2);
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalStoreAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec7B_1 = new Rectangle(p61B_1.X + ColumnWidth7 - FtWidth - (ColumnWidth7 / 6) * 2, p61B_1.Y + TopAdd, ColumnWidth7, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalStoreAmount), ft11, b, rec7B_1);
- }
- else
- {
- //余款
- sizef = g.MeasureString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec6B_1 = new Rectangle(p51B_1.X + ColumnWidth6 - FtWidth - (ColumnWidth6 / 6) * 2, p51B_1.Y + TopAdd, ColumnWidth6, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11, b, rec6B_1);
- }
-
- #endregion
- }
- else
- {
- this.panelEx3.Visible = false;
- this.panelEx2.Dock = DockStyle.Fill;
- }
- #endregion
- }
- else
- {
- this.panelEx6.Visible = true;
- string StrTimeStratDb = this.dtDataTimeStartCompared.DateValue.Trim();
- string StrTimeEndDb = this.dtDateTimeEndCompared.DateValue.Trim();
- ExecuteSql = "with t AS " +
- "(" +
- "select Pay_OrdNumber,sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPayment where Pay_Type = 0 And Pay_Category in ('全款','预约收款','预约补款') Group By Pay_OrdNumber " +
- ")," +
- " t1 AS " +
- "(" +
- "select Pay_OrdNumber as Pay_OrdStoreNumber,sum(Pay_AmountOf) AS Pay_StoreAmountOf,Pay_Type as Pay_StoreType from tb_ErpPayment where Pay_PaymentMethod = 'BEBACCAFEGECFBJFD' Group By Pay_OrdNumber,Pay_Type " +
- ")" +
- "select 0 AS Ord_Type,'订 单' AS Ord_TypeText,Count(tb_ErpOrder.ID) AS CountID,isnull(Sum(Ord_SeriesPrice),0) AS SeriesAmount," +
- "isnull(Sum(Pay_AmountOf),0) AS PaidAmount, isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf from tb_ErpOrder Left Join t on Pay_OrdNumber = Ord_Number left join t1 on Pay_OrdStoreNumber = Ord_Number and Pay_StoreType = 0 ";
- ExecuteSql +=
- "where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_SaveOrderDateTime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop") + " " +
- "UNION ALL " +
- "select 1 AS Ord_Type,'选 片' AS Ord_TypeText,Count(ID) AS CountID,isnull(Sum(Ord_SeriesPrice), 0) SeriesAmount,isnull(Sum(Pay_AmountOf), 0) AS PaidAmount ,'0' AS Pay_StoreAmountOf " +
- "from (select tb_ErpOrderDigital.ID,isnull((select sum(Plu_Amount) from tb_ErpPlusPickItems where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ'),0) AS Ord_SeriesPrice," +
- "isnull((select Sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPlusPickItems Left Join tb_ErpPayment on Plu_Number = Pay_PlusPickNumber Where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ'),0) AS Pay_AmountOf, " +
- "isnull((select Sum(Pay_AmountOf) AS Pay_AmountOf from tb_ErpPlusPickItems Left Join tb_ErpPayment on Plu_Number = Pay_PlusPickNumber Where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ' and Pay_PaymentMethod = 'BEBACCAFEGECFBJFD' ),0) AS Pay_StoreAmountOf " +
- "from tb_ErpOrderDigital Left Join tb_ErpUser on User_EmployeeID = Ordv_FilmSelectionName ";
- ExecuteSql +=
- "Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_FilmSelectionTime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "User_DividedShop") + ") AS tb " +
- "UNION ALL " +
- "select 2 AS Ord_Type,'散客消费' AS Ord_TypeText,Count(tb_ErpTwoSalesOrder.ID) AS CountID,isnull(Sum(Tsorder_Money),0) AS SeriesAmount,isnull(Sum(Pay_AmountOf),0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf " +
- "from tb_ErpTwoSalesOrder Left Join tb_ErpPayment on Pay_OrdNumber = Tsorder_Number And Pay_Type = 1 left join t1 on Pay_OrdStoreNumber = Tsorder_Number and Pay_StoreType = 1 ";
- ExecuteSql +=
- " Where " +
- "" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Tsorder_CreateDatetime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Tsorder_DividedShop") + " " +
- "UNION ALL " +
- "select 3 AS Ord_Type,'礼服租售' AS Ord_TypeText,Count(tb_ErpDressSaleRentalOrder.ID) AS CountID,isnull(Sum(Dsro_Amount),0) AS SeriesAmount,isnull(Sum(Pay_AmountOf),0) AS PaidAmount ,isnull(Sum(Pay_StoreAmountOf),0) AS Pay_StoreAmountOf " +
- "from tb_ErpDressSaleRentalOrder Left Join tb_ErpPayment on Pay_OrdNumber = Dsro_Number And Pay_Type = 2 left join t1 on Pay_OrdStoreNumber = Dsro_Number and Pay_StoreType = 2 ";
- ExecuteSql +=
- "Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Dsro_CreateDateTime", StrTimeStratDb, StrTimeEndDb, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Dsro_DividedShop") + " ";
- DataSet dsDataDb = orbll.GetView_Custom(ExecuteSql);
- DataTable dtOrderCountDb = dsDataDb.Tables["ds"];
- #region 启动对比
- int ColumnWidthSplit2 = ColumnWidth2 / 3;
- int ColumnWidthSplit3 = ColumnWidth3 / 3;
- int ColumnWidthSplit4 = ColumnWidth4 / 3;
- int ColumnWidthSplit5 = ColumnWidth5 / 3;
- int ColumnWidthSplit6 = ColumnWidth6 / 3;
- int ForTopLoad = 15;
- 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.Y + rec.Height;
- decimal TotalOrderCount = 0;
- decimal TotalSeriesAmount = 0;
- decimal TotalPaidAmount = 0;
- decimal TotalArrearsAmount = 0;
- decimal TotalOrderCountDb = 0;
- decimal TotalSeriesAmountDb = 0;
- decimal TotalPaidAmountDb = 0;
- decimal TotalArrearsAmountDb = 0;
- Hashtable htData = new Hashtable();
- for (int i = 0; i < dtOrderCount.Rows.Count; i++)
- {
- htData[dtOrderCount.Rows[i]["Ord_Type"].ToString().Trim()] = dtOrderCount.Rows[i]["Ord_TypeText"].ToString().Trim();
- }
- for (int i = 0; i < dtOrderCountDb.Rows.Count; i++)
- {
- htData[dtOrderCountDb.Rows[i]["Ord_Type"].ToString().Trim()] = dtOrderCountDb.Rows[i]["Ord_TypeText"].ToString().Trim();
- }
- int forCount = 0;
- foreach (DictionaryEntry item in htData)
- {
- string StrViewText = "";
- string StrViewTextDb = "";
- #region 标题
- if (forCount == 0)
- {
- 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);//画标题矩形
- ForTopLoad = rec1.Y + rec1.Height;
- 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 - 30, 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);
- Point p41_1 = new Point(p31_1.X + ColumnWidth4, rec1.Y);
- Point p41_2 = new Point(p31_1.X + ColumnWidth4, rec1.Y + RowHeight);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41_1, p41_2);
- Rectangle rec5_1 = new Rectangle(p41_1.X + ColumnWidth5 / 2 - 20, p41_1.Y + TopAdd, ColumnWidth5, RowHeight);
- g.DrawString("实收", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec5_1);
- Point p51_1 = new Point(p41_1.X + ColumnWidth5, rec1.Y);
- Point p51_2 = new Point(p41_1.X + ColumnWidth5, rec1.Y + RowHeight);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p51_1, p51_2);
- Rectangle rec6_1 = new Rectangle(p51_1.X + ColumnWidth6 / 2 - 20, p51_1.Y + TopAdd, ColumnWidth6, RowHeight);
- g.DrawString("余款", ft12b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec6_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);
- Point p21CB_1 = new Point(p11CB_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1AB.Y);
- Point p21CB_2 = new Point(p11CB_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21CB_1, p21CB_2);
- Rectangle rec3CB_1 = new Rectangle(p21CB_1.X + (ColumnWidthSplit4 - FtWidth) / 2, p21CB_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3CB_1);
- Point p31CB_1 = new Point(p21CB_1.X + ColumnWidthSplit4, rec1AB.Y);
- Point p31CB_2 = new Point(p21CB_1.X + ColumnWidthSplit4, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31CB_1, p31CB_2);
- Rectangle rec4CB_1 = new Rectangle(p31CB_1.X + (ColumnWidthSplit5 - FtWidth) / 2, p31CB_1.Y + TopAdd, ColumnWidthSplit5, RowHeight);
- g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4CB_1);
- Point p41CB_1 = new Point(p31CB_1.X + ColumnWidthSplit5, rec1AB.Y);
- Point p41CB_2 = new Point(p31CB_1.X + ColumnWidthSplit5, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p41CB_1, p41CB_2);
- Rectangle rec1DB_1 = new Rectangle(p41CB_1.X + (ColumnWidthSplit5 - FtWidth) / 2, p41CB_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit5 * 2, RowHeight);
- g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec1DB_1);
- Point p11DB_1 = new Point(p41CB_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1AB.Y);
- Point p11DB_2 = new Point(p41CB_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p11DB_1, p11DB_2);
- Rectangle rec2DB_1 = new Rectangle(p11DB_1.X + (ColumnWidthSplit6 - FtWidth) / 2, p11DB_1.Y + TopAdd, ColumnWidthSplit6, RowHeight);
- g.DrawString("对比前", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec2DB_1);
- Point p21DB_1 = new Point(p11DB_1.X + ColumnWidthSplit6, rec1AB.Y);
- Point p21DB_2 = new Point(p11DB_1.X + ColumnWidthSplit6, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p21DB_1, p21DB_2);
- Rectangle rec3DB_1 = new Rectangle(p21DB_1.X + (ColumnWidthSplit6 - FtWidth) / 2, p21DB_1.Y + TopAdd, ColumnWidth6 - ColumnWidthSplit6 * 2, RowHeight);
- g.DrawString("对比后", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec3DB_1);
- Point p31DB_1 = new Point(p21DB_1.X + ColumnWidthSplit6, rec1AB.Y);
- Point p31DB_2 = new Point(p21DB_1.X + ColumnWidthSplit6, rec1AB.Y + rec1AB.Height);
- g.DrawLine(LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.ptitle, p31DB_1, p31DB_2);
- Rectangle rec4DB_1 = new Rectangle(p31DB_1.X + (ColumnWidthSplit6 - FtWidth) / 2, p31DB_1.Y + TopAdd, ColumnWidth6 - ColumnWidthSplit6 * 2, RowHeight);
- g.DrawString("增长率", ft11b, LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.btitle, rec4DB_1);
- }
- #endregion
- #region 内容
- DataRow[] dtRowCount = dtOrderCount.Select("Ord_Type = '" + item.Key.ToString().Trim() + "'");
- DataRow[] dtRowCountDb = dtOrderCountDb.Select("Ord_Type = '" + item.Key.ToString().Trim() + "'");
- Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad + RowHeight * forCount, TableWidth, RowHeight);
- g.DrawRectangle(p, rec1A);//画标题矩形
- Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
- if ((forCount % 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(item.Value.ToString().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 订单数
- decimal OrderCount = 0;
- decimal OrderCountDb = 0;
- if (dtRowCount.Length > 0)
- { OrderCount = Convert.ToDecimal(dtRowCount[0]["CountID"]); }
- if (dtRowCountDb.Length > 0)
- { OrderCountDb = Convert.ToDecimal(dtRowCountDb[0]["CountID"]); }
- TotalOrderCount += OrderCount;
- TotalOrderCountDb += OrderCountDb;
- StrViewText += OrderCount + "|";
- StrViewTextDb += OrderCountDb + "|";
- Rectangle rec2A_1 = new Rectangle(p11A_1.X + 3, p11A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(OrderCount), 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(item.Value.ToString().Trim().Replace(" ", ""), "消费次数", rec2A_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- Rectangle rec3A_1 = new Rectangle(p21A_1.X + 3, p21A_1.Y + TopAdd, ColumnWidthSplit2, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(OrderCountDb), 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(item.Value.ToString().Trim().Replace(" ", ""), "消费次数", rec3A_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
- string StrPercentage = "";
- if (OrderCountDb > 0)
- { StrPercentage = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((OrderCount - OrderCountDb) / OrderCountDb * 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 业绩
- decimal SeriesAmount = 0;
- decimal SeriesAmountDb = 0;
- if (dtRowCount.Length > 0)
- {
- if (!string.IsNullOrEmpty(dtRowCount[0]["SeriesAmount"].ToString().Trim()))
- { SeriesAmount = Convert.ToDecimal(dtRowCount[0]["SeriesAmount"]); }
- }
- if (dtRowCountDb.Length > 0)
- {
- if (!string.IsNullOrEmpty(dtRowCountDb[0]["SeriesAmount"].ToString().Trim()))
- { SeriesAmountDb = Convert.ToDecimal(dtRowCountDb[0]["SeriesAmount"]); }
- }
- TotalSeriesAmount += SeriesAmount;
- TotalSeriesAmountDb += SeriesAmountDb;
- StrViewText += SeriesAmount + "|";
- StrViewTextDb += SeriesAmountDb + "|";
- Rectangle rec1B_1 = new Rectangle(p41A_1.X + 3, p41A_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmount), 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(item.Value.ToString().Trim().Replace(" ", ""), "业绩", rec1B_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- Rectangle rec2B_1 = new Rectangle(p11B_1.X + 3, p11B_1.Y + TopAdd, ColumnWidthSplit3, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(SeriesAmountDb), 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(item.Value.ToString().Trim().Replace(" ", ""), "业绩", rec2B_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
- string StrPercentage2 = "";
- if (SeriesAmountDb > 0)
- { StrPercentage2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((SeriesAmount - SeriesAmountDb) / SeriesAmountDb * 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 (OrderCount > 0)
- { AverageValue = Convert.ToDecimal((SeriesAmount / OrderCount).ToString("0.00")); }
- if (OrderCountDb > 0)
- { AverageValueDb = Convert.ToDecimal((SeriesAmountDb / OrderCountDb).ToString("0.00")); }
- 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(AverageValue), 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);
- SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "均价", rec4B_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- Rectangle rec1C_1 = new Rectangle(p41B_1.X + 3, p41B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(AverageValueDb), 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);
- SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "均价", rec1C_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
- 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);
- Point p21C_1 = new Point(p11C_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1A.Y);
- Point p21C_2 = new Point(p11C_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21C_1, p21C_2);
- #endregion
- #region 实收
- decimal PaidAmount = 0;
- decimal PaidAmountDb = 0;
- if (dtRowCount.Length > 0)
- {
- if (!string.IsNullOrEmpty(dtRowCount[0]["PaidAmount"].ToString().Trim()))
- { PaidAmount = Convert.ToDecimal(dtRowCount[0]["PaidAmount"]); }
- }
- if (dtRowCountDb.Length > 0)
- {
- if (!string.IsNullOrEmpty(dtRowCountDb[0]["PaidAmount"].ToString().Trim()))
- { PaidAmountDb = Convert.ToDecimal(dtRowCountDb[0]["PaidAmount"]); }
- }
- TotalPaidAmount += PaidAmount;
- TotalPaidAmountDb += PaidAmountDb;
- StrViewText += PaidAmount + "|";
- StrViewTextDb += PaidAmountDb + "|";
- Rectangle rec3C_1 = new Rectangle(p21C_1.X + 3, p21C_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(PaidAmount), ft11, b, rec3C_1);
- Point p31C_1 = new Point(p21C_1.X + ColumnWidthSplit4, rec1A.Y);
- Point p31C_2 = new Point(p21C_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31C_1, p31C_2);
- SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "实收", rec3C_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- Rectangle rec4C_1 = new Rectangle(p31C_1.X + 3, p31C_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(PaidAmountDb), ft11, b, rec4C_1);
- Point p41C_1 = new Point(p31C_1.X + ColumnWidthSplit4, rec1A.Y);
- Point p41C_2 = new Point(p31C_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p41C_1, p41C_2);
- SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "实收", rec4C_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
- string StrPercentage4 = "";
- if (PaidAmountDb > 0)
- { StrPercentage4 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((PaidAmount - PaidAmountDb) / PaidAmountDb * 100).ToString("0.00")) + "%"; }
- Rectangle rec1D_1 = new Rectangle(p41C_1.X + 3, p41C_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit5 * 2, RowHeight);
- g.DrawString(StrPercentage4, ft11, b, rec1D_1);
- Point p11D_1 = new Point(p41C_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1A.Y);
- Point p11D_2 = new Point(p41C_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11D_1, p11D_2);
- #endregion
- #region 余款
- decimal ArrearsAmount = SeriesAmount - PaidAmount;
- decimal ArrearsAmountDb = SeriesAmountDb - PaidAmountDb;
- TotalArrearsAmount += ArrearsAmount;
- TotalArrearsAmountDb += ArrearsAmountDb;
- StrViewText += ArrearsAmount + "|";
- StrViewTextDb += ArrearsAmountDb + "|";
- Rectangle rec2D_1 = new Rectangle(p11D_1.X + 3, p11D_1.Y + TopAdd, ColumnWidthSplit6, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmount), ft11, b, rec2D_1);
- Point p21D_1 = new Point(p11D_1.X + ColumnWidthSplit6, rec1A.Y);
- Point p21D_2 = new Point(p11D_1.X + ColumnWidthSplit6, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21D_1, p21D_2);
- SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "余款", rec2D_1, StrTimeStrat, StrTimeEnd, this.cmbtreevStoreName);
- Rectangle rec3D_1 = new Rectangle(p21D_1.X + 3, p21D_1.Y + TopAdd, ColumnWidth6 - ColumnWidthSplit6 * 2, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(ArrearsAmountDb), ft11, b, rec3D_1);
- Point p31D_1 = new Point(p21D_1.X + ColumnWidthSplit6, rec1A.Y);
- Point p31D_2 = new Point(p21D_1.X + ColumnWidthSplit6, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31D_1, p31D_2);
- SetPostionData(item.Value.ToString().Trim().Replace(" ", ""), "余款", rec3D_1, StrTimeStratDb, StrTimeEndDb, this.cmbtreevStoreName);
- string StrPercentage5 = "";
- if (ArrearsAmountDb > 0)
- { StrPercentage5 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((ArrearsAmount - ArrearsAmountDb) / ArrearsAmountDb * 100).ToString("0.00")) + "%"; }
- Rectangle rec4D_1 = new Rectangle(p31D_1.X + 3, p31D_1.Y + TopAdd, ColumnWidth6 - ColumnWidthSplit6 * 2, RowHeight);
- g.DrawString(StrPercentage5, ft11, b, rec4D_1);
- #endregion
- forCount++;
- #endregion
- htDataView[item.Value.ToString().Trim()] = StrViewText.TrimEnd('|');
- htDataViewDb[item.Value.ToString().Trim()] = StrViewTextDb.TrimEnd('|');
- }
- if (htData.Count > 1)
- {
- this.panelEx3.Visible = true;
- this.panelEx2.Dock = DockStyle.Top;
- #region 总结
- Rectangle rec1A = new Rectangle(LeftWidth, ForTopLoad + RowHeight * htData.Count, TableWidth, RowHeight);
- g.DrawRectangle(p, rec1A);//画标题矩形
- Rectangle rec1AColor1 = new Rectangle(rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1);
- if ((htData.Count % 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("总" + StrTypeTextNull + "计", 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(((TotalOrderCount - TotalOrderCountDb) / 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(((TotalSeriesAmount - TotalSeriesAmountDb) / 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 = TotalSeriesAmount / Convert.ToInt32(TotalOrderCount); }
- Rectangle rec4B_1 = new Rectangle(p31B_1.X + 3, p31B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(strValueA.ToString("0.00")), 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 = TotalSeriesAmountDb / Convert.ToInt32(TotalOrderCountDb); }
- Rectangle rec1C_1 = new Rectangle(p41B_1.X + 3, p41B_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(strValueB.ToString("0.00")), 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);
- Point p21C_1 = new Point(p11C_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1A.Y);
- Point p21C_2 = new Point(p11C_1.X + (ColumnWidth4 - ColumnWidthSplit4 * 2), rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21C_1, p21C_2);
- #endregion
- #region 实收
- Rectangle rec3C_1 = new Rectangle(p21C_1.X + 3, p21C_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalPaidAmount), ft11, b, rec3C_1);
- Point p31C_1 = new Point(p21C_1.X + ColumnWidthSplit4, rec1A.Y);
- Point p31C_2 = new Point(p21C_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31C_1, p31C_2);
- Rectangle rec4C_1 = new Rectangle(p31C_1.X + 3, p31C_1.Y + TopAdd, ColumnWidthSplit4, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalPaidAmountDb), ft11, b, rec4C_1);
- Point p41C_1 = new Point(p31C_1.X + ColumnWidthSplit4, rec1A.Y);
- Point p41C_2 = new Point(p31C_1.X + ColumnWidthSplit4, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p41C_1, p41C_2);
- string StrPercentage4 = "";
- if (TotalPaidAmountDb > 0)
- { StrPercentage4 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((TotalPaidAmount - TotalPaidAmountDb) / TotalPaidAmountDb * 100).ToString("0.00")) + "%"; }
- Rectangle rec1D_1 = new Rectangle(p41C_1.X + 3, p41C_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit5 * 2, RowHeight);
- g.DrawString(StrPercentage4, ft11, b, rec1D_1);
- Point p11D_1 = new Point(p41C_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1A.Y);
- Point p11D_2 = new Point(p41C_1.X + (ColumnWidth5 - ColumnWidthSplit5 * 2), rec1A.Y + rec1A.Height);
- g.DrawLine(p, p11D_1, p11D_2);
- #endregion
- #region 余款
- Rectangle rec2D_1 = new Rectangle(p11D_1.X + 3, p11D_1.Y + TopAdd, ColumnWidthSplit6, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmount), ft11, b, rec2D_1);
- Point p21D_1 = new Point(p11D_1.X + ColumnWidthSplit6, rec1A.Y);
- Point p21D_2 = new Point(p11D_1.X + ColumnWidthSplit6, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p21D_1, p21D_2);
- Rectangle rec3D_1 = new Rectangle(p21D_1.X + 3, p21D_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit6 * 2, RowHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(TotalArrearsAmountDb), ft11, b, rec3D_1);
- Point p31D_1 = new Point(p21D_1.X + ColumnWidthSplit6, rec1A.Y);
- Point p31D_2 = new Point(p21D_1.X + ColumnWidthSplit6, rec1A.Y + rec1A.Height);
- g.DrawLine(p, p31D_1, p31D_2);
- string StrPercentage5 = "";
- if (TotalArrearsAmountDb > 0)
- { StrPercentage5 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(((TotalArrearsAmount - TotalArrearsAmountDb) / TotalArrearsAmountDb * 100).ToString("0.00")) + "%"; }
- Rectangle rec4D_1 = new Rectangle(p31D_1.X + 3, p31D_1.Y + TopAdd, ColumnWidth5 - ColumnWidthSplit6 * 2, RowHeight);
- g.DrawString(StrPercentage5, ft11, b, rec4D_1);
- #endregion
- #endregion
- }
- else
- {
- this.panelEx3.Visible = false;
- this.panelEx2.Dock = DockStyle.Fill;
- }
- #endregion
- }
- this.PictImage.Image = newBmp;
- this.PublicFunctionView();
- }
- void SetPostionData(string ordType,string columType, Rectangle rectangle, string startTime,string endTime,LYFZ.ComponentLibrary.ComboBoxTreeViewEx divideShopCode)
- {
- ModelImagePostionAction actionModel=null;
- string SqlSelect = "";
- string sqlWhere = "";
- switch(ordType)
- {
- case "订单":
- SqlSelect += @" with t AS
- (
- select Pay_OrdNumber,sum(Pay_AmountOf) AS Pay_AmountOf,Sc_ClassName from tb_ErpPayment inner join tb_ErpSystemCategory on Sc_ClassCode=Pay_PaymentMethod where Pay_Type = 0 And Pay_Category in ('全款','预约收款','预约补款') Group By Pay_OrdNumber ,Sc_ClassName
- ) ";
- SqlSelect += @" select '订单' AS 类型,Sc_ClassName as 付款方式,Cus_Name as '客户名称',Cus_Telephone as '联系电话',Ord_SeriesName as '套系名称',
- (tb_ErpOrder.Ord_Number) AS 订单号,
- sum(isnull(Ord_SeriesPrice,0)) AS 业绩,
- sum(isnull(Pay_AmountOf,0)) AS 实收 ,
- ( sum(isnull(Ord_SeriesPrice,0)) - sum(isnull(Pay_AmountOf,0)) ) as 余款
- from tb_ErpOrder inner join tempTB_AggregationCustomer on GP_OrderNumber=Ord_Number Left Join t on Pay_OrdNumber = Ord_Number
- ";
- sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_SaveOrderDateTime", startTime, endTime, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop") ;
- sqlWhere += " group by Ord_Number,t.Sc_ClassName,Cus_Name,Cus_Telephone,Ord_SeriesName";
- break;
- case "选片":
- SqlSelect += @" select
- '选片' AS 类型,
- Cus_Name as '客户名称',Cus_Telephone as '联系电话',Ord_SeriesName as '套系名称',
- Ordv_Number as 订单号,Sc_ClassName as 付款方式,
- (select sum(isnull(Plu_Amount,0)) from tb_ErpPlusPickItems where Plu_OrdNumber = Ordv_Number And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ') as 业绩,
- isnull( Pay_AmountOf,0) as 实收,
- 0 as 余款
- from tb_ErpOrderDigital inner join
- tb_ErpPlusPickItems on Plu_OrdNumber = Ordv_Number Left Join
- tb_ErpPayment on
- Plu_Number = Pay_PlusPickNumber left join tb_ErpSystemCategory on Sc_ClassCode=Pay_PaymentMethod
- inner join tempTB_AggregationCustomer on GP_OrderNumber=Ordv_Number
- inner join tb_ErpOrder on Ord_Number = Ordv_Number
- ";
- sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_FilmSelectionTime", startTime, endTime, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "plu_dividedshop") + " And Plu_TwoPinsCategory = 'BEBCABBAAHFCJBJGJ' ";
- sqlWhere += " group by Ordv_Number,Sc_ClassName,Cus_Name,Cus_Telephone,Ord_SeriesName,Pay_AmountOf";
- break;
- case "散客消费":
- SqlSelect += @" select
- '散客消费' AS 类型,
- Cus_Name as '客户名称', Cus_Telephone as '联系电话',Ord_SeriesName as '套系名称',
- (tb_ErpTwoSalesOrder.Tsorder_Number) AS 订单号,
- isnull(Sum(Tsorder_Money),0) AS 业绩,
- isnull(Sum(Pay_AmountOf),0) AS 实收 ,
- (sum(isnull(Tsorder_Money,0)) - sum(isnull(Pay_AmountOf,0)) ) as 余款
- from tb_ErpTwoSalesOrder Left Join tb_ErpPayment on Pay_OrdNumber = Tsorder_Number And Pay_Type = 1 left join tb_ErpSystemCategory on Sc_ClassCode=Pay_PaymentMethod
- left join tempTB_AggregationCustomer on GP_OrderNumber=Tsorder_Number
- left join tb_ErpOrder on Ord_Number = Tsorder_Number
- ";
- sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Tsorder_CreateDatetime", startTime, endTime, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "tsorder_dividedshop");
- sqlWhere += " group by Tsorder_Number,Sc_ClassName,Cus_Name,Cus_Telephone,Ord_SeriesName";
- break;
- case "礼服租售":
- SqlSelect += @"select
- '礼服租售' AS 类型,
-
- (Dsro_Number) AS 订单号,
- isnull(Sum(Dsro_Amount),0) AS 业绩,
- isnull(Sum(Pay_AmountOf),0) AS 实收 ,
- (sum(isnull(Dsro_Amount,0)) - sum(isnull(Pay_AmountOf,0)) ) as 余款
- from tb_ErpDressSaleRentalOrder Left Join tb_ErpPayment on Pay_OrdNumber = Dsro_Number And Pay_Type = 2 left join tb_ErpSystemCategory on Sc_ClassCode=Pay_PaymentMethod
-
- ";
- sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Dsro_CreateDateTime", startTime, endTime, ConnectWord: "") +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "dsro_dividedshop");
- sqlWhere += " group by Dsro_Number,Sc_ClassName";
- break;
- }
- switch (columType)
- {
- case "消费次数":
- actionModel = new ModelImagePostionAction()
- {
- OrdType=ordType,
- ColumType= columType,
- MouseX = rectangle.X,
- MouseY = rectangle.Y,
- MouseWidth = rectangle.Width,
- MouseHeight = rectangle.Height,
- SqlData = SqlSelect + " where " + sqlWhere
- };
- break;
- case "业绩":
- actionModel = new ModelImagePostionAction()
- {
- OrdType = ordType,
- ColumType = columType,
- MouseX = rectangle.X,
- MouseY = rectangle.Y,
- MouseWidth = rectangle.Width,
- MouseHeight = rectangle.Height,
- SqlData = SqlSelect + " where " + sqlWhere
- };
- break;
- case "均价":
- actionModel = new ModelImagePostionAction()
- {
- OrdType = ordType,
- ColumType = columType,
- MouseX = rectangle.X,
- MouseY = rectangle.Y,
- MouseWidth = rectangle.Width,
- MouseHeight = rectangle.Height,
- SqlData = SqlSelect + " where " + sqlWhere
- };
- break;
- case "实收":
- actionModel = new ModelImagePostionAction()
- {
- OrdType = ordType,
- ColumType = columType,
- MouseX = rectangle.X,
- MouseY = rectangle.Y,
- MouseWidth = rectangle.Width,
- MouseHeight = rectangle.Height,
- SqlData = SqlSelect + " where " + sqlWhere
- };
- break;
- case "余款":
- actionModel = new ModelImagePostionAction()
- {
- OrdType = ordType,
- ColumType = columType,
- MouseX = rectangle.X,
- MouseY = rectangle.Y,
- MouseWidth = rectangle.Width,
- MouseHeight = rectangle.Height,
- SqlData = SqlSelect + " where " + sqlWhere
- };
- break;
- }
- actionModel.OrdTitle = this.UcNavigationTool.LabTitle;
- if (actionModel != null)
- {
- actionList.Add(actionModel);
- }
-
- }
- /// <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")
- {
- this.chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;
- #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")
- {
- this.chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
- #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 = true;
- 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()+ ":" + StrValue;
- 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")
- {
- this.chart2.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;
- #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")
- {
- this.chart2.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
- #region 饼形图
- string StrTitlesDb = this.dtDataTimeStartCompared.DateValue.Trim() + " — " + this.dtDateTimeEndCompared.DateValue.Trim() + " 图表";
- this.chart2.Titles.Add(StrTitlesDb);
- this.chart2.Legends["Legend1"].Enabled = true;
- 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()+ ":" + StrValue;
- xData.Add(item.Key.ToString().Trim() + ":" + StrValue);
- yData.Add(Convert.ToDouble(StrValue));
- forCount++;
- }
- }
- this.chart2.Series[0].Points.DataBindXY(xData, yData);
- #endregion
- }
- #endregion
- }
- }
- }
- }
- }
|