private void button2_Click(object sender, EventArgs e) { if (comboBox1.Text == "Mail") { mail m = new mail(Cno); m.Show(); } if (comboBox1.Text == "Compensate") { int id = Int16.Parse(controllerobj.GetSender(Cno).ToString()); int sal = Int32.Parse(controllerobj.GetDriverSalary(id).ToString()); int newsal = sal + 100; int r = controllerobj.UpdateDriversalary(id, newsal); if (r != 0) { MessageBox.Show("Compensated"); } else { MessageBox.Show("Compensation failed"); } } }
private void button2_Click(object sender, EventArgs e) { if (comboBox1.Text == "Mail") { mail m = new mail(Cno); m.Show(); } if (comboBox1.Text == "Promo") { int id = Int32.Parse(controllerobj.GetSender(Cno).ToString()); int r = controllerobj.SetPromo(id); if (r != 0) { MessageBox.Show("Promo set"); } else { MessageBox.Show("No Promo"); } } if (comboBox1.Text == "Refund") { int Tid = Int32.Parse(controllerobj.GetTripID(Cno).ToString()); int price = Int32.Parse(controllerobj.GetTripPrice(Tid).ToString()); int id = Int32.Parse(controllerobj.GetSender(Cno).ToString()); int r = controllerobj.Refund(id, price); if (r != 0) { MessageBox.Show("Refunded"); } else { MessageBox.Show("Refund failed"); } } }