public string JzxTable() { try { object[] fromText = this.formService.ShowFourAddressForm(); JzxService jzxService = new JzxService(); List <Jzx> jzxQzb = jzxService.getJzxQzb(fromText); ExcelUtils excelUtils = new ExcelUtils(); excelUtils.CreateJzxQZ_Table(jzxQzb); } finally { this.deleteLayerSur("删除"); } return(""); }
private void button23_Click(object sender, EventArgs e) { Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; DocumentLock documentLock = mdiActiveDocument.LockDocument(); string text = FileUtils.SaveFileName(Path.GetDirectoryName(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> list2 = OperateMdb.OpJzxinfoSql(list); OperateMdb.InsertSql(list2, text); mdiActiveDocument.Editor.WriteMessage("mdb标示表生成完成\n"); object[] fromText = this.formService.ShowFourAddressForm(); List <Jzx> jzxQzb = jzxService.getJzxQzb(fromText); List <Qzb> qzbList = jzxService.JzxToQzb(jzxQzb); List <string> sqls = OperateMdb.OpQzbSql(qzbList); if (list2.Count != 0) { OperateMdb.InsertSql(sqls, text); } mdiActiveDocument.Editor.WriteMessage("mdb签章表生成完成\n"); documentLock.Dispose(); }
//标示表填写页面 public void WriteBSB_Page_X(ISheet isheet, int rowIndex, List <String> jzxBs, int startJzxIndex, int endJzxIndex) { JzxService jzxService = new JzxService(); Dictionary <String, String> dic = jzxService.GetjzxBSCorresponding(); Dictionary <String, String> zlDic = jzxService.GetJzxZLDic(); String zl = ""; IRow irow; ICell icell; //int cellIndex = 0; String outStr = ""; if (endJzxIndex > jzxBs.Count) { endJzxIndex = jzxBs.Count; } for (int a = startJzxIndex; a < endJzxIndex; a++) { String bs = jzxBs[a]; String[] bsArray = bs.Split('_'); if (bsArray[2].Equals("界址线")) { bsArray[3] = "中"; } irow = isheet.GetRow(rowIndex++); dic.TryGetValue("界址点号", out outStr); icell = irow.GetCell(int.Parse(outStr)); zlDic.TryGetValue(bsArray[2], out zl); zl = getJzxX_Jl(zl, jzxBs, a, zlDic); if (zl == null) { MessageBox.Show("你配的数据有问题:" + bsArray[2]); continue; } dic.TryGetValue(zl, out outStr); icell.SetCellValue(bsArray[0]); icell = irow.GetCell(int.Parse(outStr)); icell.SetCellValue("√ "); dic.TryGetValue("界址距离", out outStr); irow = isheet.GetRow(rowIndex++); icell = irow.GetCell(int.Parse(outStr)); double num = 0; double.TryParse(bsArray[4], out num); icell.SetCellValue(num); dic.TryGetValue(bsArray[2], out outStr); icell = irow.GetCell(int.Parse(outStr)); icell.SetCellValue("√ "); dic.TryGetValue(bsArray[3], out outStr); icell = irow.GetCell(int.Parse(outStr)); icell.SetCellValue("√ "); } irow = isheet.GetRow(rowIndex); icell = irow.GetCell(0); icell.SetCellValue(jzxBs[endJzxIndex - 1].Split('_')[1]); zlDic.TryGetValue(jzxBs[endJzxIndex - 1].Split('_')[2], out zl); zl = getJzxX_Jl(zl, jzxBs, endJzxIndex - 1, zlDic); if (zl == null) { return; } dic.TryGetValue(zl, out outStr); icell = irow.GetCell(int.Parse(outStr)); icell.SetCellValue("√ "); }