private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridView view = sender as DataGridView; GuideDayAchievement item = view.Rows[e.RowIndex].DataBoundItem as GuideDayAchievement; GuideDetailClick(item); }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (!DataGridViewUtil.CheckPerrmisson(this, sender, e)) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } try { DataGridView view = (DataGridView)sender; List <GuideDayAchievement> curDayReportListSource = (List <GuideDayAchievement>)view.DataSource; GuideDayAchievement item = curDayReportListSource[e.RowIndex]; item.ReportDate = Convert.ToInt32(DateTime.Now.Year + "" + DateTime.Now.Month + "" + DateTime.Now.Day); switch (view.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) { case "明细": // GuideDetailClick(item); form.ShowDialog(curDayReport.ShopID, item.GuideID, curDayReport.ReportDate); break; } } catch (Exception ex) { CommonGlobalUtil.ShowError(ex); } }
private void GuideDetailClick(GuideDayAchievement item) { this.GuideDetail_Click?.Invoke(new RetailListPagePara() { RetailOrderID = null, CostumeID = null, StartDate = TimeHelper.GetReportDate(curDayReport.ReportDate.ToString()), EndDate = TimeHelper.GetReportDate(curDayReport.ReportDate.ToString()), ClassID = -1, GuideID = item.GuideID, BrandID = -1, RetailOrderState = RetailOrderState.IsEffective, IsOpenDate = true, PageIndex = 0, PageSize = int.MaxValue, ShopID = curDayReport.ShopID, RetailOrderType = RetailOrderType.All, RetailPayType = RetailPayType.All, IsGetGeneralStore = true, }, this); }
private void CreateChart(ZedGraphControl zgc, GuideAchievementsPara pagePara, List <GuideDayAchievement> list) { GraphPane myPane = zgc.GraphPane; myPane.CurveList.Clear(); myPane.GraphItemList.Clear(); zgc.AxisChange(); zgc.Refresh(); // zgc.AxisChange(); // Set the titles and axis labels myPane.Title = "导购业绩"; myPane.XAxis.Title = "时间"; myPane.YAxis.Title = "销售额"; // Make up some random data points // string[] labels = { "Panther", "Lion", "Cheetah", "Cougar", "Tiger", "Leopard" }; String[] labels = null; double[] points = null; if (pagePara.IsMonth) { labels = new string[12]; points = new double[12]; for (int i = 0; i <= 11; i++) { labels[i] = (i + 1).ToString(); GuideDayAchievement achievement = list.Find(t => Int32.Parse(t.ReportDate.ToString().Substring(4, 2)) == (i + 1)); if (achievement != null) { points[i] = decimal.ToDouble(achievement.MoneyOfSale); } } } else { //获取月份对应的数量 if (list != null && list.Count > 0) { GuideDayAchievement achievement = list[0]; int days = TimeHelper.GetReportMonthMaxDay(achievement.ReportDate); labels = new string[days]; points = new double[days]; for (int i = 0; i < days; i++) { labels[i] = (i + 1).ToString(); achievement = list.Find(t => Int32.Parse(t.ReportDate.ToString().Substring(6, 2)) == (i + 1)); if (achievement != null) { points[i] = decimal.ToDouble(achievement.MoneyOfSale); } } } } //y轴 //double[] y = new double[11]; //decimal maxAccount = 0; //foreach (var item in list) //{ // if (maxAccount < item.MoneyOfSale) // { // maxAccount = item.MoneyOfSale; // } //} //int step = decimal.ToInt32(Math.Round(maxAccount / 1100) * 100); //for (int j = 10; j >= 0; j--) //{ // y[j] = step * j; //} // Generate a red bar with "Curve 1" in the legend BarItem myBar = myPane.AddBar("销售总额", null, points, Color.Blue); myBar.Bar.Fill = new Fill(Color.Blue, Color.White, Color.Blue); //// Generate a blue bar with "Curve 2" in the legend //myBar = myPane.AddBar("Curve 2", null, y2, Color.Blue); //myBar.Bar.Fill = new Fill(Color.Blue, Color.White, Color.Blue); //// Generate a green bar with "Curve 3" in the legend //myBar = myPane.AddBar("Curve 3", null, y3, Color.Green); //myBar.Bar.Fill = new Fill(Color.Green, Color.White, Color.Green); //// Generate a black line with "Curve 4" in the legend //LineItem myCurve = myPane.AddCurve("Curve 4", // null, y4, Color.Black, SymbolType.Circle); //myCurve.Line.Fill = new Fill(Color.White, Color.LightSkyBlue, -45F); // Fix up the curve attributes a little //myCurve.Symbol.Size = 8.0F; //myCurve.Symbol.Fill = new Fill(Color.White); //myCurve.Line.Width = 2.0F; // Draw the X tics between the labels instead of at the labels myPane.XAxis.IsTicsBetweenLabels = true; // Set the XAxis labels myPane.XAxis.TextLabels = labels; // Set the XAxis to Text type myPane.XAxis.Type = AxisType.Text; // Fill the axis area with a gradient myPane.AxisFill = new Fill(Color.White, Color.FromArgb(255, 255, 166), 90F); // Fill the pane area with a solid color myPane.PaneFill = new Fill(Color.FromArgb(250, 250, 255)); zgc.AxisChange(); zgc.Invalidate(); this.tabPage2.Invalidate(); this.Invalidate(); }