Пример #1
0
        private void SearchDetailList(DataRowView report)
        {
            this.skinSplitContainer1.Panel2Collapsed = false;
            GetBenefitReportsPara para = new GetBenefitReportsPara()
            {
                IsMonth           = isMonth,
                StartDate         = startDate,
                EndDate           = endDate,
                ShopID            = report["ShopID"].ToString(),
                IsGetGeneralStore = CommonGlobalCache.IsGeneralStoreRetail == "1"
            };

            this.DetailClick?.Invoke(para, this.skinSplitContainer1.Panel2, this);
        }
        private void CreateChart(ZedGraphControl zgc, GetBenefitReportsPara pagePara, List <DayBenefitReport> list)
        {
            GraphPane myPane = zgc.GraphPane;

            if (myPane == null)
            {
                return;
            }
            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();
                    DayBenefitReport achievement = list.Find(t => Int32.Parse(t.ReportDate.ToString().Substring(4, 2)) == (i + 1));
                    if (achievement != null)
                    {
                        points[i] = decimal.ToDouble(achievement.SalesTotalMoney);
                    }
                }
            }
            else
            {
                //获取月份对应的数量
                if (list.Count > 0)
                {
                    DayBenefitReport 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.SalesTotalMoney);
                        }
                    }
                }
            }

            // 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);
            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.skinTabPage2.Invalidate();
            //  this.Invalidate();
        }
 public void SearchDetailList(GetBenefitReportsPara para)
 {
     this.para = para;
     this.para.IsShowNotZero = skinCheckBox_IsOnlyShowNoZero.Checked;
     Search(null, null);
 }