WebUI/reports/memberage.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace hyst.reports
{
    using DBUtility;
    using DevExpress.XtraCharts;
    using DevExpress.XtraCharts.Web;
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class memberage : Page
    {
        private BaseClass bc = new BaseClass();
        public string cmbArea = "全部";
        public string cmbCity = "";
        public string cmbProvince = "";
        private string dianpu;
        private string ed;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        protected HiddenField HiddenField1;
        private string sd;
        protected WebChartControl WebChartControl1;

        private void DrawPie()
        {
            string title = "年龄段会员统计比例饼状图";
            ChartServices.SetChartTitle(this.WebChartControl1, true, title, StringAlignment.Center, ChartTitleDockStyle.Top, true, new Font("宋体", 12f, FontStyle.Bold), Color.Red, 10);
            ChartServices.DrawChart(this.WebChartControl1, "人数", ViewType.Pie, this.llnian(), "nian", "count");
        }

        public DataTable llnian()
        {
            string sql = "select N'nian'=(case((datediff(year,mBirth,getdate() )-1)/10) when 5 then '50岁以上'   when 4 then '41-50岁'   when 3 then '31-40岁' when 2 then'21-30岁'else '20岁以下'end),   count(*) as count     from membersinfo where 1=1  ";
            if (this.cmbProvince != "")
            {
                sql = sql + "and  charindex('" + this.cmbProvince + "', mProvince)>0";
            }
            if (this.cmbCity != "")
            {
                sql = sql + "and  charindex('" + this.cmbCity + "',mCity)>0";
            }
            if (this.cmbArea != "全部")
            {
                sql = sql + "and  charindex('" + this.cmbArea + "', mTown)>0";
            }
            if (this.dianpu != "NONE")
            {
                sql = sql + "  and mShopNum='" + this.dianpu + "'";
            }
            if ((this.sd != "") && (this.ed != ""))
            {
                string name5 = sql;
                sql = name5 + " and mMakedate between '" + this.sd + "' and '" + this.ed + "'";
            }
            sql = sql + "group by (case((datediff(year,mBirth,getdate())-1)/10)when 5 then '50岁以上'   when 4 then '41-50岁'   when 3 then '31-40岁' when 2 then'21-30岁'else '20岁以下'end)";
            return this.bc.ReadTable(sql);
        }
后面还有 23 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。