private void button10_Click(object sender, EventArgs e) { Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; DocumentLock documentLock = mdiActiveDocument.LockDocument(); string text = FileUtils.SaveFileName(Utils.CADDir(), "两表模板.mdb", "Access数据库(*.mdb)|*.mdb"); if (text == null) { text = Path.GetDirectoryName(Utils.CADDir()) + "\\两表模板.mdb"; } else { FileUtils.CopyFile("C:\\ZJDTemplete\\两表模板.mdb", text, true); } JzxService jzxService = new JzxService(); List <Jzx> jzxList; try { jzxList = jzxService.SetJzxBs(); } finally { UserControl1.utils.deleteLayerSur("删除"); } List <Jzxinfo> list = jzxService.JzxToJzxinfo(jzxList); List <string> sqls = OperateMdb.OpJzxinfoSql(list); OperateMdb.InsertSql(sqls, text); mdiActiveDocument.Editor.WriteMessage("mdb标示表生成完成\n"); documentLock.Dispose(); }
public string CreateJzxBsTable() { try { JzxService jzxService = new JzxService(); List <Jzx> jzxList = jzxService.SetJzxBs(); ExcelUtils excelUtils = new ExcelUtils(); excelUtils.CreateJzxBS_Table(jzxList); } finally { this.deleteLayerSur("删除"); } return(""); }