Web/ReportMgr/CityWeekStat.aspx.cs

(完整代码) 2KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CityMgr;
using RhData;
using System.Data;
using CityMgr.Base;
using CityMgr.Report;
using System.Transactions;

namespace WebApp.ReportMgr
{
    public partial class CityWeekStat : System.Web.UI.Page
    {
        protected LxUserContext m_uct = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            m_uct = Session["UserContext"] as LxUserContext;
            if (m_uct == null)
                Response.Redirect("../Login.aspx");

            AjaxPro.Utility.RegisterTypeForAjax(typeof(CityWeekStat));
            AjaxPro.Utility.RegisterTypeForAjax(typeof(LxAjaxEntityHelpper));
            AjaxPro.Utility.RegisterTypeForAjax(typeof(LxEasyUITableHelperr));
            AjaxPro.Utility.RegisterTypeForAjax(typeof(LxAjaxFunction));
            AjaxPro.Utility.RegisterTypeForAjax(typeof(LxUserContext));
            AjaxPro.Utility.RegisterTypeForAjax(typeof(LxEasyUITreeNode));
        }

        /// <summary>
        /// 获取统计数据
        /// </summary>
        /// <param name="strDeptCode">部门编码</param>
        /// <param name="beginTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns></returns>
        [AjaxPro.AjaxMethod]
        public string GetStatData(string strDeptCode, string beginTime, string endTime)
        {
            string sql = "";
            sql = "select CRI.cRptItemCode as RptItemCode,max(RI.cRptItemName) as RptItemName,count(CRI.gId) as Num,cast(sum(CRI.iLocateNum) as varchar(10)) + ' '+ max(CRI.cItemUnit) as iLocateNum,cast(sum(CRI.iRepairNum) as varchar(10)) + ' '+max(CRI.cItemUnit) as iRepairNum "
                + " from CityWeekReport CWR inner join CityReportItem CRI on CWR.cDateCode=CRI.cDateCode and CWR.cSbrDeptCode=CRI.cSbrDeptCode inner join ReportItem RI on CRI.cRptItemCode=RI.cRptItemCode "
                + " where CWR.dSbTime>='" + Sql.Format(beginTime) + "' and CWR.dSbTime<='" + Sql.Format(endTime) + "' and CWR.cSbrDeptCode like '" + Sql.Format(strDeptCode) + "%' group by CRI.cRptItemCode";

            using (DataTable data = Sql.ExecuteDataset(CommandType.Text, sql).Tables[0])
            {
                return LxEasyUITableHelperr.DataToJson(data);
            }
        }
    }
}

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

AI 解读 AI

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

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