public void ResizeShowCharts() { tagRECT rect1 = new tagRECT(); tagRECT rect2 = new tagRECT(); tagRECT rect3 = new tagRECT(); tagRECT rect4 = new tagRECT(); MainWindowViewModel mainModel = Application.Current.MainWindow.DataContext as MainWindowViewModel; Window mainWnd = Application.Current.MainWindow; if (mainModel.bShowPage == PageVisibleEnum.PageVisibleEnum_SignStat) { double totalTitleHeight = mainModel.titleheight + topHeight; System.Windows.Point ptOriginalDlg = new System.Windows.Point(0, 0); System.Windows.Point ptTopLeftDlg1 = new System.Windows.Point(mainModel.leftWidth + leftListWidth, totalTitleHeight + regionTextHeight); System.Windows.Point ptBotRightDlg1 = new System.Windows.Point(mainWnd.Width, mainWnd.Height); ptOriginalDlg = mainWnd.PointToScreen(ptOriginalDlg); ptTopLeftDlg1 = mainWnd.PointToScreen(ptTopLeftDlg1); ptBotRightDlg1 = mainWnd.PointToScreen(ptBotRightDlg1); rect1.left = Convert.ToInt32(ptTopLeftDlg1.X - ptOriginalDlg.X); rect1.top = Convert.ToInt32(ptTopLeftDlg1.Y - ptOriginalDlg.Y); rect1.right = Convert.ToInt32(ptBotRightDlg1.X - ptOriginalDlg.X); rect1.bottom = Convert.ToInt32(ptBotRightDlg1.Y - ptOriginalDlg.Y); PieChartServer.MoveChart(_pieCharIndex, rect1, true); LineChartServer.MoveChart(_lineCharIndex, rect1, true); HistogramServer.MoveChart(_histogramCharIndex, rect1, true); switch (bShowChart) { case ShowChartEnum.ShowChartEnum_Pie: region0Text = "制签饼图"; PieChartServer.ShowChart(_pieCharIndex, true); LineChartServer.ShowChart(_lineCharIndex, false); HistogramServer.ShowChart(_histogramCharIndex, false); break; case ShowChartEnum.ShowChartEnum_Line: region0Text = "制签统计图"; PieChartServer.ShowChart(_pieCharIndex, false); LineChartServer.ShowChart(_lineCharIndex, true); HistogramServer.ShowChart(_histogramCharIndex, false); break; case ShowChartEnum.ShowChartEnum_Histogram: region0Text = "制签直方图"; PieChartServer.ShowChart(_pieCharIndex, false); LineChartServer.ShowChart(_lineCharIndex, false); HistogramServer.ShowChart(_histogramCharIndex, true); break; } } else { PieChartServer.ShowChart(_pieCharIndex, false); LineChartServer.ShowChart(_lineCharIndex, false); HistogramServer.ShowChart(_histogramCharIndex, false); } }
private void QueryTableCallBack(string resultStr, string resultError) { string[] rows = resultStr.Split(';'); int rowIndex = 0; foreach (string row in rows) { if (row.Length > 0) { string[] cells = row.Split(','); foreach (string cell in cells) { string[] keyvalue = cell.Split(':'); if (keyvalue.Length != 2 || keyvalue[1] == null || keyvalue[1].Length == 0) { continue; } switch (_queryoperate) { case QueryOperate.QueryOperate_LineChart: case QueryOperate.QueryOperate_PieChart: case QueryOperate.QueryOperate_HistogramChart: { LineChartServer.SetCurvePointInfo(_lineCharIndex, rowIndex, Convert.ToInt32(keyvalue[1])); if (rowIndex < 3) { int clr0_1 = Color.BlueViolet.ToArgb() + 100 * (rowIndex + 0); int clr0_2 = Color.BlueViolet.ToArgb() + 100 * (rowIndex + 1); int clr0_3 = Color.BlueViolet.ToArgb() + 100 * (rowIndex + 2); int clr0_4 = Color.BlueViolet.ToArgb() + 100 * (rowIndex + 3); PieChartServer.SetPieBasicInfo(_pieCharIndex, rowIndex, Convert.ToInt32(keyvalue[1]), clr0_1, clr0_2, clr0_3, clr0_4 ); } int clr1 = Color.BlueViolet.ToArgb() + 100 * rowIndex; HistogramServer.SetHistogramBasicInfo(_lineCharIndex, rowIndex, Convert.ToInt32(keyvalue[1]), clr1); } break; } rowIndex++; } } } PieChartServer.RedrawChart(_pieCharIndex); LineChartServer.RedrawChart(_lineCharIndex); HistogramServer.RedrawChart(_histogramCharIndex); _queryoperate = QueryOperate.QueryOperate_None; }
protected override void OnExit(ExitEventArgs e) { WorkServer.stopClient(); LineChartServer.UninitializeCurveModule(); HistogramServer.UninitializeHistogramModule(); OccupancyChartServer.UninitializeOccupancyModule(); PieChartServer.UninitializePieModule(); base.OnExit(e); }
public void DoLogon() { IntPtr hwnd = new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle; tagRECT rcClient = new tagRECT(); _pieCharIndex = PieChartServer.AddPieChart(hwnd, rcClient); _lineCharIndex = LineChartServer.AddCurveChart(hwnd, rcClient); _histogramCharIndex = HistogramServer.AddHistogramChart(hwnd, rcClient, 0, 3000, 300, Color.Red.ToArgb(), Color.Black.ToArgb(), Color.Green.ToArgb()); ResizeShowCharts(); }
protected override void OnStartup(StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; LineChartServer.InitializeCurveModule(); HistogramServer.InitializeHistogramModule(); OccupancyChartServer.InitializeOccupancyModule(); PieChartServer.InitializePieModule(); base.OnStartup(e); }
private void QueryTableCallBack(string resultStr, string errorStr) { string[] rows = resultStr.Split(';'); foreach (string row in rows) { if (row.Length > 0) { string[] cells = row.Split(','); foreach (string cell in cells) { string[] keyvalue = cell.Split(':'); if (keyvalue.Length != 2 || keyvalue[1] == null || keyvalue[1].Length == 0) { continue; } LineChartServer.SetCurvePointInfo(_lineCharIndex, Convert.ToInt32(keyvalue[0]), Convert.ToInt32(keyvalue[1])); { int rowIndex = Convert.ToInt32(keyvalue[0]); int clr0_1 = Color.Azure.ToArgb() + 100 * (rowIndex + 0); int clr0_2 = Color.Azure.ToArgb() + 100 * (rowIndex + 1); int clr0_3 = Color.Azure.ToArgb() + 100 * (rowIndex + 2); int clr0_4 = Color.Azure.ToArgb() + 100 * (rowIndex + 3); PieChartServer.SetPieBasicInfo(_pieCharIndex, Convert.ToInt32(keyvalue[0]), (float)(Convert.ToDouble(keyvalue[1])), clr0_1, clr0_2, clr0_3, clr0_4 ); } { int rowIndex = Convert.ToInt32(keyvalue[0]); int clr1 = Color.BlueViolet.ToArgb() + 100 * rowIndex; HistogramServer.SetHistogramBasicInfo(_lineCharIndex, Convert.ToInt32(keyvalue[0]), Convert.ToInt32(keyvalue[1]), clr1); } } } } PieChartServer.RedrawChart(_pieCharIndex); LineChartServer.RedrawChart(_lineCharIndex); HistogramServer.RedrawChart(_histogramCharIndex); }
public void DoLogon() { IntPtr hwnd = new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle; tagRECT rcClient = new tagRECT(); _pieCharIndex = PieChartServer.AddPieChart(hwnd, rcClient); _lineCharIndex = LineChartServer.AddCurveChart(hwnd, rcClient); _histogramCharIndex = HistogramServer.AddHistogramChart(hwnd, rcClient, 0, 3000, 300, Color.Red.ToArgb(), Color.Black.ToArgb(), Color.Green.ToArgb()); _occupancyCharIndex = OccupancyChartServer.AddOccupancyChart(hwnd, rcClient, 0, 3000, 300); PieChartServer.AddData(_pieCharIndex, MainWindowViewModel._businesstype.Count - 1); LineChartServer.AddData(_lineCharIndex, 13, 12, 1200); HistogramServer.AddData(_histogramCharIndex, 12); OccupancyChartServer.AddData(_occupancyCharIndex, 12); PieChartServer.ShowPieList(_pieCharIndex, false); HistogramServer.ShowHistogramList(_histogramCharIndex, false); OccupancyChartServer.ShowOccupancyList(_occupancyCharIndex, false); ResizeShowCharts(); Thread tQuery = new Thread(() => { ////循环查询 QueryShebeiguzhang(null); QueryBenyuebanliyewu(null); QueryHongKongWangLai(null); QueryTaiWanWangLai(null); QuerySheBeiZaiXian(null); QueryGuanLiCiShu(null); QueryLineChartData(null); QueryOccupancyChartData(null); QueryPieChartData(null); QueryHistogramChartData(null); } ); tQuery.IsBackground = true; tQuery.Start(); }
string MakeStatisticsQuerySql(object obj) { DateTime realstartTime = DateTime.Parse(startTime); DateTime realendTime = DateTime.Parse(endTime); string str = "select "; string strCondition = ""; int index = 0; do { strCondition += " ( "; strCondition += "select count(*) as totalCnt from Zhiqianshuju where Xuhao>=-1"; strCondition += MakeDeviceConditionSql("Zhiqianshuju"); strCondition += " and Zhiqianshuju.[Riqi]>=" + Common.ConvertDateTimeInt(realstartTime); if (dataTypeText.Contains("天")) { realstartTime = realstartTime.AddDays(1); } else if (dataTypeText.Contains("周")) { realstartTime = realstartTime.AddDays(7); } else if (dataTypeText.Contains("月")) { realstartTime = realstartTime.AddMonths(1); } else if (dataTypeText.Contains("年")) { realstartTime = realstartTime.AddYears(1); } if (realstartTime < realendTime) { strCondition += " and Zhiqianshuju.[Riqi]<" + Common.ConvertDateTimeInt(realstartTime); } else { strCondition += " and Zhiqianshuju.[Riqi]<" + Common.ConvertDateTimeInt(realendTime); } strCondition += " ) as " + "'" + index + "'"; index++; if (realstartTime < realendTime && index < 12) { strCondition += ","; } } while (realstartTime < realendTime && index < 12); Application.Current.Dispatcher.Invoke( new Action(() => { IntPtr hwnd = new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle; tagRECT rcClient = new tagRECT(); PieChartServer.RemovePieChart(_pieCharIndex); LineChartServer.RemoveCurveChart(_lineCharIndex); HistogramServer.RemoveHistogramChart(_histogramCharIndex); _pieCharIndex = PieChartServer.AddPieChart(hwnd, rcClient); _lineCharIndex = LineChartServer.AddCurveChart(hwnd, rcClient); _histogramCharIndex = HistogramServer.AddHistogramChart(hwnd, rcClient, 0, 3000, 300, Color.Red.ToArgb(), Color.Black.ToArgb(), Color.Green.ToArgb()); ResizeShowCharts(); PieChartServer.AddData(_pieCharIndex, index); LineChartServer.AddData(_lineCharIndex, 13, index, 3600); HistogramServer.AddData(_histogramCharIndex, index); })); return(str + strCondition); }
public void ResizeShowCharts() { tagRECT rect1 = new tagRECT(); tagRECT rect2 = new tagRECT(); tagRECT rect3 = new tagRECT(); tagRECT rect4 = new tagRECT(); MainWindowViewModel mainModel = Application.Current.MainWindow.DataContext as MainWindowViewModel; Window mainWnd = Application.Current.MainWindow; if (mainModel.bShowPage == PageVisibleEnum.PageVisibleEnum_Home) { double totalTitleHeight = mainModel.titleheight + topHeight; System.Windows.Point ptOriginalDlg = new System.Windows.Point(0, 0); System.Windows.Point ptTopLeftDlg1 = new System.Windows.Point(mainModel.leftWidth, totalTitleHeight + regionTextHeight); System.Windows.Point ptBotRightDlg1 = new System.Windows.Point(mainWnd.ActualWidth - regionRightWidth, mainWnd.ActualHeight); System.Windows.Point ptTopLeftDlg2 = new System.Windows.Point(mainWnd.ActualWidth - regionRightWidth, totalTitleHeight + regionTextHeight); System.Windows.Point ptBotRightDlg2 = new System.Windows.Point(mainWnd.ActualWidth, totalTitleHeight + (mainWnd.ActualHeight - totalTitleHeight) / 3); System.Windows.Point ptTopLeftDlg3 = new System.Windows.Point(mainWnd.ActualWidth - regionRightWidth, totalTitleHeight + (mainWnd.ActualHeight - totalTitleHeight) / 3 + regionTextHeight); System.Windows.Point ptBotRightDlg3 = new System.Windows.Point(mainWnd.ActualWidth, (mainWnd.ActualHeight - mainModel.titleheight - topHeight) * 2 / 3 + mainModel.titleheight + topHeight); System.Windows.Point ptTopLeftDlg4 = new System.Windows.Point(mainWnd.ActualWidth - regionRightWidth, totalTitleHeight + (mainWnd.ActualHeight - totalTitleHeight) * 2 / 3 + regionTextHeight); System.Windows.Point ptBotRightDlg4 = new System.Windows.Point(mainWnd.ActualWidth, mainWnd.ActualHeight); ptOriginalDlg = mainWnd.PointToScreen(ptOriginalDlg); ptTopLeftDlg1 = mainWnd.PointToScreen(ptTopLeftDlg1); ptBotRightDlg1 = mainWnd.PointToScreen(ptBotRightDlg1); ptTopLeftDlg2 = mainWnd.PointToScreen(ptTopLeftDlg2); ptBotRightDlg2 = mainWnd.PointToScreen(ptBotRightDlg2); ptTopLeftDlg3 = mainWnd.PointToScreen(ptTopLeftDlg3); ptBotRightDlg3 = mainWnd.PointToScreen(ptBotRightDlg3); ptTopLeftDlg4 = mainWnd.PointToScreen(ptTopLeftDlg4); ptBotRightDlg4 = mainWnd.PointToScreen(ptBotRightDlg4); rect1.left = Convert.ToInt32(ptTopLeftDlg1.X - ptOriginalDlg.X); rect1.top = Convert.ToInt32(ptTopLeftDlg1.Y - ptOriginalDlg.Y); rect1.right = Convert.ToInt32(ptBotRightDlg1.X - ptOriginalDlg.X); rect1.bottom = Convert.ToInt32(ptBotRightDlg1.Y - ptOriginalDlg.Y); rect2.left = Convert.ToInt32(ptTopLeftDlg2.X - ptOriginalDlg.X); rect2.top = Convert.ToInt32(ptTopLeftDlg2.Y - ptOriginalDlg.Y); rect2.right = Convert.ToInt32(ptBotRightDlg2.X - ptOriginalDlg.X); rect2.bottom = Convert.ToInt32(ptBotRightDlg2.Y - ptOriginalDlg.Y); rect3.left = Convert.ToInt32(ptTopLeftDlg3.X - ptOriginalDlg.X); rect3.top = Convert.ToInt32(ptTopLeftDlg3.Y - ptOriginalDlg.Y); rect3.right = Convert.ToInt32(ptBotRightDlg3.X - ptOriginalDlg.X); rect3.bottom = Convert.ToInt32(ptBotRightDlg3.Y - ptOriginalDlg.Y); rect4.left = Convert.ToInt32(ptTopLeftDlg4.X - ptOriginalDlg.X); rect4.top = Convert.ToInt32(ptTopLeftDlg4.Y - ptOriginalDlg.Y); rect4.right = Convert.ToInt32(ptBotRightDlg4.X - ptOriginalDlg.X); rect4.bottom = Convert.ToInt32(ptBotRightDlg4.Y - ptOriginalDlg.Y); OccupancyChartServer.MoveChart(_occupancyCharIndex, rect2, true); switch (bShowChart) { case ShowChartEnum.ShowChartEnum_Pie: region0Text = "已受理业务饼图表"; region2Text = "已受理业务统计图"; region3Text = "已受理业务直方图表"; PieChartServer.MoveChart(_pieCharIndex, rect1, true); LineChartServer.MoveChart(_lineCharIndex, rect3, true); HistogramServer.MoveChart(_histogramCharIndex, rect4, true); break; case ShowChartEnum.ShowChartEnum_Line: region0Text = "已受理业务统计图"; region2Text = "已受理业务饼图表"; region3Text = "已受理业务直方图表"; LineChartServer.MoveChart(_lineCharIndex, rect1, true); PieChartServer.MoveChart(_pieCharIndex, rect3, true); HistogramServer.MoveChart(_histogramCharIndex, rect4, true); break; case ShowChartEnum.ShowChartEnum_Histogram: region0Text = "已受理业务直方图表"; region2Text = "已受理业务统计图"; region3Text = "已受理业务饼图表"; HistogramServer.MoveChart(_histogramCharIndex, rect1, true); LineChartServer.MoveChart(_lineCharIndex, rect3, true); PieChartServer.MoveChart(_pieCharIndex, rect4, true); break; } OccupancyChartServer.ShowChart(_occupancyCharIndex, true); PieChartServer.ShowChart(_pieCharIndex, true); LineChartServer.ShowChart(_lineCharIndex, true); HistogramServer.ShowChart(_histogramCharIndex, true); } else { OccupancyChartServer.ShowChart(_occupancyCharIndex, false); PieChartServer.ShowChart(_pieCharIndex, false); LineChartServer.ShowChart(_lineCharIndex, false); HistogramServer.ShowChart(_histogramCharIndex, false); } }
private void QueryTableCallBack(string resultStr, string errorStr) { string[] rows = resultStr.Split(';'); foreach (string row in rows) { if (row.Length > 0) { string[] cells = row.Split(','); foreach (string cell in cells) { string[] keyvalue = cell.Split(':'); if (keyvalue.Length != 2 || keyvalue[1] == null || keyvalue[1].Length == 0) { continue; } switch (_queryoperate) { case QueryOperate.QueryOperate_Guzhang: totalSheBeiGuZhang = keyvalue[1]; break; case QueryOperate.QueryOperate_Yewu: totalBanLiYeWu = keyvalue[1]; break; case QueryOperate.QueryOperate_Hongkong: totalXiangGangWangLai = keyvalue[1]; break; case QueryOperate.QueryOperate_Taiwan: totalTaiWanWangLai = keyvalue[1]; break; case QueryOperate.QueryOperate_SheBeiZaiXian: totalSheBeiZaiXian = keyvalue[1]; break; case QueryOperate.QueryOperate_GuanLiCnt: totalGuanLiCiShu = keyvalue[1]; break; case QueryOperate.QueryOperate_LineChart: LineChartServer.SetCurvePointInfo(_lineCharIndex, Convert.ToInt32(keyvalue[0]), Convert.ToInt32(keyvalue[1])); break; case QueryOperate.QueryOperate_OccupancyChart: OccupancyChartServer.SetOccupancyBasicInfo(_occupancyCharIndex, Convert.ToInt32(keyvalue[0]), Convert.ToInt32(keyvalue[1])); break; case QueryOperate.QueryOperate_PieChart: { int rowIndex = Convert.ToInt32(keyvalue[0]); int clr0_1 = Color.Azure.ToArgb() + 100 * (rowIndex + 0); int clr0_2 = Color.Azure.ToArgb() + 100 * (rowIndex + 1); int clr0_3 = Color.Azure.ToArgb() + 100 * (rowIndex + 2); int clr0_4 = Color.Azure.ToArgb() + 100 * (rowIndex + 3); PieChartServer.SetPieBasicInfo(_pieCharIndex, Convert.ToInt32(keyvalue[0]), (float)(Convert.ToDouble(keyvalue[1])), clr0_1, clr0_2, clr0_3, clr0_4 ); } break; case QueryOperate.QueryOperate_HistogramChart: { int rowIndex = Convert.ToInt32(keyvalue[0]); int clr1 = Color.BlueViolet.ToArgb() + 100 * rowIndex; HistogramServer.SetHistogramBasicInfo(_lineCharIndex, Convert.ToInt32(keyvalue[0]), Convert.ToInt32(keyvalue[1]), clr1); } break; } } } } PieChartServer.RedrawChart(_pieCharIndex); LineChartServer.RedrawChart(_lineCharIndex); HistogramServer.RedrawChart(_histogramCharIndex); OccupancyChartServer.RedrawChart(_occupancyCharIndex); _queryoperate = QueryOperate.QueryOperate_None; }
string MakeStatisticsQuerySql(object obj) { DateTime realstartTime = DateTime.Parse(startTime); DateTime realendTime = DateTime.Parse(endTime); string str = "select "; string strCondition = ""; int index = 0; do { DateTime begintime = realstartTime; DateTime endtime = realstartTime; strCondition += " ( "; if (dataTypeText.Contains("天")) { realstartTime = realstartTime.AddDays(1); } else if (dataTypeText.Contains("周")) { realstartTime = realstartTime.AddDays(7); } else if (dataTypeText.Contains("月")) { realstartTime = realstartTime.AddMonths(1); } else if (dataTypeText.Contains("年")) { realstartTime = realstartTime.AddYears(1); } if (realstartTime < realendTime) { endtime = realstartTime; } else { endtime = realendTime; } strCondition += MakeBenyuebanliyewuCurMonthQuerySql(obj, begintime, endtime); strCondition += " ) as " + "'" + index + "'"; index++; if (realstartTime < realendTime && index < 31) { strCondition += ","; } } while (realstartTime < realendTime && index < 31); Application.Current.Dispatcher.Invoke( new Action(() => { IntPtr hwnd = new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle; tagRECT rcClient = new tagRECT(); PieChartServer.RemovePieChart(_pieCharIndex); LineChartServer.RemoveCurveChart(_lineCharIndex); HistogramServer.RemoveHistogramChart(_histogramCharIndex); _pieCharIndex = PieChartServer.AddPieChart(hwnd, rcClient); _lineCharIndex = LineChartServer.AddCurveChart(hwnd, rcClient); _histogramCharIndex = HistogramServer.AddHistogramChart(hwnd, rcClient, 0, 3000, 300, Color.Red.ToArgb(), Color.Black.ToArgb(), Color.Green.ToArgb()); ResizeShowCharts(); PieChartServer.AddData(_pieCharIndex, index); LineChartServer.AddData(_lineCharIndex, 13, index, 3600); HistogramServer.AddData(_histogramCharIndex, index); })); return(str + strCondition); }