freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

學(xué)生晚歸與考勤管理信息系統(tǒng)的開(kāi)發(fā)-資料下載頁(yè)

2025-04-07 23:06本頁(yè)面
  

【正文】 amp。amp。 region_Id == amp。amp。 startime == amp。amp。 endtime == amp。amp。 room == amp。amp。 name == ) {//如果直接點(diǎn)擊查看按鈕,就直接顯示所有記錄 sql = sql + sqlend。//將兩段SQL語(yǔ)句重新組合 } else {//如果用戶加上了查詢條件 if (dept_Id != ) {//如果用戶選擇了系部,則重新組合SQL語(yǔ)句,加上查詢條件——“系部編號(hào)” sql += and = + dept_Id。 } if (spc_Id != ) { sql += and = + spc_Id。 } if (class_Id != ) { sql += and = + class_Id。 } if (region_Id != ) { sql += and = + region_Id。 } if (startime != amp。amp。 endtime == ) { //sql += and =39。+startime+39。 sql += and like 39。% + startime + %39。//遺留的問(wèn)題,如何對(duì)時(shí)間進(jìn)行模糊查詢 } if (endtime != amp。amp。 startime == ) { sql += and =39。 + endtime + 39。 } if (startime != amp。amp。 endtime != ) { sql += and between39。 + startime + 39。and39。 + endtime + 39。 } if (room != ) { //sql += and =39。+room+39。 sql += and like 39。% + room + %39。//進(jìn)行模糊查詢,使查詢更加人性化,用戶只需要輸入有關(guān)宿舍一個(gè)關(guān)鍵字就可以找到與關(guān)鍵字相關(guān)的記錄 } if (name != ) { // sql += and =39。+name+39。 sql += and like 39。% + name + %39。//進(jìn)行模糊查詢,使查詢更加人性化,用戶只需要輸入姓名中的一個(gè)關(guān)鍵字就可以找到與關(guān)鍵字相關(guān)的記錄 } sql = sql + sqlend。//在這里將匯總時(shí)需要進(jìn)行分組的sqlend語(yǔ)句重新組合到SQL語(yǔ)句中 } //(sql)。//調(diào)試SQL語(yǔ)句 //()。 DataTable dt = (sql)。 = dt。//將數(shù)據(jù)源綁定到GridView控件 ()。//單擊查詢按鈕時(shí)就顯示用戶需要的數(shù)據(jù)數(shù)據(jù) }這里的匯總功能的實(shí)現(xiàn)的難點(diǎn)在于如何書(shū)寫匯總數(shù)據(jù)的SQL語(yǔ)句,這里的匯總SQL語(yǔ)句使用了匯總函數(shù)count(),匯總的字段為學(xué)生學(xué)號(hào)(stu_id),使用多表聯(lián)合查詢并且需要使用匯總函數(shù)count()時(shí)一定要和group by(分組)一起使用,并且查詢的字段要出現(xiàn)在分組字段中,否則會(huì)出錯(cuò)。到此,晚歸匯總功能模塊就實(shí)現(xiàn)了。到此,晚歸情況管理功能模塊的三個(gè)子模塊就全部實(shí)現(xiàn)了??记谇闆r管理功能模塊和晚歸情況管理功能模塊要實(shí)現(xiàn)的功能幾乎是一模一樣的,只要能做出晚歸情況管理功能模塊就一定能做出考勤情況管理功能模塊,因此當(dāng)要實(shí)現(xiàn)考勤情況管理功能模塊時(shí),直接在晚歸情況管理功能模塊上稍作修改即可。為此,關(guān)于考勤情況管理功能模塊的具體實(shí)現(xiàn)過(guò)程不再陳述,下面是關(guān)于此功能模塊的頁(yè)面設(shè)計(jì)和關(guān)鍵代碼:實(shí)現(xiàn)查詢功能的關(guān)鍵代碼如下:protected void btnSearch_Click(object sender, EventArgs e) { string sql = select ,, from stuInfo,class,attendance,attendtype where = and = and =。 /*如果用戶沒(méi)有選擇查詢條件,只是單擊查詢按鈕,就只執(zhí)行這條SQL語(yǔ)句,將全部的記錄查詢出來(lái)*/ string dept_Id = 。 string spc_Id = 。 string class_Id = 。 string type_id = 。 string startime = 。 string endtime = 。 string room = 。 string name = 。 if (dept_Id != ) {//如果用戶選擇了系部,則重新組合SQL語(yǔ)句,加上查詢條件——“系部編號(hào)” sql += and =+dept_Id。 } if (spc_Id != ) { sql += and =+spc_Id。 } if (class_Id != ) { sql += and =+class_Id。 } if (type_id != ) { sql += and = + type_id。 } if (startime != amp。amp。 endtime==) { //sql += and =39。+startime+39。 sql += and like 39。% + startime + %39。//遺留的問(wèn)題,如何對(duì)時(shí)間進(jìn)行模糊查詢 } if (endtime != amp。amp。 startime==) { sql += and =39。+endtime+39。 } if (startime != amp。amp。 endtime != ) { sql += and between39。 + startime + 39。and39。 + endtime + 39。 } if (room != ) { //sql += and =39。+room+39。 sql += and like 39。% + room + %39。//進(jìn)行模糊查詢,使查詢更加人性化,用戶只需要輸入有關(guān)宿舍一個(gè)關(guān)鍵字就可以找到與關(guān)鍵字相關(guān)的記錄 } if (name != ) { // sql += and =39。+name+39。 sql += and like 39。% + name + %39。//進(jìn)行模糊查詢,使查詢更加人性化,用戶只需要輸入姓名中的一個(gè)關(guān)鍵字就可以找到與關(guān)鍵字相關(guān)的記錄 } //(sql)。//調(diào)試語(yǔ)句,用于調(diào)試SQL語(yǔ)句是否正常 //()。//程序執(zhí)行到這里以后就不再往下執(zhí)行了 DataTable dt = (sql)。 = dt。//綁定數(shù)據(jù)源到GridView_DataShow ()。//顯示數(shù)據(jù) }:實(shí)現(xiàn)查詢匯總功能的關(guān)鍵代碼如下protected void btnSearch_Click(object sender, EventArgs e) { /*這兩種SQL語(yǔ)句的寫法都可以,哪一種比較容易理解就使用哪一種*/ //string sql = select AS 姓名, COUNT() AS 晚歸次數(shù), AS 班級(jí) FROM late INNER JOIN stuInfo ON = INNER JOIN class ON = GROUP BY , , 。 //string sql = select 姓名,count() as 晚歸次數(shù),班級(jí)= from stuInfo,late,class where = and = group by ,。//這里的寫法包含了別名的三種表示方法 string dept_Id = 。 string spc_Id = 。 string class_Id = 。 string type_id = 。 string startime = 。 string endtime = 。 string room = 。 string name = 。 string sql = select 姓名,count() as 考勤次數(shù),班級(jí)= from stuInfo,attendance,class where = and =。 string sqlend = group by ,。//注意:這里的group前面有一個(gè)空格,這個(gè)空格千萬(wàn)不能少,否則SQL語(yǔ)句的組合會(huì)出錯(cuò) if (dept_Id == amp。amp。 spc_Id == amp。amp。 class_Id == amp。amp。 type_id == amp。amp。 startime == amp。amp。 endtime == amp。amp。 room == amp。amp。 name == ) {//如果直接點(diǎn)擊查看按鈕,就直接顯示所有記錄 sql = sql + sqlend。//將兩段SQL語(yǔ)句重新組合 } else {//如果用戶加上了查詢條件 if (dept_Id != ) {//如果用戶選擇了系部,則重新組合SQL語(yǔ)句,加上查詢條件——“系部編號(hào)” sql += and = + dept_Id。 } if (spc_Id != ) { sql += and = + spc_Id。 } if (class_Id != ) { sql += and = + class_Id。 } if (type_id != ) { sql += and = + type_id。 } if (startime != amp。amp。 endtime == ) { //sql += and =39。+startime+39。 sql += and like 39。% + startime + %39。//遺留的問(wèn)題,如何對(duì)時(shí)間進(jìn)行模糊查詢 } if (endtime != amp。amp。 startime == ) {
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1