/// <summary>
        /// 匯出csv
        /// </summary>
        /// <returns></returns>
        public HttpResponseBase ProductCategoryCSV()
        {
            string newCsvName = string.Empty;
            string json = string.Empty;
            DataTable dt = new DataTable();
            CategoryQuery query = new CategoryQuery();
            if (!string.IsNullOrEmpty(Request.Params["Root"]))
            {
                query.category_father_id = Convert.ToUInt32(Request.Params["Root"]);
            }

            List<ProductCategory> categoryList = new List<ProductCategory>();
            List<ProductCategoryCustom> cateList = new List<ProductCategoryCustom>();
            // _procateMgr = new ProductCategoryMgr(connectionString);
            _proCategoryImplMgr = new CategoryMgr(mySqlConnectionString);
            dt.Columns.Add(new DataColumn("", typeof(string)));
            DataRow dr = dt.NewRow();
            dr[0] = query.category_father_id.ToString() + "   " + _proCategoryImplMgr.GetProductCategoryById(new CategoryQuery { category_id = query.category_father_id }).category_name;//根
            dt.Rows.Add(dr);
            //  categoryList = _procateMgr.GetProductCate(new ProductCategory { });//數據源
            categoryList = _proCategoryImplMgr.GetProductCategoryCSV(query);


            cateList = getCate(categoryList, query.category_father_id.ToString());//得到第二層分支
            // cateList={1,2,3,4};

            //調試resultlist是否為空
            GetCategoryList(categoryList, ref cateList, ref dt, 1);

            try
            {

                string filename = "ProductCategory_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".csv";
                if (!System.IO.Directory.Exists(Server.MapPath(excelPath)))
                {
                    System.IO.Directory.CreateDirectory(Server.MapPath(excelPath));
                }
                newCsvName = Server.MapPath(excelPath) + filename;

                if (System.IO.File.Exists(newCsvName))
                {
                    //設置文件的屬性,以防刪除文件的時候因為文件的屬性造成無法刪除
                    System.IO.File.SetAttributes(newCsvName, FileAttributes.Normal);
                    System.IO.File.Delete(newCsvName);
                }
                string[] colname = { };

                CsvHelper.ExportDataTableToCsv(dt, newCsvName, colname, false);
                json = "true," + filename + "," + excelPath;

            }
            catch (Exception ex)
            {
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
                json = "false, ";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;

        }