Esempio n. 1
0
 protected void btnDownloadTemplate_Click(object sender, EventArgs e)
 {
     BPSC.Common.ExcelTemplate excelTemplalte = new BPSC.Common.ExcelTemplate("Product_Import_Template.xls");
     excelTemplalte.Export("Product_Import_Template" + DateTime.Now.ToString("yyyy-MM-dd") + ".xls");
 }
Esempio n. 2
0
 protected void btnExportTemplate_Click(object sender, EventArgs e)
 {
     if (this.lib.Items.Count == 0)
     {               
         AlertMessage("Select Condition");
         return;
     }
     DataTable dt = MainService.ProductBLLService.GetProductDataForNormalRaid(GetProductFilters(), ActionDate);
     if (dt.Rows.Count == 0)
     {
         AlertMessage("No found data!");
         return;
     }
     #region Wrap DataTable
     // Activity ,GBU,Category,Brand,"Brand Tpye",Subcategory,"SAP Item ChineseDescription","Brand Size",CasePackage,"Unit item","产品规格说明 (促销产品请列明内含的所有规格及赠品)","SAP 产品英文注释"
     DataTable dtWrap = new DataTable();
     dtWrap.Columns.Add("Activity", typeof(string));
     dtWrap.Columns.Add("GBU", typeof(string));
     dtWrap.Columns.Add("Category", typeof(string));
     dtWrap.Columns.Add("Brand", typeof(string));
     dtWrap.Columns.Add("BrandTpye", typeof(string));
     dtWrap.Columns.Add("Subcategory", typeof(string));
     dtWrap.Columns.Add("DESC_CN", typeof(string));
     dtWrap.Columns.Add("Product_Type", typeof(string));
     dtWrap.Columns.Add("BrandSize", typeof(string));
     dtWrap.Columns.Add("CasePackage", typeof(string));
     dtWrap.Columns.Add("Unit_Item", typeof(string));
     dtWrap.Columns.Add("Specification", typeof(string));
     dtWrap.Columns.Add("DESC_EN", typeof(string));
     DataRow rowWrap = null;
     foreach (DataRow row in dt.Rows)
     {
         rowWrap = dtWrap.NewRow();
         rowWrap["Activity"] = ActivityName;
         rowWrap["GBU"] = row[ProductTable.C_GBU];
         rowWrap["Category"] = row[ProductTable.C_Category];
         rowWrap["Brand"] = row[ProductTable.C_Brand];
         rowWrap["BrandTpye"] = row[ProductTable.C_BrandType];
         rowWrap["Subcategory"] = row[ProductTable.C_SubCategory];
         rowWrap["DESC_CN"] = row[ProductTable.C_DESC_CN];
         rowWrap["Product_Type"] = row[ProductTable.C_Product_Type];
         rowWrap["BrandSize"] = row[ProductTable.C_Product_Size];
         rowWrap["CasePackage"] = row[ProductTable.C_Case_Package];
         rowWrap["Unit_Item"] = "0";
         rowWrap["Specification"] = row[ProductTable.C_Specification];
         rowWrap["DESC_EN"] = row[ProductTable.C_DESC_EN];
         dtWrap.Rows.Add(rowWrap);
     }
     #endregion
     //BPS.Common.ExcelHelper.ExportToCsvFile(this, dt, ActivityName, ActivityName + "_" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss"));
     BPSC.Common.ExcelTemplate excelTemplalte = new BPSC.Common.ExcelTemplate("Product_Filter_Template.xls");
     excelTemplalte.Export(dtWrap, ActivityName.Replace(' ', '_') + "_" + DateTime.Now.ToString("yyyy-MM-dd") + ".xls");
 }
Esempio n. 3
0
 protected void btnErrFileClick(object sender, EventArgs e)
 {
     BPSC.Common.ExcelTemplate excelTemplalte = new BPSC.Common.ExcelTemplate("Product_Import_Template.xls");
     excelTemplalte.Export(errFile.CommandArgument, "ProductErrorRowData" + DateTime.Now.ToString("yyyy-MM-dd") + ".xls");
     errFile.Visible = false;
 }