private void WriteOutputInvoice(List<InvoiceExcel> invoiceExcels) { string outputDir = Path.Combine(Output_OpenFolder.FileName, "OutputData"); string path; try { path = Path.Combine(outputDir, "InvoiceInfo.xml"); XMLHelpper.WriteXML<List<InvoiceExcel>>(path, invoiceExcels); } catch (Exception ex) { ErrorMessage.AppendLine(string.Format("Write file fail. =>Err: {0}", ex.Message)); } try { path = Path.Combine(outputDir, "InvoiceInsertScript.sql"); if (!Directory.Exists(outputDir)) { Directory.CreateDirectory(outputDir); } File.WriteAllText(path, OutputInvoice.ToString()); } catch (Exception ex) { ErrorMessage.AppendLine(string.Format("Write file fail. =>Err: {0}", ex.Message)); } }
private void WriteOutputwarehouseDetail(List <WarehouseDetailE> warehouseDetailEs) { string outputDir = Path.Combine(Warehouse_openFolder.FileName, "OutputData"); string path; try { path = Path.Combine(outputDir, "warehouseDetailInfo.xml"); XMLHelpper.WriteXML <List <WarehouseDetailE> >(path, warehouseDetailEs); } catch (Exception ex) { ErrorMessage.AppendLine(string.Format("Write file fail. =>Err: {0}", ex.Message)); } try { path = Path.Combine(outputDir, "warehouseDetailInsertScript.sql"); if (!Directory.Exists(outputDir)) { Directory.CreateDirectory(outputDir); } File.WriteAllText(path, OutputWarehouseDetail.ToString()); } catch (Exception ex) { ErrorMessage.AppendLine(string.Format("Write file fail. =>Err: {0}", ex.Message)); } }
private void ChungTuGhiSo_Button_Click(object sender, EventArgs e) { string path = GetPathFile(nameof(ChungTuGhiSo)); List <ChungTuGhiSo> chungTuGhiSos = GetChungTuGhiSo(); XMLHelpper.WriteXML <List <ChungTuGhiSo> >(path, chungTuGhiSos); MessageBox.Show("Success!"); }
public static void WriteConfig() { string path = Path.Combine(Directory.GetCurrentDirectory(), BSConst.ConfigFile_Path); XMLHelpper.WriteXML <XMLConfigInfo>(path, CommonInfo.ConfigInfo); }