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()
{
C#第五章 套餐体检
最新推荐文章于 2021-01-31 14:10:30 发布
本文详细讲解了如何在C#项目中设计并实现套餐体检功能,涵盖了数据模型设计、业务逻辑处理以及用户界面展示的关键步骤,帮助开发者理解在实际开发中如何处理此类问题。
摘要由CSDN通过智能技术生成