private void buttonAdd_Click(object sender, EventArgs e) { var form = new FormStockInfoModify(); form.SetMode(FormMode.ADD); form.SetAddFinishedCallback(() => { this.pagerWidget.Search(); }); form.Show(); }
private void buttonAlter_Click(object sender, EventArgs e) { var worksheet = this.reoGridControlMain.Worksheets[0]; try { if (worksheet.SelectionRange.Rows != 1) { throw new Exception(); } int stockInfoID = int.Parse(worksheet[worksheet.SelectionRange.Row, 0].ToString()); var formStockInfoModify = new FormStockInfoModify(stockInfoID); formStockInfoModify.SetModifyFinishedCallback(() => { this.searchWidget.Search(true); }); formStockInfoModify.Show(); } catch { MessageBox.Show("请选择一项进行修改", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }