public CouponForm(WxCoupon wxCoupon, CouponManagementForm form) { InitializeComponent(); this.form = form; if (wxCoupon != null) { this.wxCoupon = wxCoupon; } }
//编辑 private void ToolEdit_Click(object sender, EventArgs e) { if (dgv.CurrentCell == null) { BathClass.printErrorMsg("需要先选择优惠券所在行!"); return; } WxCoupon wxCoupon = new WxCoupon(); wxCoupon.id = MConvert <int> .ToTypeOrDefault(dgv.CurrentRow.Cells[0].Value, 0); wxCoupon.title = dgv.CurrentRow.Cells[1].Value.ToString(); wxCoupon.value = MConvert <double> .ToTypeOrDefault(dgv.CurrentRow.Cells[2].Value, 0); wxCoupon.descp = dgv.CurrentRow.Cells[3].Value.ToString(); var form = new CouponForm(wxCoupon, this); if (form.ShowDialog() == DialogResult.OK) { dgv_show(); } }
//编辑 private void ToolEdit_Click(object sender, EventArgs e) { if (dgv.CurrentCell == null) { BathClass.printErrorMsg("需要先选择优惠券所在行!"); return; } WxCoupon wxCoupon = new WxCoupon(); wxCoupon.id = MConvert<int>.ToTypeOrDefault(dgv.CurrentRow.Cells[0].Value, 0); wxCoupon.title = dgv.CurrentRow.Cells[1].Value.ToString(); wxCoupon.value = MConvert<double>.ToTypeOrDefault(dgv.CurrentRow.Cells[2].Value, 0); wxCoupon.descp = dgv.CurrentRow.Cells[3].Value.ToString(); var form = new CouponForm(wxCoupon, this); if (form.ShowDialog() == DialogResult.OK) { dgv_show(); } }