Ejemplo n.º 1
0
        /// <summary>
        /// 取数据,构造json数据,为画图做准备
        /// </summary>
        /// <param name="type"></param>
        /// <param name="checkedYear"></param>
        /// <returns></returns>
        public HighChartOptions GetStudentsHighchart(HighchartTypeEnum type, int period, string peroidName)
        {
            DataSet       ds  = GetStudentsByPeroid(period);
            List <Series> ser = new List <Series>();
            Series        s   = new Series();

            s.name = "学员情况";
            List <object> obj = new List <object>();

            for (int i = 0; i < ds.Tables.Count; i++)
            {
                PieSeriesData pieSeriesData = new PieSeriesData();
                string        tname         = tname = ds.Tables[i].Rows[0][0].ToString();
                int           tdata         = Int32.Parse(ds.Tables[i].Rows[0][1].ToString());
                pieSeriesData.name = tname;
                pieSeriesData.y    = tdata;

                obj.Add(pieSeriesData);
            }
            s.data             = obj;
            s.type             = ChartTypeEnum.pie.ToString();
            s.allowPointSelect = false;
            ser.Add(s);
            HighChartOptions currentChart = new HighChartOptions();

            currentChart = new HighChartOptions()
            {
                //chart = new Chart()
                //{
                //    renderTo = "highChartDiv",
                //    type = ChartTypeEnum.area.ToString(),
                //    reflow=true
                //},
                title = new Title()
                {
                    text = peroidName + "期学员统计图"
                },
                //xAxis = new List<XAxis>() {
                //    new XAxis(){
                //        categories = new List<string>() { "一月", "二月", "三月", "四月", "五月","六月", "七月", "八月", "九月", "十月","十一月","十二月" },
                //        reversed = false,
                //        opposite = false
                //    }
                //},
                yAxis = new YAxis()
                {
                    title = new Title()
                    {
                        text = peroidName + "期学员统计"
                    }
                },
                //tooltip = new ToolTip() { crosshairs = new List<bool>() { true, false } },
                series = ser
            };
            return(currentChart);
        }
        /// <summary>
        /// 查询一年的出账情况
        /// </summary>
        /// <param name="context"></param>
        private void GetExpensesOfOneYear(HttpContext context)
        {
            string            checkedYear = context.Request.Params["checkedYear"];
            int               chartType   = (int)HighchartTypeEnum.柱状图;
            HighchartTypeEnum type        = (HighchartTypeEnum)Enum.Parse(typeof(HighchartTypeEnum), chartType.ToString());

            HighChartOptions chart = bll.GetExpensesHighchart(type, checkedYear);
            var tmd = new { value = chart, label = type.ToString() };

            context.Response.Write(tmd.ToJson());

            userOperateLog.OperateInfo = "查询出账费用情况";
            userOperateLog.IfSuccess   = true;
            userOperateLog.Description = "";
            DriveMgr.BLL.UserOperateLog.InsertOperateInfo(userOperateLog);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查询教练培训学员情况
        /// </summary>
        /// <param name="context"></param>
        private void GetCoachTeachInfo(HttpContext context)
        {
            int               checkedPeriod = Int32.Parse(context.Request.Params["checkedPeriod"]);
            string            peridName     = context.Request.Params["peridName"];
            int               chartType     = (int)HighchartTypeEnum.柱状图;
            HighchartTypeEnum type          = (HighchartTypeEnum)Enum.Parse(typeof(HighchartTypeEnum), chartType.ToString());

            HighChartOptions chart = bll.GetCoachTeachHighchart(type, checkedPeriod, peridName);
            var tmd = new { value = chart, label = type.ToString() };

            context.Response.Write(tmd.ToJson());

            userOperateLog.OperateInfo = "查询教练培训学员情况";
            userOperateLog.IfSuccess   = true;
            userOperateLog.Description = "";
            DriveMgr.BLL.UserOperateLog.InsertOperateInfo(userOperateLog);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 取数据,构造json数据,为画图做准备
        /// </summary>
        /// <param name="type"></param>
        /// <param name="checkedYear"></param>
        /// <returns></returns>
        public HighChartOptions GetCoachTeachHighchart(HighchartTypeEnum type, int peridID, string peridName)
        {
            DataSet       ds    = GetCoachTeachInfo(peridID);
            List <Series> ser   = new List <Series>();
            List <string> xaxis = new List <string>();

            for (int j = 1; j < ds.Tables[0].Columns.Count; j++)
            {
                Series        s   = new Series();
                List <object> obj = new List <object>();
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string coachName = ds.Tables[0].Rows[i]["CoachName"].ToString();

                    xaxis.Add(coachName);
                    int tname = Int32.Parse(ds.Tables[0].Rows[i][j].ToString());
                    obj.Add(tname);
                }

                s.data             = obj;
                s.type             = ChartTypeEnum.column.ToString();
                s.allowPointSelect = false;
                if (j == 1)
                {
                    s.name = "在学";
                }
                else if (j == 2)
                {
                    s.name = "毕业";
                }
                else if (j == 3)
                {
                    s.name = "退学";
                }
                ser.Add(s);
            }
            HighChartOptions currentChart = new HighChartOptions();

            currentChart = new HighChartOptions()
            {
                //chart = new Chart()
                //{
                //    renderTo = "highChartDiv",
                //    type = ChartTypeEnum.area.ToString(),
                //    reflow=true
                //},
                title = new Title()
                {
                    text = peridName + "期教练培训学员情况图"
                },
                xAxis = new List <XAxis>()
                {
                    new XAxis()
                    {
                        categories = xaxis,
                        reversed   = false,
                        opposite   = false
                    }
                },
                yAxis = new YAxis()
                {
                    title = new Title()
                    {
                        text = peridName + "期教练培训学员"
                    }
                },
                //tooltip = new ToolTip() { crosshairs = new List<bool>() { true, false } },
                series = ser
            };
            return(currentChart);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 取数据,构造json数据,为画图做准备
        /// </summary>
        /// <param name="type"></param>
        /// <param name="checkedYear"></param>
        /// <returns></returns>
        public HighChartOptions GetHighchart(HighchartTypeEnum type, string checkedYear)
        {
            DataSet       ds  = GetIncomeOfOneYear(checkedYear);
            List <Series> ser = new List <Series>();

            for (int i = 0; i < ds.Tables.Count; i++) //每一个入账类型的12个月的费用
            {
                Series s = new Series();
                //s.name = ds.Tables[i].Rows[0]["cateName"].ToString();
                List <object> obj = new List <object>();
                for (int j = 0; j < ds.Tables[i].Rows.Count; j++)
                {
                    float tname = Single.Parse(ds.Tables[i].Rows[j][1].ToString());  //入账费用

                    obj.Add(tname);
                }
                s.data             = obj;
                s.type             = ChartTypeEnum.column.ToString();
                s.allowPointSelect = false;

                ser.Add(s);
            }
            ser[0].name = "贷款";
            ser[1].name = "学费 ";
            ser[2].name = "考试费 ";
            ser[3].name = "外校包车费用";
            ser[4].name = "本校包车费用";
            ser[5].name = "外校场地租用费用";
            ser[6].name = "本校场地租用费用";
            HighChartOptions currentChart = new HighChartOptions();

            currentChart = new HighChartOptions()
            {
                //chart = new Chart()
                //{
                //    renderTo = "highChartDiv",
                //    type = ChartTypeEnum.area.ToString(),
                //    reflow=true
                //},
                title = new Title()
                {
                    text = checkedYear + "年入账统计图"
                },
                //xAxis = new List<XAxis>() {
                //    new XAxis(){
                //        categories = new List<string>() { "一月", "二月", "三月", "四月", "五月","六月", "七月", "八月", "九月", "十月","十一月","十二月" },
                //        reversed = false,
                //        opposite = false
                //    }
                //},
                yAxis = new YAxis()
                {
                    title = new Title()
                    {
                        text = checkedYear + "入账费用(元)"
                    }
                },
                //tooltip = new ToolTip() { crosshairs = new List<bool>() { true, false } },
                series = ser
            };
            return(currentChart);
        }