private void tsbtnAdd_Click(object sender, EventArgs e) { try { FormRetailOrderEdit form = new FormRetailOrderEdit(); (Parent.FindForm() as frmMain).ShowForm(form); } catch (Exception ex) { Log.Error(ex); MessageBox.Show(ex.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void dgvMain_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (_retailOrderList != null && _retailOrderList.Count > 0) { RetailOrder ro = _retailOrderList[e.RowIndex]; if (dgvMain.Columns[e.ColumnIndex].Name == "View") { FormRetailOrderEdit form = new FormRetailOrderEdit(ro); form.ShowDialog(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); Log.Error(ex); } }