public List <Jzxinfo> JzxToJzxinfo(List <Jzx> jzxList) { List <Jzxinfo> list = new List <Jzxinfo>(); char[] separator = new char[] { '_' }; foreach (Jzx current in jzxList) { List <string> jzxBs = current.getJzxBs(); for (int i = 0; i < jzxBs.Count; i++) { string text = jzxBs[i]; string[] array = text.Split(separator); Jzxinfo jzxinfo = new Jzxinfo(); jzxinfo.setBzdh(current.getCbfbm()); jzxinfo.setQdh(array[0]); jzxinfo.setZdh(array[1]); jzxinfo.setTsbc(double.Parse(array[4])); jzxinfo.setJxxz("确定界"); jzxinfo.setJzxlb(array[2]); jzxinfo.setJzxwz(array[3]); jzxinfo.setQdzb(array[5]); jzxinfo.setZdzb(array[6]); list.Add(jzxinfo); } } return(list); }
public List <string> JzxDhChange(List <Jzx> jzxs, Dictionary <string, List <Jzxinfo> > dic) { List <string> list = new List <string>(); foreach (Jzx current in jzxs) { List <string> jzxBs = current.getJzxBs(); string cbfbm = current.getCbfbm(); List <Jzxinfo> list2; dic.TryGetValue(cbfbm, out list2); if (list2 == null) { list.Add("mdb中没有找到编码,请查找问题,宗地编码是:" + cbfbm); } else { int count; if (jzxBs.Count != list2.Count) { list.Add("界址线数量与mdb对不上,请查找问题,宗地编码是:" + cbfbm); if (jzxBs.Count > list2.Count) { count = list2.Count; } else { count = jzxBs.Count; } } else { count = jzxBs.Count; } for (int i = 0; i < count; i++) { string text = jzxBs[i]; string[] array = text.Split(this.jzxCh); Jzxinfo jzxinfo = list2[i]; array[0] = jzxinfo.getQdh(); array[1] = jzxinfo.getZdh(); jzxBs[i] = Utils.ListToStr(array, "_"); } } } return(list); }
public static Dictionary <string, List <Jzxinfo> > MdbToJzxinfo(string mdbPath) { DataTable dataTable = OperateMdb.ReadAllData("jzxinfo", mdbPath, true); DataRowCollection rows = dataTable.Rows; List <Jzxinfo> list = null; Dictionary <string, List <Jzxinfo> > dictionary = new Dictionary <string, List <Jzxinfo> >(); foreach (DataRow dataRow in rows) { object[] itemArray = dataRow.ItemArray; Jzxinfo jzxinfo = new Jzxinfo(); int i = 0; while (i < itemArray.Length) { switch (i) { case 0: jzxinfo.setBzdh((string)itemArray[i]); break; case 2: jzxinfo.setQdh((string)itemArray[i]); break; case 3: jzxinfo.setZdh((string)itemArray[i]); break; case 4: { double tsbc = 0.0; try { tsbc = double.Parse((string)itemArray[i]); } catch { } jzxinfo.setTsbc(tsbc); break; } } IL_E4: i++; continue; goto IL_E4; } if (jzxinfo.getTsbc() > 0.0) { dictionary.TryGetValue(jzxinfo.getBzdh(), out list); if (list == null) { list = new List <Jzxinfo>(); list.Add(jzxinfo); dictionary.Add(jzxinfo.getBzdh(), list); } else { list.Add(jzxinfo); } } } return(dictionary); }