123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.DecisionAssistant
- {
- public partial class AnalyzedOrderSourceReferralFormMain : LYFZ.Software.UI.DecisionAssistant.AnalyzedOrderSourceReferralFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- public AnalyzedOrderSourceReferralFormMain()
- {
- this.Load += AnalyzedOrderSourceFormMain_Load;
- this.Shown += AnalyzedOrderSourceFormMain_Shown;
- this.txtQuery.KeyDown += txtQuery_KeyDown;
- this.btnQuery.Click += btnQuery_Click;
- this.btnQuery2.Click += btnQuery2_Click;
- this.listViewData.MouseDoubleClick += listViewData_MouseDoubleClick;
- this.Resize += AnalyzedOrderSourceFormMain_Resize;
- this.PictImage.Click += PictImage_Click;
- this.PictImage.MouseDoubleClick += PictImage_MouseDoubleClick;
- this.listViewData.ColumnClick += listViewData_ColumnClick;
- this.btn_export2xls.Click += Btn_export2xls_Click;
- }
- /// <summary>
- /// 导出到xls文件中;
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Btn_export2xls_Click( object sender, EventArgs e )
- {
- this.listViewData.ListViewToDataTable( "转介绍分析.xls" );
- }
- /// <summary>
- /// 用于排序的类
- /// </summary>
- LYFZ.ComponentLibrary.ListViewColumnSorter lvwColumnSorter;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderSourceFormMain_Load( object sender, EventArgs e )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrGroupKeyCode: "stA10", StrKeyCode: "stA18", IsShowAllText: false );
- this.listViewData.View = View.Details;
- this.listViewData.GridLines = true;
- ImageList imgList = new ImageList();
- imgList.ImageSize = new Size( 1, 25 );
- this.listViewData.SmallImageList = imgList;
- string[] StrColumns = "客户姓名,客户电话,介绍次数,成交次数,成交率,成交金额,".Split( ',' );
- for ( int i = 0; i < StrColumns.Length; i++ )
- {
- ColumnHeader ch = new ColumnHeader();
- ch.Text = StrColumns[i].Trim();
- switch ( StrColumns[i].Trim() )
- {
- case "": ch.Width = this.listViewData.Width / 4; break;
- default: ch.Width = (((this.listViewData.Width / 4) * 3) - 23) / 6; break;
- }
- switch ( StrColumns[i].Trim() )
- {
- case "成交金额": ch.TextAlign = HorizontalAlignment.Right; break;
- default: ch.TextAlign = HorizontalAlignment.Center; break;
- }
- this.listViewData.Columns.Add( ch );
- }
- this.lvwColumnSorter = new ComponentLibrary.ListViewColumnSorter();
- this.listViewData.ListViewItemSorter = this.lvwColumnSorter;
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderSourceFormMain_Shown( object sender, EventArgs e )
- {
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion( VersionControl.VersionFunctionEnum.决策助手转介绍分析 );
- if ( !b )
- {
- this.Close();
- return;
- }
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 回车查询事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtQuery_KeyDown( object sender, KeyEventArgs e )
- {
- if ( e.KeyCode == Keys.Enter )
- {
- this.btnQuery_Click( this, null );
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click( object sender, EventArgs e )
- {
- this.PublicFunctionView();
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery2_Click( object sender, EventArgs e )
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 列表双击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_MouseDoubleClick( object sender, MouseEventArgs e )
- {
- if ( this.listViewData.Items.Count > 0 )
- {
- if ( this.listViewData.SelectedItems.Count > 0 )
- {
- LYFZ.Software.MainBusiness.DecisionAssistant.SetSmallForm.AnalyzedOrderSourceReferralDetailSmallForm frm = new SetSmallForm.AnalyzedOrderSourceReferralDetailSmallForm();
- frm.StrClientNumber = this.listViewData.SelectedItems[0].Tag.ToString().Trim();
- frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- frm.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
- frm.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
- frm.Show();
- }
- }
- }
- /// <summary>
- /// 窗体大小发生变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderSourceFormMain_Resize( object sender, EventArgs e )
- {
- for ( int i = 0; i < this.listViewData.Columns.Count; i++ )
- {
- switch ( this.listViewData.Columns[i].Text.Trim() )
- {
- case "": this.listViewData.Columns[i].Width = this.listViewData.Width / 4; break;
- default: this.listViewData.Columns[i].Width = (((this.listViewData.Width / 4) * 3) - 23) / 6; break;
- }
- }
- }
- bool IsImageMouseDoubleClick = false;
- bool IsCanDoubleClick = false;
- /// <summary>
- /// 点击图片时,图片获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void PictImage_Click( object sender, EventArgs e )
- {
- this.PictImage.Focus();
- }
- /// <summary>
- /// 图片双击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void PictImage_MouseDoubleClick( object sender, MouseEventArgs e )
- {
- if ( IsCanDoubleClick )
- {
- if ( !this.IsImageMouseDoubleClick )
- {
- this.IsImageMouseDoubleClick = true;
- this.panelEx3.Visible = false;
- this.panelEx2.Height = this.panelEx1.Height - 6;
- }
- else
- {
- this.panelEx2.Height = 330;
- this.IsImageMouseDoubleClick = false;
- this.panelEx3.Visible = true;
- }
- }
- }
- /// <summary>
- /// 点击排序
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_ColumnClick( object sender, ColumnClickEventArgs e )
- {
- if ( !string.IsNullOrEmpty( this.listViewData.Columns[e.Column].Text.Trim() ) )
- {
- // 检查点击的列是不是现在的排序列.
- if ( e.Column == lvwColumnSorter.SortColumn )
- {
- // 重新设置此列的排序方法.
- if ( lvwColumnSorter.Order == SortOrder.Ascending )
- {
- lvwColumnSorter.Order = SortOrder.Descending;
- }
- else
- {
- lvwColumnSorter.Order = SortOrder.Ascending;
- }
- }
- else
- {
- // 设置排序列,默认为正向排序
- lvwColumnSorter.SortColumn = e.Column;
- lvwColumnSorter.Order = SortOrder.Ascending;
- }
- // 用新的排序方法对ListView排序
- this.listViewData.Sort();
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows( this.listViewData );
- }
- }
- /// <summary>
- /// 创建行
- /// </summary>
- private void PublicFunctionRows()
- {
- string strWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
- string ExecuteSql = "select Count(ID) AS CountID from tb_ErpOrder where 1 = 1 " + strWhere + "; " +
- "select Count(tb_ErpCustomerGroup.ID) AS CountID from tb_ErpCustomerGroup Left Join tb_ErpOrder on Ord_Number = GP_OrderNumber Where GP_OrderNumber != '' And GP_IntroducerCustomerID != '' " + strWhere + "; " +
- "select Count(tb_ErpCustomerGroup.ID) AS CountID from tb_ErpCustomerGroup Left Join tb_ErpOrder on Ord_Number = GP_OrderNumber Where GP_OrderNumber != '' And GP_IntroducerCustomerID != '' And (GP_CustomerStatus = '正常' or GP_CustomerStatus = '追回')" + strWhere + "";
- DataSet dsData = orbll.GetView_Custom( ExecuteSql );
- DataTable dtCount = dsData.Tables["ds"];
- DataTable dtReferralCount = dsData.Tables["ds1"];
- DataTable dtSucceedCount = dsData.Tables["ds2"];
- #region 创建画布
- Bitmap newBmp = new Bitmap( this.PictImage.Width, this.PictImage.Height );
- 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 );
- Font ft15 = new Font( "微软雅黑", 15 );
- int TopAdd = 7;
- int LeftWidth = 30;
- int TableWidth = newBmp.Width - LeftWidth * 2;
- int ColumnWidth1 = TableWidth / 5;
- int ColumnWidth2 = TableWidth / 5;
- int ColumnWidth3 = TableWidth / 5;
- int ColumnWidth4 = TableWidth / 5;
- int ColumnWidth5 = TableWidth / 5;
- int RowHeight = 240 / 7;
- #endregion
- string StrValue = "老客户转介绍统计表";
- SizeF sizef = g.MeasureString( StrValue, ft15 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec = new Rectangle( TableWidth / 2 - FtWidth / 2, 10, FtWidth, Convert.ToInt32( sizef.Height ) );
- g.DrawString( StrValue, ft15, b, rec );//画消费法规
- #region 标题
- Rectangle rec1 = new Rectangle( LeftWidth, rec.Y + rec.Height, 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 + ColumnWidth1 / 2 - 30, 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 );
- #endregion
- #region 内容
- decimal CountID = 0;
- decimal ReferralCountID = 0;
- decimal SucceedCountID = 0;
- if ( dtCount.Rows.Count > 0 )
- {
- CountID = Convert.ToDecimal( dtCount.Rows[0]["CountID"] );
- }
- if ( dtReferralCount.Rows.Count > 0 )
- {
- ReferralCountID = Convert.ToDecimal( dtReferralCount.Rows[0]["CountID"] );
- }
- if ( dtSucceedCount.Rows.Count > 0 )
- {
- SucceedCountID = Convert.ToDecimal( dtSucceedCount.Rows[0]["CountID"] );
- }
- Rectangle rec1A = new Rectangle( LeftWidth, rec1.Y + rec1.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec1A );//画标题矩形
- Rectangle rec1AColor1 = new Rectangle( rec1A.X + 1, rec1A.Y + 1, rec1A.Width - 1, rec1A.Height - 1 );
- g.FillRectangle( LYFZ.Software.MainBusiness.DoorCityProcess.PublicGraphics.brSingle, rec1AColor1 );
- //订单数
- sizef = g.MeasureString( LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( CountID ), ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1A_1 = new Rectangle( rec1A.X + (ColumnWidth1 - FtWidth) / 2, rec1A.Y + TopAdd, ColumnWidth1, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( CountID ).ToString().Trim(), ft11, 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 );
- //转介绍客户数
- sizef = g.MeasureString( LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( ReferralCountID ), ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2A_1 = new Rectangle( p11A_1.X + (ColumnWidth2 - FtWidth) / 2, p11A_1.Y + TopAdd, ColumnWidth2, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( ReferralCountID ), 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 );
- //转介绍率
- string strValue = "0";
- if ( CountID > 0 )
- {
- strValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( (ReferralCountID / CountID * 100).ToString( "0.00" ) );
- }
- sizef = g.MeasureString( strValue, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3A_1 = new Rectangle( p21A_1.X + (ColumnWidth3 - FtWidth) / 2, p21A_1.Y + TopAdd, ColumnWidth3, RowHeight );
- g.DrawString( strValue.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 );
- //转介绍成交数
- sizef = g.MeasureString( LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( SucceedCountID ), ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec4A_1 = new Rectangle( p31A_1.X + (ColumnWidth4 - FtWidth) / 2, p31A_1.Y + TopAdd, ColumnWidth4, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( SucceedCountID ), 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 );
- //成交率
- string strValue1 = "0";
- if ( ReferralCountID > 0 )
- {
- strValue1 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( (ReferralCountID / CountID * 100).ToString( "0.00" ) );
- }
- sizef = g.MeasureString( strValue1, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5A_1 = new Rectangle( p41A_1.X + (ColumnWidth5 - FtWidth) / 2, p41A_1.Y + TopAdd, ColumnWidth5, RowHeight );
- g.DrawString( strValue1.Trim() + "%", ft11, b, rec5A_1 );
- #endregion
- this.PictImage.Image = newBmp;
- this.PublicFunctionView();
- }
- /// <summary>
- /// 创建图表
- /// </summary>
- private void PublicFunctionView()
- {
- this.listViewData.Items.Clear();
- string StrWhereA = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
- string StrWhere = "";
- string StrQueryText = this.txtQuery.Text.Trim();
- if ( !string.IsNullOrEmpty( StrQueryText ) )
- {
- StrWhere = "And (Cus_Name like '%" + StrQueryText + "%' or Cus_NamePinyin like '%" + StrQueryText + "%' or Cus_Telephone like '%" + StrQueryText + "%')";
- }
- string ExecuteSql = "with t AS " +
- "(" +
- "select " + " ROW_NUMBER() OVER (ORDER BY ID ASC) AS tempID, " +
- "Cus_CustomerNumber," +
- "Cus_Name,Cus_Telephone," +
- "(select Count(tb_ErpCustomerGroup.ID) AS CountID from tb_ErpCustomerGroup Left Join tb_ErpOrder on Ord_Number = GP_OrderNumber Where GP_IntroducerCustomerID != '' And GP_IntroducerCustomerID = Cus_CustomerNumber " + StrWhereA + ") AS CountID," +
- "(select Count(tb_ErpCustomerGroup.ID) AS CountID from tb_ErpCustomerGroup Left Join tb_ErpOrder on Ord_Number = GP_OrderNumber Where GP_IntroducerCustomerID != '' And GP_IntroducerCustomerID = Cus_CustomerNumber And (GP_CustomerStatus = '正常' or GP_CustomerStatus = '追回')" + StrWhereA + ") AS SucceedCount," +
- "(select isnull(Sum(Ord_SeriesPrice),0) AS SumAmount from tb_ErpCustomerGroup Left Join tb_ErpOrder on Ord_Number = GP_OrderNumber Where GP_IntroducerCustomerID != '' And GP_IntroducerCustomerID = Cus_CustomerNumber And (GP_CustomerStatus = '正常' or GP_CustomerStatus = '追回') " + StrWhereA + ") AS SumAmount " +
- "from tb_ErpCustomer Where Cus_Type != '儿童' " + StrWhere + " " +
- ")" +
- "select * from t where CountID > 0";
- DataSet dsData = new DataSet();
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
- {
- dsData = orbll.GetView_Custom( ExecuteSql );
- } );
- DataTable tbl = dsData.Tables["ds"];
- for ( int i = 0; i < tbl.Rows.Count; i++ )
- {
- ListViewItem lvItem = new ListViewItem();
- lvItem.Tag = tbl.Rows[i]["Cus_CustomerNumber"].ToString().Trim();
- lvItem.Text = tbl.Rows[i]["Cus_Name"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "客户电话";
- ListSubItem.Text = tbl.Rows[i]["Cus_Telephone"].ToString().Trim();
- lvItem.SubItems.Add( ListSubItem );
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "介绍次数";
- ListSubItem.Text = tbl.Rows[i]["CountID"].ToString().Trim();
- lvItem.SubItems.Add( ListSubItem );
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "成交次数";
- ListSubItem.Text = tbl.Rows[i]["SucceedCount"].ToString().Trim();
- lvItem.SubItems.Add( ListSubItem );
- string StrValue = "0";
- if ( Convert.ToDecimal( tbl.Rows[i]["CountID"] ) > 0 )
- {
- StrValue = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( (Convert.ToDecimal( tbl.Rows[i]["SucceedCount"] ) / Convert.ToDecimal( tbl.Rows[i]["CountID"] ) * 100).ToString( "0.00" ) );
- }
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "成交率";
- ListSubItem.Text = StrValue + "%";
- lvItem.SubItems.Add( ListSubItem );
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "成交金额";
- ListSubItem.Text = tbl.Rows[i]["SumAmount"].ToString().Trim();
- lvItem.SubItems.Add( ListSubItem );
- if ( (this.listViewData.Items.Count % 2) > 0 )
- {
- lvItem.BackColor = System.Drawing.Color.PapayaWhip;
- }
- else
- {
- lvItem.BackColor = System.Drawing.Color.PowderBlue;
- }
- this.listViewData.Items.Add( lvItem );
- }
- }
- }
- }
|