123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488 |
- 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;
- namespace LYFZ.Software.MainBusiness.DecisionAssistant
- {
- public partial class AnalyzedOrderStoreOutlayDetailFormMain : LYFZ.Software.UI.DecisionAssistant.AnalyzedOrderStoreOutlayDetailFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- List<ModelImagePostionAction> actionList = new List<ModelImagePostionAction>();
- public AnalyzedOrderStoreOutlayDetailFormMain()
- {
- this.Load += AnalyzedOrderFinanceOutlayDetailFormMain_Load;
- this.Shown += AnalyzedOrderFinanceOutlayDetailFormMain_Shown;
- this.chkComparedStartUp.Click += chkComparedStartUp_Click;
- this.btnQuery.Click += btnQuery_Click;
- this.btnQueryCompared.Click += btnQueryCompared_Click;
- this.btnSaveAs.Click += btnSaveAs_Click;
- this.btnCloseed.Click += btnCloseed_Click;
- this.dtDataTimeStart.Leave += dtDataTimeStart_Leave;
- this.dtDataTimeStartCompared.Leave += dtDataTimeStartCompared_Leave;
- this.Resize += AnalyzedOrderFinanceOutlayDetailFormMain_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("内容!");
- }
- }
- void SetPostionData(string ordType, string columType, Rectangle rectangle, string where, string startTime, string endTime)
- {
- ModelImagePostionAction actionModel = null;
- string SqlSelect = @"
- select
- oiae_type as 类型,oiae_projectname as 支出内容,oiae_money 支出金额,tb_erpUser.User_Name 取款人,Oiae_IEDatetime as 创建时间
- from
- tb_ErpOtherIncomeAndExpenses left join tb_erpUser on Oiae_ThePayer = tb_erpUser.User_EmployeeID";
- //string SqlSelect = @"";
- string sqlWhere = " Oiae_Type = '支出' " +
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Oiae_IEDatetime", startTime, endTime);
- if (string.IsNullOrEmpty(StrGoFormDateTime))
- {
- sqlWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Oiae_DividedShop");
- }
- else
- {
- sqlWhere += " And Oiae_DividedShop = '" + this.StrStoreName + "'";
- }
- sqlWhere += " and oiae_projectname = '" + columType + "' ";
- actionModel = new ModelImagePostionAction()
- {
- OrdType = ordType,
- ColumType = columType,
- MouseX = rectangle.X,
- MouseY = rectangle.Y,
- MouseWidth = rectangle.Width,
- MouseHeight = rectangle.Height,
- SqlData = SqlSelect + " where " + sqlWhere
- };
- actionModel.OrdTitle = this.UcNavigationTool.LabTitle;
- if (actionModel != null)
- {
- actionList.Add(actionModel);
- }
- }
- /// <summary>
- /// 跳转过来的日期
- /// </summary>
- public string StrGoFormDateTime = "";
- /// <summary>
- /// 跳转过来分店编号
- /// </summary>
- public string StrStoreName = "";
- /// <summary>
- /// 是否首次加载
- /// </summary>
- bool IsFristLoad = true;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AnalyzedOrderFinanceOutlayDetailFormMain_Load(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(StrGoFormDateTime))
- {
- this.panelQueryCompared.Visible = false;
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "stA10", StrKeyCode: "stA23", 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");
- }
- else
- {
- this.panelStoreName.Visible = false;
- string[] StrArray = StrGoFormDateTime.Split('|');
- this.dtDataTimeStart.DateValue = StrArray[0].Trim() + "-01";
- this.dtDataTimeEnd.DateValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
- if (StrArray.Length > 1)
- {
- this.dtDataTimeStartCompared.DateValue = StrArray[1].Trim() + "-01";
- this.dtDateTimeEndCompared.DateValue = Convert.ToDateTime(this.dtDataTimeStartCompared.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
- this.panelEx3.Visible = true;
- this.panelQueryCompared.Visible = true;
- this.chkComparedStartUp.Checked = true;
- }
- else
- {
- this.dtDataTimeStartCompared.DateValue = Convert.ToDateTime(this.dtDataTimeStart.DateValue).AddYears(-1).ToString("yyyy-MM-dd");
- 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 AnalyzedOrderFinanceOutlayDetailFormMain_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 chkComparedStartUp_Click(object sender, EventArgs e)
- {
- if (this.chkComparedStartUp.Checked)
- {
- this.panelQueryCompared.Visible = true;
- this.panelEx3.Visible = true;
- if (!string.IsNullOrEmpty(this.dtDataTimeStartCompared.DateValue.Trim()) && !string.IsNullOrEmpty(this.dtDateTimeEndCompared.DateValue.Trim()))
- { this.PublicFunctionRows(); }
- }
- else
- {
- this.panelQueryCompared.Visible = false;
- this.panelEx3.Visible = false;
- this.PublicFunctionRows();
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 对比查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQueryCompared_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 另存为
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSaveAs_Click(object sender, EventArgs e)
- {
- string StrFilleName = Convert.ToDateTime(this.dtDataTimeStart.DateValue).ToString("yyyy年MM月dd日") + " — " + Convert.ToDateTime(this.dtDataTimeEnd.DateValue).ToString("yyyy年MM月dd日") + " 店面支出详情分析表";
- if (this.chkComparedStartUp.Checked)
- { StrFilleName = this.dtDataTimeStart.DateValue.Trim() + "—" + this.dtDataTimeEnd.DateValue.Trim() + " 与 " + this.dtDataTimeStartCompared.DateValue.Trim() + "—" + this.dtDateTimeEndCompared.DateValue.Trim() + " 店面支出详情分析表"; }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DownloadSaveAs(this.PictImage.Image, StrFilleName: StrFilleName);
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnCloseed_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 开始时间离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void 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 AnalyzedOrderFinanceOutlayDetailFormMain_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.panelEx2.Width = this.panelEx1.Width - 6;
- this.panelEx2.Height = this.panelEx1.Height - 6;
- }
- }
- /// <summary>
- /// 创建行
- /// </summary>
- 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.AnalyzedOrderFinanceOutlayDetailFormMain_Resize(this, null);
- this.IsFristLoad = false;
- #endregion
- this.actionList.Clear();
- string StrTimeStrat = this.dtDataTimeStart.DateValue.Trim();
- string StrTimeEnd = this.dtDataTimeEnd.DateValue.Trim();
- string StrTimeStratDb = this.dtDataTimeStartCompared.DateValue.Trim();
- string StrTimeEndDb = this.dtDateTimeEndCompared.DateValue.Trim();
- string StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Oiae_IEDatetime", StrTimeStrat, StrTimeEnd) + "";
- string StrWhere2 = "";
- if (string.IsNullOrEmpty(StrGoFormDateTime))
- { StrWhere2 += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Oiae_DividedShop"); }
- else
- { StrWhere2 += " And Oiae_DividedShop = '" + this.StrStoreName + "'"; }
- string ExecuteSql = "select Sum(Oiae_Money) AS 金额,Oiae_ProjectName AS TypeText from tb_ErpOtherIncomeAndExpenses where Oiae_Type = '支出' " + StrWhere + StrWhere2 + " Group By Oiae_ProjectName Order By Sum(Oiae_Money) DESC;";
- if (this.chkComparedStartUp.Checked)
- {
- StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Oiae_IEDatetime", StrTimeStratDb, StrTimeEndDb) + "";
- ExecuteSql += "select Sum(Oiae_Money) AS 金额,Oiae_ProjectName AS TypeText from tb_ErpOtherIncomeAndExpenses where Oiae_Type = '支出' " + StrWhere + StrWhere2 + " Group By Oiae_ProjectName Order By Sum(Oiae_Money) DESC;";
- }
- DataSet dsData = orbll.GetView_Custom(ExecuteSql);
- DataTable dtOrderCount = dsData.Tables["ds"];
- DataTable dtOrderCountCompared = dsData.Tables["ds1"];
- Bitmap newBmp = null;
- if (!this.chkComparedStartUp.Checked)
- {
- #region 无启用对比
- int RowsCountWidth = dtOrderCount.Rows.Count * 120;
- if ((this.panelEx2.Width - 6 - 100) > RowsCountWidth)
- { RowsCountWidth = this.panelEx2.Width + 100; }
- this.PictImage.Size = new System.Drawing.Size(RowsCountWidth, this.panelEx2.Height);
- 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 = new Pen(Brushes.Black, 1);
- Font ft15 = new Font("微软雅黑", 15);
- Font ft12b = new Font("微软雅黑", 11);
- Font ft11 = new Font("微软雅黑", 10);
- int ForTopLoad = 30;
- int LeftWidth = 50;
- 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(newBmp.Width / 2 - FtWidth / 2, ForTopLoad, FtWidth, FtHeigth);
- g.DrawString(StrValue, ft15, b, rec);//画消费法规
- ForTopLoad = rec.Y + rec.Height;
- float WidthRatio = 0;
- if (dtOrderCount.Rows.Count > 0)
- {
- if (float.Parse(dtOrderCount.Rows[0]["金额"].ToString()) > 0)
- { WidthRatio = (this.PictImage.Height - rec.Y - rec.Height - 80) / float.Parse(dtOrderCount.Rows[0]["金额"].ToString()); }
- }
- for (int i = 0; i < dtOrderCount.Rows.Count; i++)
- {
- float intValue = 0;
- if (float.Parse(dtOrderCount.Rows[i]["金额"].ToString()) > 0)
- { intValue = WidthRatio * float.Parse(dtOrderCount.Rows[i]["金额"].ToString().Trim()); }
- Rectangle rec1 = new Rectangle(LeftWidth, Convert.ToInt32((this.PictImage.Height - 50) - intValue), 20, Convert.ToInt32(intValue));
- g.FillRectangle(Brushes.Red, rec1);
- SetPostionData("店面支出详情", dtOrderCount.Rows[i]["TypeText"].ToString(), rec1, "", StrTimeStrat, StrTimeEnd);
- string StrText = dtOrderCount.Rows[i]["TypeText"].ToString().Trim();
- sizef = g.MeasureString(StrText, ft12b);
- FtHeigth = Convert.ToInt32(sizef.Height);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- if (FtWidth > 120)
- {
- FtWidth = 120;
- FtHeigth += FtHeigth;
- }
- Rectangle rec2 = new Rectangle((rec1.X + rec1.Width / 2) - FtWidth / 2, rec1.Y + rec1.Height + 3, FtWidth, FtHeigth);
- g.DrawString(StrText, ft12b, b, rec2);
- string StrAmount = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dtOrderCount.Rows[i]["金额"].ToString().Trim());
- sizef = g.MeasureString(StrAmount, ft11);
- FtHeigth = Convert.ToInt32(sizef.Height);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec3 = new Rectangle((rec1.X + rec1.Width / 2) - FtWidth / 2, rec1.Y - FtHeigth, FtWidth, FtHeigth);
- g.DrawString(StrAmount, ft11, b, rec3);
- LeftWidth += 120;
- }
- #endregion
- }
- else
- {
- #region 启用对比
- Hashtable htData = new Hashtable();
- float MaxAmount = 0;
- for (int i = 0; i < dtOrderCount.Rows.Count; i++)
- {
- if (float.Parse(dtOrderCount.Rows[i]["金额"].ToString()) > MaxAmount)
- { MaxAmount = float.Parse(dtOrderCount.Rows[i]["金额"].ToString()); }
- htData[dtOrderCount.Rows[i]["TypeText"].ToString().Trim()] = dtOrderCount.Rows[i]["TypeText"].ToString().Trim();
- }
- for (int i = 0; i < dtOrderCountCompared.Rows.Count; i++)
- {
- if (float.Parse(dtOrderCountCompared.Rows[i]["金额"].ToString()) > MaxAmount)
- { MaxAmount = float.Parse(dtOrderCountCompared.Rows[i]["金额"].ToString()); }
- htData[dtOrderCountCompared.Rows[i]["TypeText"].ToString().Trim()] = dtOrderCountCompared.Rows[i]["TypeText"].ToString().Trim();
- }
- int RowsCountWidth = dtOrderCount.Rows.Count * 150;
- if ((this.panelEx2.Width - 6 - 100) > RowsCountWidth)
- { RowsCountWidth = this.panelEx2.Width + 100; }
- this.PictImage.Size = new System.Drawing.Size(RowsCountWidth, this.panelEx2.Height);
- newBmp = new Bitmap(this.PictImage.Width, this.PictImage.Height);
- Graphics g = Graphics.FromImage(newBmp);
- g.Clear(System.Drawing.Color.White);
- Brush b = Brushes.Black;
- Brush br = Brushes.Red;
- Brush bb = Brushes.Blue;
- Pen p = new Pen(Brushes.Black, 1);
- Font ft15 = new Font("微软雅黑", 15);
- Font ft12b = new Font("微软雅黑", 11);
- Font ft11 = new Font("微软雅黑", 10);
- int ForTopLoad = 30;
- int LeftWidth = 50;
- 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(newBmp.Width / 2 - FtWidth / 2, ForTopLoad, FtWidth, FtHeigth);
- g.DrawString(StrValue, ft15, b, rec);//画消费法规
- ForTopLoad = rec.Y + rec.Height;
- float WidthRatio = 0;
- if (MaxAmount > 0)
- { WidthRatio = (this.PictImage.Height - rec.Y - rec.Height - 100) / MaxAmount; }
- foreach (DictionaryEntry item in htData)
- {
- DataRow[] dtRow = dtOrderCount.Select("TypeText = '" + item.Key.ToString().Trim() + "'");
- DataRow[] dtRow2 = dtOrderCountCompared.Select("TypeText = '" + item.Key.ToString().Trim() + "'");
- string StrText = "";
- string StrAmount = "0";
- float intValue = 0;
- if (dtRow.Length > 0)
- {
- StrText = dtRow[0]["TypeText"].ToString().Trim();
- StrAmount = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dtRow[0]["金额"].ToString().Trim());
- if (float.Parse(dtRow[0]["金额"].ToString()) > 0)
- { intValue = WidthRatio * float.Parse(dtRow[0]["金额"].ToString().Trim()); }
- }
- string StrAmount2 = "0";
- float intValue2 = 0;
- if (dtRow2.Length > 0)
- {
- if (string.IsNullOrEmpty(StrText))
- { StrText = dtRow2[0]["TypeText"].ToString().Trim(); }
- StrAmount2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dtRow2[0]["金额"].ToString().Trim());
- if (float.Parse(dtRow2[0]["金额"].ToString()) > 0)
- { intValue2 = WidthRatio * float.Parse(dtRow2[0]["金额"].ToString().Trim()); }
- }
- Rectangle recA1 = new Rectangle(LeftWidth, Convert.ToInt32((this.PictImage.Height - 50) - intValue), 20, Convert.ToInt32(intValue));
- g.FillRectangle(Brushes.Red, recA1);
- SetPostionData("店面支出详情", item.Value.ToString(), recA1, "", StrTimeStrat, StrTimeEnd);
- sizef = g.MeasureString(StrText, ft12b);
- FtHeigth = Convert.ToInt32(sizef.Height);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- if (FtWidth > 140)
- {
- FtWidth = 140;
- FtHeigth += FtHeigth;
- }
- Rectangle recA2 = new Rectangle(recA1.X + recA1.Width - FtWidth / 2, recA1.Y + recA1.Height + 3, FtWidth, FtHeigth);
- g.DrawString(StrText, ft12b, b, recA2);
- if (Convert.ToDecimal(StrAmount) > 0)
- {
- sizef = g.MeasureString(StrAmount, ft11);
- FtHeigth = Convert.ToInt32(sizef.Height);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle recA3 = new Rectangle(recA1.X - (FtWidth / 2), recA1.Y - FtHeigth, FtWidth, FtHeigth);
- g.DrawString(StrAmount, ft11, br, recA3);
- }
- Rectangle recB1 = new Rectangle(recA1.X + recA1.Width, recA1.Y + recA1.Height - Convert.ToInt32(intValue2), 20, Convert.ToInt32(intValue2));
- g.FillRectangle(Brushes.Blue, recB1);
- SetPostionData("店面支出详情", item.Value.ToString(), recB1, "", StrTimeStratDb, StrTimeEndDb);
- if (Convert.ToDecimal(StrAmount2) > 0)
- {
- sizef = g.MeasureString(StrAmount2, ft11);
- FtHeigth = Convert.ToInt32(sizef.Height);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle recB3 = new Rectangle(recB1.X, recB1.Y - FtHeigth * 2 + 5, FtWidth, FtHeigth);
- g.DrawString(StrAmount2, ft11, bb, recB3);
- }
- LeftWidth += 150;
- }
- #endregion
- }
- this.PictImage.Image = newBmp;
- }
- }
- }
|