private void tsmiSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtImgSavePath.Text)) { MessageBox.Show("请选择图片保存路径"); return; } if (string.IsNullOrEmpty(txtParkNo.Text)) { MessageBox.Show("请输入本停车场系统编号"); return; } if (string.IsNullOrEmpty(txtUrl.Text)) { MessageBox.Show("请输入后台接口url地址"); return; } //暂时取消必须一进一出的限制 // if (tvGuard.Nodes.Count < 2) // { // MessageBox.Show("请设置至少一进一出"); // return; // } // else // { int x = tvGuard.Nodes.Cast <TreeNode>().Count(a => Convert.ToBoolean(a.Tag)); int y = tvGuard.Nodes.Cast <TreeNode>().Count(a => !Convert.ToBoolean(a.Tag)); if (x == 0 && y == 0) { MessageBox.Show("必须要设置出入口"); return; } // if (x == 0 || y == 0) // { // MessageBox.Show("请设置至少一进一出"); // return; // } foreach (TreeNode n in tvGuard.Nodes) { if ((!dict.ContainsKey(n.Text)) || (dict[n.Text].Count < 1)) { MessageBox.Show("请设置" + n.Text + "有关的摄像头配置"); return; } } // } Save(); //赋值到变量 //疑问 if (ChangeSettingDele != null) { ChangeSettingDele(); } //疑问 ParkSystemBLL psbll = new ParkSystemBLL(); psbll.SaveConfig(Params.Settings); this.Close(); }