示例#1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string text = WebUtils.GetQueryString("file");

            try
            {
                text = DEncryptUtils.DESDecode(text);
            }
            catch
            {
                text = string.Empty;
            }
            string text2 = base.Server.MapPath(text);

            if (System.IO.File.Exists(text2))
            {
                FileUploadInfo model = PageBase.dbo.GetModel <FileUploadInfo>(" select top 1 * from sys_FileUpload where VirtualPath='" + text + "' ");
                if (model != null)
                {
                    model.DownloadCount++;
                    FileUpload.Update(model);
                }
                ResponseUtils.ResponseFile(text2);
            }
            else
            {
                base.Response.Write(base.GetCaption("CMS_FileNotExist"));
                base.Response.End();
            }
        }
示例#2
0
        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("没有找到任何记录");
            }
        }
示例#3
0
        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");
            }
        }