private void btnAdd_Click(object sender, EventArgs e) { if (cboxCust.SelectedIndex == -1) { return; } Customer cust = cboxCust.SelectedItem as Customer; CustAcntForm acntForm = new CustAcntForm(manager, cust, null); DialogResult rslt = acntForm.ShowDialog(); if (DialogResult.OK == rslt) { btnQuery_Click(btnQuery, new EventArgs()); } }
private void dtgvAcnt_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow curRow = dtgvAcnt.CurrentRow; if (null != curRow && null != cboxCust.SelectedItem) { Customer cust = cboxCust.SelectedItem as Customer; CustAcnt acnt = new CustAcnt(); acnt.AcntNO = StringUtil.Obj2Str(curRow.Cells[colAcntNO.Name].Value); acnt.AcntType = StringUtil.Obj2Str(curRow.Cells[colAcntType.Name].Value); acnt.CustID = StringUtil.Obj2Int(curRow.Cells[colCustID.Name].Value); acnt.ID__PK = StringUtil.Obj2Long(curRow.Cells[colID.Name].Value); acnt.Platform = StringUtil.Obj2Str(curRow.Cells[colPlatform.Name].Value); acnt.St = StringUtil.Obj2Str(curRow.Cells[colSt.Name].Value); CustAcntForm acntForm = new CustAcntForm(manager, cust, acnt); DialogResult rslt = acntForm.ShowDialog(); if (DialogResult.OK == rslt) { btnQuery_Click(btnQuery, new EventArgs()); } } }