C#第五章 套餐体检

本文详细讲解了如何在C#项目中设计并实现套餐体检功能,涵盖了数据模型设计、业务逻辑处理以及用户界面展示的关键步骤,帮助开发者理解在实际开发中如何处理此类问题。
摘要由CSDN通过智能技术生成

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
  
namespace 体检项目  
{  
   public class CheckSet  
    {  
        public string Name { get; set; }  
        public int Price { get; set; }  
        public List<Health> items { get; set; }  
        public CheckSet()  
        {  
            items = new List<Health>();  
        }  
        public CheckSet(string name,List<Health> item)  
        {  
            this.Name = name;  
            this.items = item;  
        }  
        public void CalPrice()   
        {  
            int total = 0;  
            foreach (Health h in items)  
            {  
                total = total + h.Price;  
            }  
            this.Price = total;  
        }  
    }  
}  

[csharp] view plain copy 在CODE上查看代码片派生到我的代码片
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
  
namespace 体检项目  
{  
    //检查项目类  
  public  class Health  
    {  
        public string Name { get; set; }  
        public string Description { get; set; }  
        public int Price { get; set; }  
        public Health()  
        {  
  
        }  
        public Health(string name,string ds,int price)  
        {  
            this.Name = name;  
            this.Description = ds;  
            this.Price = price;  
        }  
    }  
}  

[csharp] view plain copy 在CODE上查看代码片派生到我的代码片
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 Form1 : Form  
    {  
        public Form1()  
        {  
   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值