private void buttonXAdd_Click(object sender, EventArgs e) { EditBudgetAccountsForm form = new EditBudgetAccountsForm(); form.ShowDialog(); if (form.DialogResult == DialogResult.OK) { this.loadDataList(); } }
private void buttonXModify_Click(object sender, EventArgs e) { if (this.gridViewDataList.SelectedRowsCount == 0) { MessageBox.Show("请选择一条数据!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } m_selectRow = this.gridViewDataList.FocusedRowHandle; // 取出pk int selectRow = this.gridViewDataList.GetSelectedRows()[0]; int pk = Convert.ToInt32(this.gridViewDataList.GetRowCellValue(selectRow, "pk").ToString()); jt_ys_zm yszmModel = BudgetAccountsManager.Instance.GetModel(pk); EditBudgetAccountsForm form = new EditBudgetAccountsForm(); form.m_yszmModel = yszmModel; form.m_budgetAccountsForm = this; form.ShowDialog(); if (form.DialogResult == DialogResult.OK) { this.loadDataList(); } }