Ejemplo n.º 1
0
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var win = new UserEditWindow();
         var ret = win.ShowDialog();
         if (ret.Value)
         {
             btnRefresh_Click(null, null);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
 private void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (this.dgvOperators.SelectedCells.Count < 1)
         {
             throw new Exception("未选择用户");
         }
         var op  = this.dgvOperators.SelectedCells[0].Item as Operator;
         var win = new UserEditWindow {
             Operator = op
         };
         var ret = win.ShowDialog();
         if (ret.Value)
         {
             btnRefresh_Click(null, null);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }