using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 门?票±销ú售?
{
public partial class 门?票±销ú售? : Form
{
public 门?票±销ú售?()
{
}
InitializeComponent();
private void btnPayment_Click(object sender, EventArgs e)
{
double payment, receiving, balance, price;
int tickets;
try
{
tickets = Int32.Parse(txtTotalticket.Text);
payment = double.Parse(txtPayment.Text);
price = double.Parse(txtPrice.Text);
receiving = tickets * price;
txtReceive.Text = string.Format("{0:f2}", receiving);
balance = payment - receiving;
txtChange.Text = string.Format("{0:f2}", balance);
}
catch
{
MessageBox.Show("输?入?有瓺错洙?!?请?检ì查é购o票±类え?型í、¢折?扣?、¢
数簓量?与?应畖付?款?");
return;
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
}
Application.Exit();
private void cmbTicket_SelectedIndexChanged(object sender, EventArgs e)
txtTotalticket.ReadOnly = false;
txtPayment.ReadOnly = false;
txtReceive.Text = "";
txtChange.Text = "";
grpDiscount.Enabled = false;
double
commonPrice = 35.00;
switch (cmbTicketType.SelectedIndex)
case 0:
txtPrice.Text = string.Format("{0:f2}", commonPrice);
break;
case 1:
txtPrice.Text = string.Format("{0:f2}", commonPrice*50/100);
break;
case 2:
grpDiscount.Enabled = true;
rdbNine.Checked = true;
txtPrice.Text = string.Format("{0:f2}", commonPrice * 90 / 100);
break;
{
}
{
}
private void rdbNine_CheckedChanged(object sender, EventArgs e)
{
}
double
commonPrice = 35.00;
txtPrice.Text = string.Format("{0:f2}", commonPrice * 90 / 100);
private void rdbeight_CheckedChanged(object sender, EventArgs e)
{
}
double
commonPrice = 35.00;
txtPrice.Text = string.Format("{0:f2}", commonPrice * 80 / 100);
private void rdbsixfive_CheckedChanged(object sender, EventArgs e)
{
}
double
commonPrice = 35.00;
txtPrice.Text = string.Format("{0:f2}", commonPrice * 65 / 100);
}
}