protected void btn_Export_Click(object sender, System.EventArgs e) { DataTable dataTable = PageBase.dbo.GetDataTable("SELECT AutoID AS 自动编号,OrderNo AS 订单编号,UserName AS 会员名称, CASE OrderStatus WHEN 0 THEN '待审核' WHEN 1 THEN '待付款' WHEN 10 THEN '配货中' WHEN 11 THEN '已发货' WHEN 12 THEN '已签收' WHEN 99 THEN '已完结' WHEN -1 THEN '订单作废' WHEN -2 THEN '退货' END AS 订单状态, AddOrderMethod AS 添加方式,Consignee AS 收件人,Province AS 省份,City AS 城市, Address AS 地址,Phone AS 电话,Mobile AS 手机,PayName AS 支付方式,Remark AS 备注, OrderTotalAmount AS 订单金额,OrderShippingFee AS 订单运费,OrderAddTime AS 创建时间 FROM shop_Orders WHERE " + this.GetCondition()); if (dataTable != null && dataTable.Rows.Count > 0) { string path = base.Server.MapPath(base.ExportFolder + "Orders.xls"); DataToXSL.CreateXLS(dataTable, path, true); base.Response.Redirect("/include/download?file=" + DEncryptUtils.DESEncode(base.ExportFolder + "Orders.xls")); } else { base.ShowMsg("没有找到任何记录"); } }
protected void btn_Export_Click(object sender, System.EventArgs e) { DataTable dataTable = PageBase.dbo.GetDataTable("SELECT AutoID AS Ma,UserName AS TenDangNhap,Email,Mobile, RealName,Gender,Birthday, AutoTimeStamp,LoginCount,LastLoginTime FROM cms_User WHERE " + this.GetCondition()); if (dataTable != null && dataTable.Rows.Count > 0) { string text = base.ExportFolder + StringUtils.GetRandomNumber() + ".xls"; DataToXSL.CreateXLS(dataTable, base.Server.MapPath(text), true); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "download", "<script>location='/include/download?file=" + DEncryptUtils.DESEncode(text) + "'</script>", false); } else { base.ShowMsg("Không có dữ liệu tìm thấy"); } }
protected void btn_Export_Click(object sender, System.EventArgs e) { DataTable dataTable = PageBase.dbo.GetDataTable("SELECT AutoID AS 自动编号,CategoryName AS 分类名称,Identifier AS 分类标识,ParentID AS 上级分类,Depth AS 层级, ChildCount AS 子分类个数,ChildList AS 子分类,CategoryImage AS 分类图片,SeoKey AS 搜索关键字,SeoDescription AS 搜索描述, CustomLink AS 自定义链接,Creator AS 创建者,Sort AS 排序,Lang AS 当前语言,AutoTimeStamp AS 创建时间 FROM shop_Category WHERE " + this.GetCondition()); if (dataTable != null && dataTable.Rows.Count > 0) { string text = base.ExportFolder + StringUtils.GetRandomNumber() + ".xls"; text = base.Server.MapPath(text); DataToXSL.CreateXLS(dataTable, text, true); ResponseUtils.ResponseFile(text); } else { base.ShowMsg("没有找到任何记录"); } }
protected void btn_Export_Click(object sender, System.EventArgs e) { DataTable dataTable = PageBase.dbo.GetDataTable("SELECT \tAutoID AS MaSo,SellType AS Sales type,ProductName,ProductSN,ProImg, Stock,MarketPrice,SellPrice,BuyLimit,ProDetail, SEOKey,SEODescription,case Status when 99 then 'Đã duyệt' else 'Chưa duyệt' end AS trạng thái, Sort,Lang,AutoTimeStamp FROM shop_Product WHERE " + this.GetCondition()); if (dataTable != null && dataTable.Rows.Count > 0) { string text = base.ExportFolder + StringUtils.GetRandomNumber() + ".xls"; text = base.Server.MapPath(text); DataToXSL.CreateXLS(dataTable, text, true); ResponseUtils.ResponseFile(text); } else { base.ShowMsg("Không có dữ liệu tìm thấy"); } }