//新增 private void addTool_Click(object sender, EventArgs e) { StockForm addCoupon = new StockForm(db, null); if (addCoupon.ShowDialog() == DialogResult.OK) { dgv_show(); } }
//编辑 private void editTool_Click(object sender, EventArgs e) { if (dgv.CurrentCell == null) { GeneralClass.printErrorMsg("没有选择行!"); return; } int selId = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value); var stock = db.Stock.FirstOrDefault(x => x.id == selId); StockForm editCoupon = new StockForm(db, stock); if (editCoupon.ShowDialog() == DialogResult.OK) { dgv_show(); } }
//编辑 private void editTool_Click(object sender, EventArgs e) { if (dgv.CurrentCell == null) { GeneralClass.printErrorMsg("没有选择行!"); return; } int selId = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value); var stock = db.Stock.FirstOrDefault(x => x.id == selId); StockForm editCoupon = new StockForm(db, stock); if (editCoupon.ShowDialog() == DialogResult.OK) dgv_show(); }
//新增 private void addTool_Click(object sender, EventArgs e) { StockForm addCoupon = new StockForm(db, null); if (addCoupon.ShowDialog() == DialogResult.OK) dgv_show(); }