體檢套餐管理系統 C

2021-10-02 13:58:13 字數 3705 閱讀 9462

效果圖如下:

實現的功能主要有以下幾個方面:

具體**及注釋如下:

1:建立體檢專案維護系統中的檢查專案類(healthcheckitem)、體檢**類(healthcheckset)

using system;

using system.collections.generic;

using system.linq;

using system.text;

using system.threading.tasks;

namespace 體檢**管理系統

public

string name

public

int price

//帶參建構函式

public

healthcheckitem

(string name,

int price,

string dec)

}}

using system;

using system.collections.generic;

using system.linq;

using system.text;

using system.threading.tasks;

namespace 體檢**管理系統

public

string name

public list items

//****計算方法

public

void

calcprice()

this

.price = totalprice;

//賦值給當前****

}//無參構造例項化items

public

healthcheckset()

//帶參構造方法

public

healthcheckset

(string name,list items)

}}

2:使用集合儲存對應的資料,具體看**和注釋注釋一看就明白

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 體檢**管理系統

//窗體載入事件

private

void

frmmadin_load

(object sender,

eventargs e)

//刪除事件

private

void

button3_click

(object sender,

eventargs e)

//新增事件

private

void

button2_click

(object sender,

eventargs e)

//新增**事件

private

void

button1_click

(object sender,

eventargs e)

//初始化幾個檢查專案,並繫結下拉框

public

void

bangding()

//預設選中第一項

combobox2.selectedindex =0;

}//初始化**,及繫結**列表

public

void

taocanbang()

//載入體檢**下拉列表方法

public

void

jiazaitijian()

//預設選中第一項

combobox1.selectedindex =0;

}///

/// 繫結datagridview,填充資料

///

private

void

updateset

(healthcheckset hls)

//當**下拉框發生改變時,載入出相應的檢查專案

private

void

combobox1_selectedindexchanged

(object sender,

eventargs e)

//設定**名稱,通過key鍵訪問**名稱

label6.text = heal[cboname]

.name;

//設定****,

label7.text = heal[cboname]

.price.

tostring()

;//呼叫繫結datagridview方法

updateset

(heal[cboname]);

button3.enabled =

true

; button2.enabled =

true;}

///

/// 刪除檢查專案

///

public

void

delectset()

else

}///

/// 新增檢查專案方法

///

public

void

tianjia()

//接收**名稱

string cbosettext = combobox1.text;

//接收選中的檢查專案的索引

int index = combobox2.selectedindex -1;

//判斷要新增的檢查專案,是否已經存在,存在返回true,不存在返回falseif(

!this

.heal[cbosettext]

.items.

contains

(allitems[index]))

else

}//新增**方法

public

void

tianjaitaocan()

else

}//建立體檢**類

healthcheckset hs =

newhealthcheckset()

;//新增到泛型集合中

heal.

add(textbox1.text,hs)

;//呼叫載入體檢**下拉列表的方法

jiazaitijian()

; heal[textbox1.text]

.name = textbox1.text;}}

}}

體檢套餐管理系統

今天,我們來寫乙個體檢 管理系統的小專案 專案需求 1.載入預設體檢 如下圖所示 2.顯示指定 的專案明細 3.向指定 新增檢查專案資訊 4.刪除 中的專案資訊 5.新建 開始 首先要做的就是搭好窗體 然後建立checkitems類 public class checkitems public st...

C oop體檢套餐管理系統

using system using system.collections.generic using system.linq using system.text using system.threading.tasks namespace healthcheck set private strin...

C 第五章 套餐體檢

using system using system.collections.generic using system.linq using system.text namespace 體檢專案 public int price public listitems public checkset pub...