/// <summary> /// 新增事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtAppend_Click(object sender, RoutedEventArgs e) { var dialog = new RuleEdit(); dialog.Owner = this; dialog.Init(new RuleDto()); dialog.ShowDialog(); _Rules.Clear(); LoadRule(); }
/// <summary> /// 更新事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtUpdate_Click(object sender, RoutedEventArgs e) { var dto = DgList.SelectedItem as RuleDto; if (dto == null) { return; } var dialog = new RuleEdit(); dialog.Owner = this; dialog.Init(dto); dialog.ShowDialog(); _Rules.Clear(); LoadRule(); }