public void SaveIpModelExecute(object parameter) { if (parameter is Button) { Button button = parameter as Button; if (this.IpModel == null) { //新增 ControllerCenter.Model.IpModel p = new ControllerCenter.Model.IpModel(); IpModelStore.AddIpModel(p); MessageBox.Show("新增成功!"); } else { //修改 this.IpModel.IpName = this.IpName; IpModelStore.ModifyIpModel(this.IpModel); MessageBox.Show("修改成功!"); } } // this._IpModelInfo.DialogResult = true; // this._IpModelInfo.Close(); }
private void btnSave_Click(object sender, RoutedEventArgs e) { ControllerCenter.Model.IpModel obj = new Model.IpModel(); obj = this.DataContext as ControllerCenter.Model.IpModel; IpModelStore.ModifyIpModel(obj); }