private void button14_Click(object sender, EventArgs e) { frmDiscount frm = new frmDiscount(); frm.OriginalAmt = Program.cartItems.Sum(p => p.Price); if (IsDiscount) { frm.DiscountType = DiscountType; frm.DiscountAmt = DiscountAmt; } frm.ShowDialog(); DiscountType = frm.DiscountType; DiscountAmt = frm.DiscountAmt; if (DiscountAmt > 0) { IsDiscount = true; if (DiscountType == EmDiscountType.Amount) { var _FinalAmt = frm.OriginalAmt - DiscountAmt; BindData(_FinalAmt); //RemAmount = RemAmount - DiscountAmt; } else if (DiscountType == EmDiscountType.Percent) { var _FinalAmt = frm.OriginalAmt - ((frm.OriginalAmt * DiscountAmt) / 100); BindData(_FinalAmt); } //BindData(RemAmount); txtAmount_TextChanged(txtAmount, null); } }
private void mtbDiscount_Click_1(object sender, EventArgs e) { frmDiscount f = new frmDiscount(studentData, int.Parse(tbSemNo.Text)); f.ShowDialog(); if (f.hasUpdated) { textBox1_TextChanged(null, null); } }