private void Get_ParameterList(string strSql) { string strStartTime = this.txtStartTime.Value; string strEntTime = this.txtEndTime.Value; if (strStartTime != "") { strSql = strSql + " and OrderCreateTime>='" + strStartTime + "'"; } if (strEntTime != "") { strSql = strSql + " and OrderCreateTime<'" + PubFunction.TimeEndDay(strEntTime) + "'"; } strSql += " AND OrderLog.OrderType != 4 AND OrderLog.OrderType != 5 "; Chain.BLL.Goods bllGoods = new Chain.BLL.Goods(); int Counts = this.NetPagerParameter.RecordCount; strSql = PubFunction.GetShopAuthority(this._UserShopID, "OrderLog.OrderShopID", strSql); DataTable dt = bllGoods.GetGoodsExpense(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[] { strSql }).Tables[0]; this.NetPagerParameter.RecordCount = Counts; this.NetPagerParameter.CustomInfoHTML = string.Format("<div class=\"results\"><span>当前第{0}/{1}页 共{2}条记录 每页{3}条</span></div>", new object[] { this.NetPagerParameter.CurrentPageIndex, this.NetPagerParameter.PageCount, this.NetPagerParameter.RecordCount, this.NetPagerParameter.PageSize }); this.rptGoods.DataSource = dt; this.rptGoods.DataBind(); PageBase.BindSerialRepeater(this.rptGoods, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1)); }
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); }