/// <summary> /// 编辑-新增产品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void menuEditProductAdd_Click(object sender, EventArgs e) { using (ProductEditDialog dlg = new ProductEditDialog(0)) { if (dlg.ShowDialog() == DialogResult.OK) { // 刷新列表 ReloadProductList(); } } }
/// <summary> /// 编辑-修改产品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void menuEditProductEdit_Click(object sender, EventArgs e) { if (lvProductList.SelectedItems.Count <= 0) { return; } ListViewItem lvi = lvProductList.SelectedItems[0]; if (lvi != null) { Product product = (Product)lvi.Tag; using (ProductEditDialog dlg = new ProductEditDialog(product.Id)) { if (dlg.ShowDialog() == DialogResult.OK) { // 刷新列表 ReloadProductList(); } } } }