private void vehForm_FormClosing(object sender, FormClosingEventArgs e) { if (changed) { if (DialogResult.OK == MessageBox.Show("是否保存修改", "车辆设置", MessageBoxButtons.OKCancel)) { saveToSqlite(); } } m_veh.close(); }
private info getInfo() { info one = new info(); one.n = m_items.Count; vehTool m_veh = new vehTool("D:\\logistics data\\address-backup.sqlite"); List <Veh> vehs = m_veh.GetVehs(); m_veh.close(); one.nj = vehs[0].number; one.nx = vehs[1].number; one.Lj = vehs[0].distance; one.Lx = vehs[1].distance; one.Vj = vehs[0].capacity; one.Vx = vehs[1].capacity; one.Cj = vehs[0].cost; one.Cx = vehs[1].cost; envTool m_env = new envTool("D:\\logistics data\\address-backup.sqlite"); one.Pt = m_env.getLoadTime(); one.At = m_env.getWorkTime(); m_env.close(); addrAnalyser m_addr = new addrAnalyser(m_items, false); List <PointLatLng> points = m_addr.getTargets(); List <good> targets = new List <good>(); good center = new good(); center.pos = points[0]; targets.Add(center); for (int i = 0; i < one.n; ++i) { good g = new good(); g.pos = points[i + 1]; } return(one); }