Example #1
0
        protected void btnRptPointRateExcel_Click(object sender, EventArgs e)
        {
            string        strStartTime = this.txtStartTime.Value;
            string        strEntTime   = this.txtEndTime.Value;
            StringBuilder strTime      = new StringBuilder();
            string        strSql       = this.QueryCondition();

            if (strStartTime != "")
            {
                this.strwhere.AppendFormat(" and POINTCREATETIME>='{0}'", strStartTime);
                strTime.AppendFormat(" and PointLOG.POINTCREATETIME>='{0}' ", strStartTime);
            }
            if (strEntTime != "")
            {
                this.strwhere.AppendFormat(" and POINTCREATETIME<='{0}'", strEntTime);
                strTime.AppendFormat(" and PointLOG.POINTCREATETIME<='{0}'", strEntTime);
            }
            PointRate bllPointRate = new PointRate();
            int       Counts       = this.NetPagerParameter.RecordCount;

            strSql += "and MEM.MEMID<>0 AND MEM.MEMSHOPID=SYSSHOP.SHOPID";
            strSql += " AND MEM.MEMLEVELID=MEMLEVEL.LEVELID";
            strSql += " AND MEM.MEMUSERID=SYSUSER.USERID";
            if (RptPointRate.MemCardId != null)
            {
                strSql += string.Format(" and Mem.MemCard={0}", RptPointRate.MemCardId);
            }
            strSql = PubFunction.GetShopAuthority(this._UserShopID, "MemShopID", strSql);
            DataTable db = bllPointRate.GetListSP(Counts, this.NetPagerParameter.CurrentPageIndex, out Counts, strTime.ToString(), new string[]
            {
                strSql
            }).Tables[0];

            DataExcelInfo.PointRateExcel(db, this._UserName, this.strwhere.ToString());
        }