WebUI/reportnew/comyear.aspx.cs

(开头部分) 5KB

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

namespace hyst.reportnew
{
    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 comyear : Page
    {
        private BaseClass bc = new BaseClass();
        private string dianpu;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        protected HiddenField HiddenField1;
        private ViewType types = ViewType.Bar;
        protected WebChartControl WebChartControl1;
        public string year = DateTime.Now.ToString("yyyy-MM-dd");

        private void DrawPie()
        {
            string title = DateTime.Parse(this.year).AddYears(-1).ToString("yyyy") + "年与" + DateTime.Parse(this.year).ToString("yyyy") + "年的会员消费金额统计分析图";
            ChartServices.SetChartTitle(this.WebChartControl1, true, title, StringAlignment.Center, ChartTitleDockStyle.Top, true, new Font("宋体", 12f, FontStyle.Bold), Color.Red, 10);
            if (this.types == ViewType.Bar)
            {
                ChartServices.DrawChart(this.WebChartControl1, "会员卡", this.types, this.load(), "类型", "会员卡");
                ChartServices.DrawChart(this.WebChartControl1, "临时卡", this.types, this.load(), "类型", "临时卡");
                ChartServices.DrawChart(this.WebChartControl1, "散客卡", this.types, this.load(), "类型", "散客卡");
            }
            else
            {
                ChartServices.DrawChart(this.WebChartControl1, "上年", this.types, this.loadz(), "CardType", "上年");
                ChartServices.DrawChart(this.WebChartControl1, "本年", this.types, this.loadz(), "CardType", "本年");
            }
        }

        public DataTable load()
        {
            string sql = "select CardType,sum(case datediff(year,Addtime,'" + this.year + "') when 0 then CONVERT(decimal(18, 2),[money]) else 0.00 end) as '本年',sum(case DATEDIFF(year,Addtime,'" + this.year + "') when 1 then CONVERT(decimal(18, 2),[money]) else 0.00 end) as '上年' from Consumption_Back_select ";
            if (this.dianpu != "NONE")
            {
                sql = sql + " where 1=1 and ShopId='" + this.dianpu + "'";
            }
            sql = sql + " group by CardType";
            DataTable dt = this.bc.ReadTable(sql);
            DataTable dtz = new DataTable();
            dtz.Columns.Add("类型", typeof(string));
            dtz.Columns.Add("会员卡", typeof(decimal));
            dtz.Columns.Add("临时卡", typeof(decimal));
            dtz.Columns.Add("散客卡", typeof(decimal));
            if (dt.Rows.Count == 0)
            {
                dtz.Rows.Add(new object[] { dt.Columns[2].ColumnName, "0", "0", "0" });
                dtz.Rows.Add(new object[] { dt.Columns[1].ColumnName, "0", "0", "0" });
                return dtz;
            }
后面还有 55 行代码,购买后查看完整代码

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

AI 解读

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

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