国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

體檢套餐

2019-11-08 02:05:12
字體:
來源:轉載
供稿:網友

using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;using System.Windows.Forms;namespace 體檢套餐管理系統{    static class PRogram    {        /// <summary>        /// 應用程序的主入口點。        /// </summary>        [STAThread]        static void Main()        {            application.EnableVisualStyles();            Application.SetCompatibleTextRenderingDefault(false);            Application.Run(new Form1());        }    }}

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace 體檢套餐管理系統{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void groupBox1_Enter(object sender, EventArgs e)        {        }        private void Form1_Load(object sender, EventArgs e)        {            HealthCheckItem c1 = new HealthCheckItem();            c1.Name = "身高";            c1.Price = 5;            c1.Description = "用來檢查身高";            HealthCheckItem c2 = new HealthCheckItem();            c2.Name = "體重";            c2.Price = 5;            c2.Description = "用來檢查體重";            HealthCheckItem c3 = new HealthCheckItem();            c3.Name = "肝功能";            c3.Price = 50;            c3.Description = "用來檢查肝功能";            HealthCheckItem c4 = new HealthCheckItem();            c4.Name = "視力";            c4.Price = 10;            c4.Description = "用來檢查視力";            HealthCheckItem c5 = new HealthCheckItem();            c5.Name = "聽力";            c5.Price = 10;            c5.Description = "用來檢查聽力";            HealthCheckItem c6 = new HealthCheckItem();            c6.Name = "B超";            c6.Price = 30;            c6.Description = "用來檢查B超";            HealthCheckItem c7 = new HealthCheckItem();            c7.Name = "心電圖";            c7.Price = 50;            c7.Description = "用來檢查心電圖";            HealthCheckItem c8 = new HealthCheckItem();            c8.Name = "血壓";            c8.Price = 20;            c8.Description = "用來檢查血壓";            HealthCheckItem c9 = new HealthCheckItem();            c9.Name = "血常規";            c9.Price = 20;            c9.Description = "用來檢查血常規";            HealthCheckItem.list.Add(c1);            HealthCheckItem.list.Add(c2);            HealthCheckItem.list.Add(c3);            HealthCheckItem.list.Add(c4);            HealthCheckItem.list.Add(c5);            HealthCheckItem.list.Add(c6);            HealthCheckItem.list.Add(c7);            HealthCheckItem.list.Add(c8);            for (int i = 0; i < HealthCheckItem.list.Count; i++)            {                comboBox2.Items.Add(HealthCheckItem.list[i].Name);            }            List<HealthCheckItem> li = new List<HealthCheckItem>();            li.Add(c1);            li.Add(c2);            li.Add(c3);            HealthCheckItem.dictionary.Add("入學體檢", li);        }        private void button1_Click(object sender, EventArgs e)        {            //添加體檢套餐管理系統            List<HealthCheckItem> li = new List<HealthCheckItem>();            string name = textBox1.Text;            HealthCheckItem.dictionary.Add("name", li);            comboBox1.Items.Add(textBox1.Text);            MessageBox.Show("添加成功!");        }        private void button2_Click(object sender, EventArgs e)        {            int sum=0;            string name = comboBox1.Text;            List<HealthCheckItem> li = HealthCheckItem.dictionary[name];            foreach (HealthCheckItem c in HealthCheckItem.list)            {                if (c.Name == comboBox2.Text)                {                    li.Add(c);                    sum += c.Price;                    MessageBox.Show("添加成功");                    break;                }                label7.Text = sum.ToString();                this.dataGridView1.DataSource = new BindingList<HealthCheckItem>(HealthCheckItem.dictionary[comboBox1.Text]);            }        }        private void button3_Click(object sender, EventArgs e)        {            int sum = 0;            string name = comboBox1.Text;            List<HealthCheckItem> li = HealthCheckItem.dictionary[name];            string str = "";            foreach (HealthCheckItem c in HealthCheckItem.list)            {                str = dataGridView1.SelectedRows[0].Cells["Column1"].Value.ToString();                if (c.Name== str)                {                    li.Remove(c);                    sum -= c.Price;                    MessageBox.Show("刪除成功!");                    break;                }            }            label7.Text = sum.ToString();            this.dataGridView1.DataSource = new BindingList<HealthCheckItem>(HealthCheckItem.dictionary[comboBox1.Text]);        }        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)        {            int sum = 0;            label5.Text = comboBox1.Text;            List<HealthCheckItem> li = new List<HealthCheckItem>();            li = HealthCheckItem.dictionary[comboBox1.Text];            foreach (HealthCheckItem c in li)            {                sum += c.Price;            }            label7.Text = sum.ToString(); this.dataGridView1.DataSource = new BindingList<HealthCheckItem>(HealthCheckItem.dictionary[comboBox1.Text]);        }    }}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 唐河县| 平江县| 汤阴县| 准格尔旗| 洞头县| 承德市| 兴宁市| 乌拉特后旗| 黎城县| 泸定县| 白水县| 龙里县| 富顺县| 志丹县| 横峰县| 水城县| 连城县| 连城县| 德清县| 三河市| 灌云县| 武冈市| 孝义市| 廊坊市| 射阳县| 巴彦淖尔市| 宕昌县| 阿勒泰市| 邮箱| 马关县| 宜丰县| 忻城县| 萨迦县| 瓮安县| 光泽县| 贡觉县| 全椒县| 裕民县| 宜章县| 滨州市| 安塞县|