private void tlsUpdate_Click(object sender, EventArgs e) { try { if (grdProductManagement.CurrentRow.IsNotNull()) { string id = grdProductManagement.CurrentRow.Cells[0].Value.ToString(); var res = ProductList.Find(n => n.Id.IsEquals(id)); using (FrmProductEdit frm = new FrmProductEdit(res)) { if (DialogResult.OK == frm.ShowDialog()) { Query(); } } } else { Msg.ShowErrorMsg("请先选择要删除的数据"); } } catch (Exception ex) { Msg.ShowErrorMsg(ex); } }
private void btnAdd_Click(object sender, EventArgs e) { try { using (FrmProductEdit frm = new FrmProductEdit()) { if (DialogResult.OK == frm.ShowDialog()) { Query(); } } } catch (Exception ex) { Msg.ShowErrorMsg(ex); } }
private void grdProductManagement_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { string id = grdProductManagement[0, e.RowIndex].Value.ToString(); var res = ProductList.Find(n => n.Id.IsEquals(id)); using (FrmProductEdit frm = new FrmProductEdit(res)) { if (DialogResult.OK == frm.ShowDialog()) { Query(); } } } catch (Exception ex) { Msg.ShowErrorMsg(ex); } }
private void btnAddProduct_Click(object sender, EventArgs e) { FrmProductEdit frm = new FrmProductEdit(); frm.ShowDialog(); }