protected void btnGoodsExpenseExcel_Click(object sender, EventArgs e) { int Counts = this.NetPagerParameter.RecordCount; string strSql = this.QueryCondition(); string strWhere = " and " + this.QueryCondition(); string strStartTime = this.txtStartTime.Value; string strEntTime = this.txtEndTime.Value; if (strStartTime != "") { strSql = strSql + " and OrderCreateTime>='" + strStartTime + "'"; strWhere = strWhere + " and OrderCreateTime>='" + strEntTime + "'"; } if (strEntTime != "") { DateTime strEntTimes = Convert.ToDateTime(strEntTime).AddDays(1.0); object obj = strSql; strSql = string.Concat(new object[] { obj, " and OrderCreateTime<'", strEntTimes, "'" }); obj = strWhere; strWhere = string.Concat(new object[] { obj, " and OrderCreateTime<'", strEntTimes, "'" }); } strSql += " and OrderLog.OrderType != 4 AND OrderLog.OrderType != 5 AND OrderLog.OrderType != 3"; strSql = PubFunction.GetShopAuthority(this._UserShopID, "OrderLog.OrderShopID", strSql); Chain.BLL.Goods bllGoods = new Chain.BLL.Goods(); DataTable dt = bllGoods.GetGoodsExpense(10000000, 1, out Counts, new string[] { strSql }).Tables[0]; DataExcelInfo.GoodsExpensExcel(dt, this._UserName, strWhere); }