Example #1
0
        /// <summary>
        /// 导出Excel数据集
        /// </summary>
        /// <returns></returns>
        public DataTable GetSum(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select COUNT(*) as [Count],ISNULL(SUM(ISNULL(GrossWeight,0)),0) as GrossWeight,ISNULL(SUM(ISNULL(Tare,0)),0) as Tare,ISNULL(SUM(ISNULL(NetWeight,0)),0) as NetWeight,ISNULL(SUM(ISNULL(Amount,0)),0) as Amount from T_Bill ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where 1=1 " + strWhere);
            }

            return(DbHelperSQL.ExecuteDataTable(CommandType.Text, strSql.ToString(), null));
        }