public void payment() { TPB TT = Application.OpenForms.OfType <TPB>().FirstOrDefault(); Fursan l = new Fursan(); PlatCard pc = new PlatCard(); Airline air = new Airline(); double final; double a = 2500; Hotel gt = new Hotel(); final = a + air.tkbill + gt.hbill; final = final * 1.24; MessageBox.Show("Your Final bill is : " + final, " BILL ", MessageBoxButtons.OK, MessageBoxIcon.Information); if (l.check == 1) { final = final - 500; MessageBox.Show("You have recieved a flat discount of 500 PKR for being a Fursan Member , your bill now is : " + final, "Fursan account logged in", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (TT.pcard.Checked == true) { pc.Credit = 200000; final = final * pc.discount; MessageBox.Show(Convert.ToString(final)); pc.Credit = pc.Credit - final; MessageBox.Show("YOU HAVE RECIEVED A 25% FOR BEING A PLATCARD OWNER AND YOUR BILL NOW IS : " + final + " \nYour payment has been received ," + " deducted from your credit . Your remaining balance is : " + pc.Credit + " Thank you for choosing BABAJI TRAVEL AGENCY", "Payment Rceived", MessageBoxButtons.OK, MessageBoxIcon.Information); TT.Close(); Home hm = new Home(); hm.Show(); } else if (TT.gcard.Checked == true) { GoldCard gc = new GoldCard(); gc.Credit = 100000; final = final * gc.discount; gc.Credit = gc.Credit - final; MessageBox.Show("YOU HAVE RECIEVED A 15% FOR BEING A GOLDCARD OWNER AND YOUR BILL NOW IS : " + final + " \nYour payment has been received ," + " deducted from your credit . Your remaining balance is : " + gc.Credit + " Thank you for choosing BABAJI TRAVEL AGENCY", "Payment Rceived", MessageBoxButtons.OK, MessageBoxIcon.Information); TT.Hide(); Home hm = new Home(); hm.Show(); } else if (TT.ccard.Checked == true) { Card c = new Card(); c.Credit = c.Credit - final; MessageBox.Show(" YOUR BILL IS : " + final + " Your payment has been received ," + " deducted from your credit . Your remaining balance is : " + c.Credit + " Thank you for choosing BABAJI TRAVEL AGENCY", "Payment Rceived", MessageBoxButtons.OK, MessageBoxIcon.Information); TT.Close(); Home hm = new Home(); hm.Show(); } else { MessageBox.Show("Please select card type", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button3_Click(object sender, EventArgs e) { DOperations dao = new DOperations(); try { Hotel ht = new Hotel(); ht.Hotels(); ht.Assignvalues(); TPB TP = new TPB(); Payment tp = new Payment(); tp.show(); TP.Show(); this.Hide(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Exception Unhandled", MessageBoxButtons.OK, MessageBoxIcon.Error); } }