/// <summary> /// 新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { FormEFUserEdit frmUserEditInfo = new FormEFUserEdit(); // 工具栏为新增操作 toolBar.Tag = "ADD"; // 对话框为新增操作 frmUserEditInfo.Tag = "ADD"; // 订阅表格更新事件 frmUserEditInfo.OnUpdateView += UpdateViewShow; frmUserEditInfo.ShowDialog(); }
/// <summary> /// 编辑条目 /// </summary> private void OnEdit() { FormEFUserEdit frmUserEditInfo = new FormEFUserEdit(); // 工具栏为编辑操作 toolBar.Tag = "EDIT"; // 对话框为编辑操作 frmUserEditInfo.Tag = "EDIT"; // 获得表格中选中的记录 frmUserEditInfo.EditedUserDto = gvUser.GetFocusedRow() as UserDto; // 订阅表格更新事件 frmUserEditInfo.OnUpdateView += UpdateViewShow; frmUserEditInfo.ShowDialog(); }