C# 门票销售器
来源:互联网 发布:sql自连接查询例子 编辑:程序博客网 时间:2024/03/29 13:23
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace 售票器
{
public partial class Form1 : Form
{
private const float price = 50; //在此强制输入门票单价
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
private void button1_Click(object sender, EventArgs e)
{
double fukuan, yingfukuan, zhaoling, price; //付款(fukuan),应付款(yingfukuan),找零(zhaoling),单价(price)
int shuliang;
try
{
fukuan = double.Parse(textBox2.Text);
shuliang = Int32.Parse(textBox1.Text);
price = double.Parse(textBox5.Text);
}
catch (System.FormatException)
{
MessageBox.Show("");
return;
}
yingfukuan = shuliang * price;
textBox3.Text = string.Format("{0:f2}", yingfukuan);
zhaoling = fukuan - yingfukuan;
textBox4.Text = string.Format("{0:f2}", zhaoling);
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//开启购票数量和购票款输入功能
textBox1.ReadOnly = false;
textBox2.ReadOnly = false;
//清空“应收款”和“找零”显示内容
textBox3.Text = "";
textBox4.Text = "";
//置折扣设置不可用
groupBox1.Enabled = false;
//判断当前选择的是哪种票
switch (comboBox1.SelectedIndex)
{
case 0: //成人票
textBox5.Text = string.Format("{0:f2}", price);
break;
case 1: //儿童票
textBox5.Text = string.Format("{0:f2}", price * 0.5f);
break;
case 2: //折扣票
groupBox1.Enabled = true;
radioButton1.Checked = true;
textBox5.Text = string.Format("{0:f2}", price * 0.9f);
break;
}
}
//分别单击九折,八折,六五折单选按钮
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
textBox5.Text = string.Format("{0:f2}", price * 0.9f);
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
textBox5.Text = string.Format("{0:f2}", price * 0.8f);
}
private void groupBox1_Enter(object sender, EventArgs e)
{
textBox5.Text = string.Format("{0:f2}", price * 0.65f);
}
}
}
- C# 门票销售器
- 门票销售计算器
- 北京奥运门票销售4月启动(票价一览表)
- 成佩涛——免费门票销售和报名收费平台
- 门票
- 奥运门票因技术原因暂停销售 11月5日将公布新办法
- 使用synchronized关键字解决共享数据同步问题:多线程门票销售
- Tech•Ed 2010(中国)微软技术大会使用mymova进行门票销售与会议推广服务
- 景点门票
- 销售
- 销售
- 销售
- 销售
- 销售
- 销售
- c# winform 服装店销售软件,小型服装店CRM系统
- 销售C#版代码生成器 - 支持PowerDesigner设计文档
- 开心!奥运门票在手 :)
- hello,friend!
- Securing and Hardening Red Hat Linux Production Systems
- Java vs. .NET:就业市场和薪资比较
- 近四年来国外主流编程语言发展趋势
- 测试测试
- C# 门票销售器
- 初识C++/STL
- 1.3.2 使用SQL和JDBC手工实现持久层
- Sentences
- C#加密解密
- PHP经典乱码“锘”字与解决办法
- Java对文件压缩/加密/解密/解压缩的例子,DES/RSA
- PHP UTF-8的 BOM 问题解决
- PHP版UTF-8文件BOM自动检测移除程序